Multiple selection in option menu

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
hetman
Posts: 7
Joined: Wed Sep 02, 2009 3:41 pm

Multiple selection in option menu

Post by hetman » Thu Sep 03, 2009 1:48 am

I am new to Runtime Revolution.
Could someone please tell me, how to enable multiple selections in option menu?
Thank You.
hetman

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Sep 03, 2009 8:40 am

Hi hrzmsn,

you can't!
The "design" of an option menu does not allow this, read: use some other control to get this functionality like a list field. :)


Best

Klaus

hetman
Posts: 7
Joined: Wed Sep 02, 2009 3:41 pm

Post by hetman » Mon Sep 07, 2009 9:03 pm

Thank You Klaus, for such a prompt reply.
It answered my question.
hetman

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Tue Sep 08, 2009 9:44 am

Hi hetman

you're welcome and sorry for "hrzmsn" :oops:


Best

Klaus

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Tue Sep 08, 2009 1:38 pm

If you mean adding a checkmark in front of an item as it is selected, that requires a pulldown menu button instead of an option menu button. See als the entry for the menu keyword in the Dictionary.
If you prefix each line with "!n" then you can toggle the items with this script:

Code: Select all

on menuPick
   put the menuhistory of me into tLine
   put the text of me into tText
   put char 2 of line tLine of tText into tOldCheck
   if tOldCheck is "n"
   then put "c" into tNewCheck
   else put "n" into tNewCheck
   put tNewCheck into char 2 of line tLine of tText
   set the text of me to tText
end menuPick
(You can condense this somewhat, but it shows how to do this step-by-step)

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

hetman
Posts: 7
Joined: Wed Sep 02, 2009 3:41 pm

Post by hetman » Wed Sep 09, 2009 3:29 pm

Hello Janschenkel,

What I meant was; I have a directory search form on my card, states are displayed in an option menu. I want to allow the user to select more than one state in their search.

For example: Companies starting with a letter "A" in California and Florida.

Thank You for taking your time to reply to my post.
hetman

Post Reply