Re: Check Menu Items?

2002-04-21 Thread Richard Harrison

on 4/21/2002 1:08 PM, yves COPPE at [EMAIL PROTECTED] wrote:

> 
> try :
> 
> put text of me into tMenu
> get the menuHistory of me
> if char 1 of line it of tMenu = "!" then
> repeat 2
> delete char 1 of line it of tMenu
> end repeat
> else
> put "!c" before line it of tMenu
> end if
> set text of me to tMenu
> 
> I've done it so and it works.

Thanks for the code snippet!

Rick Harrison

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



Re: Check Menu Items?

2002-04-21 Thread Rick Harrison

on 4/21/2002 1:22 PM, Ken Ray at [EMAIL PROTECTED] wrote:
> 
> You need to do this manually by removing the !c when the menu item is
> selected, and then putting it back in when it is selected again.
> 
> Here's an example:
> 
> on menuPick
> put the menuHistory of me into tSelection
> put me into tMenuItems
> if char 1 to 2 of line tSelection of tMenuItems = "!c" then
> delete char 1 to 2 of line tSelection of tMenuItems
> else
> put "!c" before line tSelection of tMenuItems
> end if
> put tMenuItems into me
> end menuPick

Ken,

Thanks for the code snippet.

It didn't quite work for me the way I wanted it to,
but it was enough of a start that I was able to
work out the rest of the solution for myself.  I was
running into a problem where it was giving me just
the previous item selected and not the current one
chosen.

Thanks again,

Rick Harrison


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



Re: Check Menu Items?

2002-04-21 Thread Ken Ray

Rick,

> The !c checkmarks the menuitem, but I need to have this
> done dynamically depending on which item the user selects.
> The checkmark doesn't go on and off accordingly.  Have I
> missed something?  Where in the documentation did you find
> this little nugget?


You need to do this manually by removing the !c when the menu item is
selected, and then putting it back in when it is selected again.

Here's an example:

on menuPick
  put the menuHistory of me into tSelection
  put me into tMenuItems
  if char 1 to 2 of line tSelection of tMenuItems = "!c" then
delete char 1 to 2 of line tSelection of tMenuItems
  else
put "!c" before line tSelection of tMenuItems
  end if
  put tMenuItems into me
end menuPick

This toggles the checkmark for a menu item in a popup menu button.

BTW: You can find this in the Revolution Documentation - click on the
"RoadMap" button, then click "Development Guide", then "Menus", then "menus
and the menu bar" (under the About section). Scroll down about half way to
"Special Effects In Menus".

Easy! ;-)

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/

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



Re: Check Menu Items?

2002-04-21 Thread yves COPPE

>
>The !c checkmarks the menuitem, but I need to have this
>done dynamically depending on which item the user selects.
>The checkmark doesn't go on and off accordingly.  Have I
>missed something?  Where in the documentation did you find
>this little nugget?
>
>Thanks,
>
>Rick Harrison
>


try :

   put text of me into tMenu
   get the menuHistory of me
   if char 1 of line it of tMenu = "!" then
 repeat 2
   delete char 1 of line it of tMenu
 end repeat
   else
 put "!c" before line it of tMenu
   end if
   set text of me to tMenu

I've done it so and it works.
-- 
Greetings.

Yves COPPE

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



Re: Check Menu Items?

2002-04-21 Thread Rick Harrison

on 4/21/2002 3:42 AM, Dar Scott at [EMAIL PROTECTED] wrote:

> 
> On Saturday, April 20, 2002, at 07:49 PM, Rick Harrison wrote:
> 
>> Does anyone know of an easy way to put a checkmark
>> next to an item that has been selected in a menubar
>> to indicate that the item is the currently selected
>> item?
> 
> I haven't worked with a menu bar, but this is how I did it with
> button menus.
> 
> Put !c at the start of the line for the menu item in the text of
> the button.  There is no need to pad out the other menu items;
> formatting is automatic.
> 
> You might be interested in _ for a line separator, ( to dim, and !r
> for a dot.  The ( can be combined with !c and (I assume) !r.
> 
> Dar Scott
> 

Dar,

The !c checkmarks the menuitem, but I need to have this
done dynamically depending on which item the user selects.
The checkmark doesn't go on and off accordingly.  Have I
missed something?  Where in the documentation did you find
this little nugget?

Thanks,

Rick Harrison

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