popups and tokens

Scott Raney raney at metacard.com
Wed Jan 9 13:21:01 EST 2002


On Wed, 09 Jan 2002 "J. Landman Gay" <jacque at hyperactivesw.com> wrote:

> Scott Raney <raney at metacard.com> wrote:
> 
> > > What would be the best way to implement a popup menu when the user
> > > right-clicks over a standard button or over a field?  Should I have a hidden
> > > popup-style button that I re-locate and show wherever the mouse was clicked?
> > 
> > No, use the popup command.  In RR 1.1.1/MC 2.4.1 you can popup a
> > button (required to get proper look and feel on MacOS).
> 
> Could you explain how to do that? What style should the button be on a
> Mac in order to contain menu items and still look correct on Mac OS? I
> can't find a style or a setting that makes the button both look right
> and show its contents.

It has to be (not surprisingly) a popup button (i.e., menuMode popup,
button contents set to the menu items you want to display, menuPick
handler in its script).  The other properties don't matter, and the
button will typically be hidden or placed off screen.  It does need to
be in some open stack, though.  Then, use the command "popup button
whatever" in a mouseDown or mouseUp handler to open that button's menu
panel at the mouse cursor location.
  Regards,
    Scott

PS: as for the "tokens" question, check out the "replace" command to
implement a stripChars(theText,theChars) function (replace with
empty).  Whether using that will be faster depends I'd guess on the
number of chars in theChars.  If just a few, use "replace".  If a lot,
use "repeat for each char" and "is in" to determine whether to keep or
toss the character.

> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com

********************************************************
Scott Raney  raney at metacard.com  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...






More information about the use-livecode mailing list