Page 1 of 1

Set the items of Option menu

Posted: Sat Feb 14, 2015 10:49 am
by Ultravibe
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!

Re: Set the items of Option menu

Posted: Sat Feb 14, 2015 11:22 am
by jmburnod
Hi UltraVibe,
Try this:

Code: Select all

set the text of btn "RiderA1Number" to RiderSet
Best regards
Jean-Marc

Re: Set the items of Option menu

Posted: Sat Feb 14, 2015 11:43 am
by Ultravibe
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

Re: Set the items of Option menu

Posted: Sat Feb 14, 2015 12:00 pm
by jmburnod
Yes, both work

Re: Set the items of Option menu

Posted: Sat Feb 14, 2015 7:24 pm
by Ultravibe
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)))))

Re: Set the items of Option menu

Posted: Sat Feb 14, 2015 8:27 pm
by jmburnod
Hi,

Code: Select all

set the backgroundcolor of grc "mygrc" to tColor
doesn't work ?

Re: Set the items of Option menu

Posted: Sat Feb 14, 2015 8:42 pm
by Ultravibe
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)))))

Re: Set the items of Option menu

Posted: Sun Feb 15, 2015 1:03 am
by bn
Hi Ultravibe,

just enter the hex color

Code: Select all

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

Bernd

Re: Set the items of Option menu

Posted: Sun Feb 15, 2015 8:03 am
by Ultravibe
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 ))))))))