Set the items of Option menu

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Set the items of Option menu

Post by Ultravibe » Sat Feb 14, 2015 10:49 am

Hello!
my question is: how to set up the items of Option menu in LiveCode?
In Card's script:
i have a "Repeat" structure to scan the database. with X from 1 to 40 i'm reading from database the field "Name" with number X and if "Name" is not empty, i adding the current number X (with "return" charachter) AFTER variable which i call "RiderSet". Why am i doin it? For option menu i don't need whole numbers (1-40) to choose which select, i need just numbers of existing riders.
And now i need to assign this set to items i can choose with Option Menu
i've tried like this:
set menuItems of button "RiderA1Number" to RiderSet
or like this:
put RiderSet into menuItems of button "RiderA1Button"
but it's failed. Write for me right syntax, please!

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Set the items of Option menu

Post by jmburnod » Sat Feb 14, 2015 11:22 am

Hi UltraVibe,
Try this:

Code: Select all

set the text of btn "RiderA1Number" to RiderSet
Best regards
Jean-Marc
https://alternatic.ch

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: Set the items of Option menu

Post by Ultravibe » Sat Feb 14, 2015 11:43 am

jmburnod wrote:Hi UltraVibe,
Try this:

Code: Select all

set the text of btn "RiderA1Number" to RiderSet
Best regards
Jean-Marc
i try like this:

Code: Select all

put RiderSet into button "RiderA1Number"
and it works

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Set the items of Option menu

Post by jmburnod » Sat Feb 14, 2015 12:00 pm

Yes, both work
https://alternatic.ch

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: Set the items of Option menu

Post by Ultravibe » Sat Feb 14, 2015 7:24 pm

One more question, guys!
I got rounded rectangle filled with some color under the group of buttons, checkboxes and something else...
I use it to separate visually several buttons and text fields from each other (it's like visual grouping). How can i change (by program code) the backgroundcolor of these rounded rectangles?
Please write the syntax for me)))))

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Set the items of Option menu

Post by jmburnod » Sat Feb 14, 2015 8:27 pm

Hi,

Code: Select all

set the backgroundcolor of grc "mygrc" to tColor
doesn't work ?
https://alternatic.ch

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: Set the items of Option menu

Post by Ultravibe » Sat Feb 14, 2015 8:42 pm

jmburnod, i found full syntax of this word:
set backcolor of graphic "Name" to red (for example))))))

and by the way, how can i define color in that construction by hex parameters: for example #408080?
tell me, please))))
P.S. I need it in case if i don't know the exact word for needed color)))))

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: Set the items of Option menu

Post by bn » Sun Feb 15, 2015 1:03 am

Hi Ultravibe,

just enter the hex color

Code: Select all

set the backgroundColor of graphic "myGraphic" to "#408080"
Kind regards

Bernd

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: Set the items of Option menu

Post by Ultravibe » Sun Feb 15, 2015 8:03 am

bn, thank you!
i've already find this solution, but at first time i was trying to use just #408080 without " " and it doesn't works.
Adding the " " is correct the problem.
Thank you anyway ))))))))

Post Reply