Lists or Menu controls

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Lists or Menu controls

Post by Traxgeek » Wed Jan 16, 2013 8:42 am

Hi,

Again, I'm stumped :oops:

I can 'see' how to create an 'Option Menu' control (like a drop down list), I can 'see' how to populate one (in the IDE and dynamically/programatically), I can 'see' how to respond to a click/selection within the Menu list...
What I can't 'see' is how to programatically select/set a previously made selection within that Option Mnu
Example : various colours have been provided as 'options' for the user to select from. These 'options' have been placed into an 'Option Menu' configurred to be of a 'Type = Combo'. The User has (for our purposes selected 'Red' / Option 3 in the list). FYI, typically, I'd store the option NUMBER and NOT the TEXT of the option.

How can I force this 'Option Menu' to display the correct pre-selected option if I know :
(1) SELECTED ITEM NUMBER (in this case '3') ?
(2) SELECTED TEXT (in this case 'Red') ?

I've tried various combinations of the below (all to no avail)
set the hilite of control N of button "lstColor" to True
set the hilite of button N of button "lstColor" to True
set the hilited button of button "lstColor" to N
set the hilited item of button "lstColor" to N

I've tried replacing 'button' with 'field', 'item', 'menu', 'control'...

I can do this in a group of 'Radio / Option buttons and also for a checkbox but this one stums me...
Again, all very simple I'm sure - but I'm stumped and I've been searching since last night... grrrr...

TIA

Regards
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Lists or Menu controls

Post by shaosean » Wed Jan 16, 2013 10:49 am

Check out the menuHistory property

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Lists or Menu controls

Post by Traxgeek » Wed Jan 16, 2013 11:09 am

Hi shaosean,

What a star !

Code: Select all

set the menuhistory of button "myOptionMenu" to [myValue]
works a dream !

Just brings me back to a previous unresolved 'wish' / request : Is there a list of Controls with each ones available Properties itemised all together, clearly and unambiguously somewhere ?

This help (the tutorial) you provided the link to (thanks a million), obviously exists - but I couldn't find it and, whilst not being averse to just trying every possible property of a control, just to see what it does, had no idea as to even the existance of the 'MenuHistory' property associated with Menu-esque controls...

A list of LC controls and their associated properties would be just brilliant ! Any ideas ? ? ?

TIA and Thanks again shaosean - Appreciated.

Regards.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Lists or Menu controls

Post by Klaus » Wed Jan 16, 2013 1:34 pm

Traxgeek wrote:A list of LC controls and their associated properties would be just brilliant ! Any ideas ? ? ?
Monsieur?

In the dictionary, click any OBJECT on the left side in "Object" (e.g. Button) and see all available properties for this object listed on the right side!
At least here with my Livecode installation 8)

And be sure to check the stacks from the URL I gave you:
http://www.runrev.com/developers/lesson ... nferences/

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Lists or Menu controls

Post by Traxgeek » Wed Jan 16, 2013 5:44 pm

Yet another golden nugget...

I hadn't appreciate the diference beetween the icons down the left hand side of the dictionary thinking it better to leave my searches for help as generic as possible.

How much easier this is going to be (he says, forever the optimist !! ;-) )

Again, thanks a million Klaus.

When I get my app to the app store stage I'll ensure you're mentioned in the About / Help section (for what it's worth) !!

Regards.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”