Re: Button Basics?

2003-08-19 Thread Jan Schenkel
--- [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I can't seem to select individual items of a pop-up
 menu button to enter
 their scripts in 
 the script editor.  I tried
 
 select menuItem X of button Button Y
 
 in the message box, but when I open the script
 editor, it's just for the
 whole button, not 
 the individual items in the button.  What am I
 missing?
 

Hiya,

You cannot set individual scripts for each item ;
you'll have to script the menu as a whole, and handle
the 'menuPick' message.

Suppose you have a menu with items :
  Alpha
  Beta
  Gamma
  Delta

Example script for that menu button :

on menuPick pWhichItem
  switch pWhichItem
  case Alpha
-- the user chose the item labeled Alpha
-- do what needs done here, before 'break'
break
  case Beta
-- the user chose the item labeled Beta
-- do what needs done here, before 'break'
break
  case Gamma
-- the user chose the item labeled Gamma
-- do what needs done here, before 'break'
break
  case Delta
-- the user chose the item labeled Delta
-- do what needs done here, before 'break'
break
  end switch
end menuPick



An alternative way of scripting the individual items
is the following :

- make individual handlers for what each item needs to
do, in the card script

- put the names of these handlers as a
return-delimited list into a custom property named
uMenuMessages in the menu button

- set the script of the menu button to 

on menuPick
  put the menuHistory of me into tPickedLine
  put line tPickedLine of the uMenuMessages \
  of me into tMenuMessage
  send tMenuMessage to this card
end menuPick



For more information than you may ever want to know
regarding menus, fire up the Revolution Documentation,
go to the section 'Development Guide' and click on the
item 'Menus' in the left-hand list.

Hope this helped,

Jan Schenkel.

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Button Basics? -thanks Jan!

2003-08-19 Thread [EMAIL PROTECTED]
Thanks a million to Jan Schenkel!

Problem solved!  I had looked at every single thing in the Menus chapter
of the 
Documentation by Catagory and while I had seen references to MenuPick I 
couldn't make heads or tails out of implementing it.  Sometimes we non
code writers 
know literally nothing and need tips, like the one you gave me, in real
plain English! I 
am following the documentation and beginners discussions closely and have
signed 
up for the Dan Shafer book and I hope to get better at this. Thanks again
and also 
thanks to those of you who answered a couple of other beginners questions
for me in 
the past few weeks!


Lars 


mail2web - Check your email from the web at
http://mail2web.com/ .


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution