Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently April 18th, 2025, 9:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Listbox Auto-select
PostPosted: March 24th, 2010, 11:23 am 
Offline

Joined: May 28th, 2007, 11:39 pm
Posts: 81
Location: Wirral, UK
Opus: v7.03
OS: XP / Win 7
System: Various
Hi

I'm using a listbox, with users selecting an option to go to another page, based on a variable-change trigger.

When they come back to the screen with the listbox on, is there any way to automatically have the listbox displaying the previous setting, rather than for it to reset to the beginning of the listbox each time?

I've not used much scripting, so if this involves any scripting, I'd appreciate it if you could give me step by step syntax if possible.

Many thanks!

_________________
Opus Pro. v6.0
XP hOME
Intel Core 2 Duo 6550, 2 gb Ram
iNTEGRATED graphics card


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 24th, 2010, 1:49 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Paul,

You can achieve this with minimal scripting.

1. Under Listbox_1 properties, choose a Page variable to associate with the LB Index.
e.g. in this example, I named it 'LB001index' (w/o quotes of course)

2. Next, create a Page variable called 'LB001index2', and make it a Number and Persistent.
That last part is important. (or, you could use a Publication variable for this instead).

3. Create a Listbox_1 action under a Mouse Left Click Trigger. Set Variable... choose LB001index2,
and then below that select Variable LB001index. (what you want is to set: LB001index2 = LB001index )

4. Next and last, set up Listbox_1 OnShow Trigger.
Under that you will add a simple Script (it is an action under 'Programming' tab).
Simply Paste the following:
Code:
wait(0)
Listbox_1.SetListBoxSelection(LB001index2)
It turns out the 'wait(0)' is important here. I could not find a standard Action to do that 'set selection' part. So Script.

Of course for all of the above steps, you 'Apply' or 'OK'...
and you now have a Listbox with PERSISTENT Selection.

Cheers.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: March 24th, 2010, 2:37 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I should add that this set-up can be used in another way. When the User arrives on a new Page,
the Listbox can be used as an 'indicator' of what 'topic' he is viewing... and allow him to select other topics on the same page
(perhaps going to another Frame in a MultiFrame object). It is much like a Menu or ToC.

The variable LB001index2 (above) would be set elsewhere and becomes the 'driver' for which line in the Listbox is pre-selected for the User, and highlighted.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Thank You
PostPosted: March 24th, 2010, 5:03 pm 
Offline

Joined: May 28th, 2007, 11:39 pm
Posts: 81
Location: Wirral, UK
Opus: v7.03
OS: XP / Win 7
System: Various
Many thanks - tried it and it works - fantastic!!!!!

_________________
Opus Pro. v6.0
XP hOME
Intel Core 2 Duo 6550, 2 gb Ram
iNTEGRATED graphics card


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group