Re: Delete Menu Item from Option Menu Button

2020-11-16 Thread Bob Sneidar via use-livecode
I always use “the text of” to make it more readable. Bob S On Nov 14, 2020, at 4:31 PM, Mark Wieder via use-livecode mailto:use-livecode@lists.runrev.com>> wrote: On 11/14/20 4:03 PM, Roger Guay via use-livecode wrote: Can someone tell me how to delete a menuItem from an Option Menu

Re: Delete Menu Item from Option Menu Button

2020-11-14 Thread Roger Guay via use-livecode
rote: >> Can someone tell me how to delete a menuItem from an Option Menu button >> programmatically? >> Standing by ready to apply dope slap. > > No dope slap necessary - it's not really obvious. > The menuItems are stored as the text of the button, so you can get

Re: Delete Menu Item from Option Menu Button

2020-11-14 Thread Mark Wieder via use-livecode
On 11/14/20 4:03 PM, Roger Guay via use-livecode wrote: Can someone tell me how to delete a menuItem from an Option Menu button programmatically? Standing by ready to apply dope slap. No dope slap necessary - it's not really obvious. The menuItems are stored as the text of the button, s

Delete Menu Item from Option Menu Button

2020-11-14 Thread Roger Guay via use-livecode
Can someone tell me how to delete a menuItem from an Option Menu button programmatically? Standing by ready to apply dope slap. Roger ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and

Re: Setting up an Option Menu Button

2014-03-13 Thread Bob Sneidar
Actually all you need to do is send selectionChanged to the menu button. Bob On Mar 13, 2014, at 08:34 , Peter Haworth mailto:p...@lcsql.com>> wrote: If the menu history of the button is already 1, no menuPick will be generated. Try setting the menu History to zero then 1. Pete lcSQL Software

Re: Setting up an Option Menu Button

2014-03-13 Thread Terence Heaford
Just playing around trying different options and I thin it may be as simple as: on openCard put revDataFromQuery(tab, return, the uDB of stack "THFinancials", "select categoryName from 'categoryList' order by categoryName asc") into tCatNames set the text of cd btn "Categor

Re: Setting up an Option Menu Button

2014-03-13 Thread Terence Heaford
Hi Pete, Simplified by putting addEllipsis into the menu script. put the script below into OpenCard handler on openCard put revDataFromQuery(tab, return, the uDB of stack "THFinancials", "select categoryName from 'categoryList' order by categoryName asc") into tCatNames set the text of cd

Re: Setting up an Option Menu Button

2014-03-13 Thread Peter Haworth
ct item 1 of the menu whenever you go to the card. > > The Card that owns Option Menu Button is also accessed from a Tab Panel. > > I have this script that is used to setup the button and sometimes it works > and other times it doesn't. > > When I say doesn't, the elli

Re: Setting up an Option Menu Button

2014-03-13 Thread Terence Heaford
f cd btn "CategoryMenu" to 1 break end switch end menuPick Hope someone can help All the best Terry On 13 Mar 2014, at 11:40, Terence Heaford wrote: > I have an Option Menu on a card accessed from other cards where I want to > select item 1 of the menu whenever you go t

Setting up an Option Menu Button

2014-03-13 Thread Terence Heaford
I have an Option Menu on a card accessed from other cards where I want to select item 1 of the menu whenever you go to the card. The Card that owns Option Menu Button is also accessed from a Tab Panel. I have this script that is used to setup the button and sometimes it works and other times

Re: option menu button

2013-02-01 Thread Yves COPPE
COPPE > To: Use Rev > Cc: > Sent: Friday, February 1, 2013 9:25 PM > Subject: option menu button > > Hi list, > > is it possible to change the selectedtext of an option menu button from an > other btn without sending a menuPick message to the option menu button >

Re: option menu button

2013-02-01 Thread Jan Schenkel
and more foolish at the same time." (La Rochefoucauld) - Original Message - From: Yves COPPE To: Use Rev Cc: Sent: Friday, February 1, 2013 9:25 PM Subject: option menu button Hi list, is it possible to change the selectedtext of an option menu button from an other btn wi

option menu button

2013-02-01 Thread Yves COPPE
Hi list, is it possible to change the selectedtext of an option menu button from an other btn without sending a menuPick message to the option menu button I want at the end of a script that the menu chosen in an option menu button is set to the first one without the menuPick message of this

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread J. Landman Gay
On 12/10/12 4:38 PM, Robert Sneidar wrote: Value forces LC to evaluate the expression. Also, you can do something like, "value("the name of me", card 1)". Only other thing I can think of is that "do" compiles a statement at runtime. That means if you have a LOT of do statements running in a loop,

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Roger Guay
Oh yes, I know. Thanks very much! On Dec 10, 2012, at 2:11 PM, Jim Hurley wrote: > And Roger, in my code the positive y axis is the usual screen y > axis--positive down. > > If you want to use the traditional cartesian y-axis--positive up-- change y0 > + y to y0 - y > > Otherwise you trig

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Robert Sneidar
uot;sin" in tTrigFunction >>>> replace "cosine" with "cos" in tTrigFunction >>>> replace "tangent" with "tan" in tTrigFunction >> >> Use: >> >>>> replace "cosine" with "cos" in t

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Jim Hurley
t;sine" with "sin" in tTrigFunction >>> replace "tangent" with "tan" in tTrigFunction > > If you replace "sine" with "sin" you also change "cosine" to "cosin" (There > is a "sine" in "cosi

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Roger Guay
t;cosine") > So reverse the order of these first two. > > Jim > > > >> -- >> >> Message: 3 >> Date: Mon, 10 Dec 2012 09:42:55 -0800 >> From: Roger Guay >> To: How to use LiveCode >> Subject: Re:

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Jim Hurley
nction If you replace "sine" with "sin" you also change "cosine" to "cosin" (There is a "sine" in "cosine") So reverse the order of these first two. Jim > -- > > Message: 3 > Date: Mon, 10 Dec 2012 09:42:55 -0800 > From: Roger Guay

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Dick Kriesel
On Dec 10, 2012, at 10:40 AM, Roger Guay wrote: > Question: Is this essentially a "Do" statement in a clever disguise? Yes, although the "value" function can do more than it does in this example (see the dictionary for details). -- Dick ___ use-livec

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Roger Guay
Question: Is this essentially a "Do" statement in a clever disguise? On Dec 10, 2012, at 10:31 AM, Dick Kriesel wrote: > > On Dec 10, 2012, at 8:59 AM, Jim Hurley wrote: > >> get "put the " & tTrigFunction & " of " & tAngle & " into y " >> do it >> > > Hi, Jim and Roger. > >

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Roger Guay
Ah yes, I had a vague recollection of this but couldn't quite get it right. I love it! Thanks, Roger On Dec 10, 2012, at 10:31 AM, Dick Kriesel wrote: > > On Dec 10, 2012, at 8:59 AM, Jim Hurley wrote: > >> get "put the " & tTrigFunction & " of " & tAngle & " into y " >> do it

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Dick Kriesel
On Dec 10, 2012, at 8:59 AM, Jim Hurley wrote: > get "put the " & tTrigFunction & " of " & tAngle & " into y " > do it > Hi, Jim and Roger. If you like more concise code, you can code the above like this: put value( tTrigFunction & "(" & tAngle & ")" ) into y -- Dick ___

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Roger Guay
This script is amazingly fast! And so are you, having apparently produced it in less than an hour!! My script appears to be slightly slower using a switch/case structure. I'll test it out when I get a moment. Thanks very much, Roger On Dec 10, 2012, at 8:59 AM, Jim Hurley wrote: > It turns o

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Jim Hurley
It turns out that Do is fast enough. Here is the Do script: (The script might read a litle better by using "x" in the repeat loop instead of "i".) on mouseUp put the label of btn "myOptionMenu" into tTrigFunction --It might be necessary to take care in using the following replacements

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Jim Hurley
Sorry, Roger, I guess I forgot about that part. Try the script below: >> On Dec 9, 2012, at 8:47 PM, Jim Hurley > > wrote: >> In Roger Guay's problem it is a two step process, (1) get the value for the >> trig function and then (2) a statement, and them combine them into a printed >> statemen

Re: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Roger Guay
On Dec 9, 2012, at 8:47 PM, Jim Hurley wrote: > In Roger Guay's problem it is a two step process, (1) get the value for the > trig function and then (2) a statement, and them combine them into a printed > statement. > This process might be easier to read, and simpler to execute as a > Switch

Re: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Jim Hurley
Hi Mark I can recall one case where Do was the perfect solution for me. It was a tutorial to help students understand the physics of the rainbow. It provided them with a mini-programing language, that allowed them to control how a ray of light might interact with a drop of water. They would write

Re: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Richard Gaskin
Jim Hurley wrote: > But there is certainly a nice generic quality to Do. > "Never mind what, just Do it." And in that lies one more reason to use "do" only with great care: In areas where it may be affected by user inputs it can become an injection vulnerability. The rest of the language is

Re: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Mark Wieder
Jim- Sunday, December 9, 2012, 12:36:07 PM, you wrote: > In many cases it will boil down to taste, and I will grant you > that that is no small issue. It is a good part of what makes coding > satisfying. Good points all. I usually try to avoid do whenever I can due to its inherent slowness and t

Re: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Jim Hurley
Well, Mark, maybe not so flexible. For example, to use Do with the arctan() function in LC, as you suggest, would require you to replace the arctan text with atan text, or more likely the atan2 text, as that is how LC expresses that trig funciton. That might not be easy if arctan text exists

Re: Capture the Trig Function from an Option Menu Button

2012-12-09 Thread Roger Guay
Aw shucks, Mark . . . twas notten. I just copy the many geniuses on this list! Cheers, Roger On Dec 8, 2012, at 8:59 PM, Mark Wieder wrote: > Roger- > > Saturday, December 8, 2012, 7:52:59 PM, you wrote: > >> Please forgive my ignorance here, Mark, but are you suggesting >> another way of do

Re: Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Mark Wieder
Roger- Saturday, December 8, 2012, 7:52:59 PM, you wrote: > Please forgive my ignorance here, Mark, but are you suggesting > another way of doing this kind of thing? Ah, sorry, no. Just describing what you were doing: using a variable to hold the name of a math operator an then executing the var

Re: Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Roger Guay
Please forgive my ignorance here, Mark, but are you suggesting another way of doing this kind of thing? Thanks, Roger On Dec 8, 2012, at 11:15 AM, Mark Wieder wrote: > Jim- > > Saturday, December 8, 2012, 10:11:31 AM, you wrote: > >> But could you tell me how this "mouseUP" handle fails to

Re: Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Roger Guay
On Dec 8, 2012, at 11:25 AM, Jim Hurley wrote: > I put my script into a separate button. I think yours was in the Option > button. I did exactly as you did, i.e. put your script into a separate button, created 2 fields, 1 and 2 > > snip snip > You should get a field 2 that locks like this

Re:Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Jim Hurley
Result into field 2 end menuPick You should get a field 2 that locks like this, if the angle is 45 degrees:: The sine of 45 degrees is 0.707107 Is that the results you wanted? Jim > Hi Jim, > > I was trying to directly use the label of an opt

Re: Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Mark Wieder
Jim- Saturday, December 8, 2012, 10:11:31 AM, you wrote: > But could you tell me how this "mouseUP" handle fails to do the job? Well, it's not nearly as hard to read, for one thing. But seriously, the use of lambda functions (google it) can provide a degree of flexibility in code and help preven

Re: Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Roger Guay
Hi Jim, I was trying to directly use the label of an option menu button (with sin, cos and tan as menu items) and combining that with the angle derived in another script. Something like: put (the label of btn myOptionMenu)&"("&tangle

Re:Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Jim Hurley
quot;The Tangent of " & tAngle*180/pi & " is " & tValue into tResult end switch put tResult into field 2 end mouseUp > > Message: 5 > Date: Fri, 07 Dec 2012 12:10:28 -0800 > From: Roger Guay > To: How to use LiveCode > Subject: Capture the

Re: Capture the Trig Function from an Option Menu Button

2012-12-08 Thread Roger Guay
Thank you, Mark. Works great! On Dec 7, 2012, at 5:40 PM, Mark Wieder wrote: > Roger- > > Or try a one-liner: > > on otherHandler theta > do "put" && sOption & "(" & theta & ")" > end otherHandler > > -- > -Mark Wieder > mwie...@ahsoftware.net > > > __

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Mark Wieder
Roger- Or try a one-liner: on otherHandler theta   do "put" && sOption & "(" & theta & ")" end otherHandler -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, u

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Roger Guay
, BNig < > >> niggemann@ > >> > wrote: >> >>> on otherHandler theta >>> get "put the" && (sOption) && "of" && theta >>> do it >>> put cr & it&& the result after mess

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread BNig
t; > niggemann@ > > wrote: > >> on otherHandler theta >> get "put the" && (sOption) && "of" && theta >> do it >> put cr & it&& the result after message >> end otherHandler -- View this mes

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Roger Guay
Thank you, Bernd. Seems to work. Now to understand. Cheers, Roger On Dec 7, 2012, at 4:05 PM, BNig wrote: > on otherHandler theta > get "put the" && (sOption) && "of" && theta > do it > put cr & it&& the result after message > end otherHandler

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread BNig
line Kind regards Bernd -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Capture-the-Trig-Function-from-an-Option-Menu-Button-tp4657927p4657937.html Sent from the Revolution - User mailing list archive at Nabble.com.

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Jerry Jensen
I tried it too. Didn't work. Once again, I learn to test before posting. On Dec 7, 2012, at 3:31 PM, Roger Guay wrote: > Good thought, but it doesn't work either. And Idid try moving the parens > around. > > > On Dec 7, 2012, at 3:21 PM, Jerry Jensen wrote: > >> Maybe parens like >> get "(p

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Roger Guay
Good thought, but it doesn't work either. And Idid try moving the parens around. On Dec 7, 2012, at 3:21 PM, Jerry Jensen wrote: > Maybe parens like > get "(put the" && sOption && "of" && theta & ")" > would help? > (untested) ___ use-livecode maili

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Jerry Jensen
On Dec 7, 2012, at 3:02 PM, Roger Guay wrote: > Very close but still no cigar. > > I did the following to monitor what was happening > > on thisHandler > put the label of btn "myOptionMenu" into sOption > end thisHandler > > on otherHandler theta > get "put the" && sOption && "of" && theta >

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Roger Guay
Very close but still no cigar. I did the following to monitor what was happening on thisHandler put the label of btn "myOptionMenu" into sOption end thisHandler on otherHandler theta get "put the" && sOption && "of" && theta do it put it&&the result end otherHandler When I execute t

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread J. Landman Gay
On 12/7/12 4:32 PM, J. Landman Gay wrote: Try: local sOption on thisHandler put the label of btn "myOptiionMenu" into sOption end test on otherHandler theta do "put the" && sOption && "of" && theta end otherHandler Or shorter, to avoid the script local variable, read the option button

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread J. Landman Gay
Try: local sOption on thisHandler put the label of btn "myOptiionMenu" into sOption end test on otherHandler theta do "put the" && sOption && "of" && theta end otherHandler On 12/7/12 4:02 PM, Roger Guay wrote: Thanks for your help, Paul. Your second script is more like what I need. BUT,

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Roger Guay
Thanks for your help, Paul. Your second script is more like what I need. BUT, I need to capture the bare function to be used with angles that are derived from some other script. Something like: local theTrigFctn on thisHandler put the label of btn "myOptiionMenu" into tOption switch tOption

Re: Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Paul Hibbert
ak case "tan" put the tan of fld 1 into fld 2 break end switch end thisHandler Paul On 2012-12-07, at 12:10 PM, Roger Guay wrote: > I know this is probably a stupid question, but I can't seem to make it work: > > I have an Option Menu button with si

Capture the Trig Function from an Option Menu Button

2012-12-07 Thread Roger Guay
I know this is probably a stupid question, but I can't seem to make it work: I have an Option Menu button with sin, cos, tan as menu Items. I want my card script to take the label of that button, and then perform the trig function with that label. I've tried every thing I can think

Re: Saving the status of an option menu button in a text file

2012-05-27 Thread Guglielmo Braguglia
Just get the *menuHistory* and save it :-) Guglielmo On 27.05.2012 19:15, Charles Szasz wrote: How do you save the status of an option menu button when saving as a text file? I know how to save the status of a check box and fields in a text file but never had the need to save the status of

Saving the status of an option menu button in a text file

2012-05-27 Thread Charles Szasz
How do you save the status of an option menu button when saving as a text file? I know how to save the status of a check box and fields in a text file but never had the need to save the status of an option menu button. Charles Szasz csz...@mac.com