FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Navigation problem...

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
ElMacovich
Newbie


Joined: 18 Oct 2006
Posts: 6
Location: Sweden

PostPosted: Tue Oct 24, 2006 2:42 pm    Post subject: Navigation problem... Reply with quote

I have a script where i use a couple of listScreens. When navigate thru these it eventually becomes a loop. Take this example:

salling_clicker_main_listScreen:
myscript -> go to listScreen1

listScreen1:
item1 -> go to listScreen2
item2 -> go to listScreen3

listScreen2:
item1 -> go to listScreen1
item2 -> go to listScreen3

listScreen3:
item1 -> go to listScreen1
item2 -> go to listScreen2

Say I go to listScreen2 and then to listScreen3 and then to listScreen1. When i bress the back button I wanna come to salling_clicker_main_listScreen, but it goes to listScreen3, then listScreen2, then listScreen1 and then when i press back I'm coming to salling_clicker_main_listScreen.

I've tried to used the _Exit function of each listScreen, but when I come to listScreen1 and press back it goes to the screen before.

Is it possible to delete a listScreen, activate it or fix this in some other way?

Please help me!

Thx in advance
Back to top
View user's profile Send private message Visit poster's website
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue Oct 24, 2006 3:22 pm    Post subject: Reply with quote

Hi,

In the script handler that pushes the next list widget, return false. This will pop the existing list from the widget stack.

Sounds like this might solve your problem.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ElMacovich
Newbie


Joined: 18 Oct 2006
Posts: 6
Location: Sweden

PostPosted: Tue Oct 24, 2006 4:40 pm    Post subject: Reply with quote

[quote="salling"]In the script handler that pushes the next list widget, return false. This will pop the existing list from the widget stack.
[/quote]
Thx for the quick answer. This doesn't work for me. Do you mean like this?

[code:1]
function start()
{
var listScreen = CreateListScreen( "listScreen1_" );
listScreen.name = "listScreen1";
listScreen.title = "listScreen1";
listScreen.itemLabels = new Array("Bla", "Bla", "Bla");
listScreen.selectedItem = 0;
theTerminal.Push(listScreen);
}

function listScreen1_ValueUpdated(list, property)
{
if (list.selecteditem == 0)
{
var listScreen = CreateListScreen( "listScreen2_" );
listScreen.name = "listScreen2";
listScreen.title = "listScreen2";
listScreen.itemLabels = new Array("Bla", "Bla", "Bla");
listScreen.selectedItem = 0;
theTerminal.Push(listScreen);
}

}

function listScreen1_Exit(list)
{
// I wanna quit my script here
}

function listScreen2_ValueUpdated(list, property)
{
if (list.selecteditem == 0)
{
var listScreen = CreateListScreen( "listScreen3_" );
listScreen.name = "listScreen3";
listScreen.title = "listScreen3";
listScreen.itemLabels = new Array("Bla", "Bla", "Bla");
listScreen.selectedItem = 0;
theTerminal.Push(listScreen);

// is this what you mean? Should the listScreen2 disappear and when
// you press the back button when in listScreen3 you should come to
// listScreen1?
return false;
}

}

function listScreen2_Exit(list)
{
// I wanna go back to listScreen1 here
}
[/code:1]

Btw, if you return true when pushing new list should that be active or what? And the PopTo function, is that only for windows on the computer?
Back to top
View user's profile Send private message Visit poster's website
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue Oct 24, 2006 5:33 pm    Post subject: Reply with quote

Hm. If you had a "clean" (tree-like) nested list structure, you wouldn't have to bother with returning false, as "back" would automatically bring up the proper list.

I notice that you're not returning false in your listScreen1_ValueUpdated() handler, so listScreen1 will stay on the widget stack whenever you select the first item in this list. With your list structure being circular, this would cause multiple instances of listScreen1 to be on the stack at the same time.

Whenever pushing a new list in listScreenX_ValueUpdated() pop the old one by returning false.

Also, in your listScreenX_Exit() (X = 2 and 3) handlers push the desired list.

PopTo() is used when you need to skip back several widget levels in one fell swoop; such as in the iTunes artist browser (to go back to the main iTunes screen). I do not think it's the answer for you in this case.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ElMacovich
Newbie


Joined: 18 Oct 2006
Posts: 6
Location: Sweden

PostPosted: Tue Oct 24, 2006 5:50 pm    Post subject: Reply with quote

[quote="salling"]PopTo() is used when you need to skip back several widget levels in one fell swoop; such as in the iTunes artist browser (to go back to the main iTunes screen). I do not think it's the answer for you in this case.[/quote]

PopTo did the thing :D

Thank you very much!!!

Script will be out in a few days and I think many people will be very happy about it.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group