HOW TO - Custom Option menu

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

HOW TO - Custom Option menu

Post by palanolho » Mon Aug 05, 2013 9:49 pm

Greetings everyone.

I need to build a menu for my application that would look like something like this (see attachment).

what would be the best way to do it? is there any relevant documentation/tutorials around regarding this matter?

Thanks in advance for any information
- Miguel
Attachments
menus.png

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: HOW TO - Custom Option menu

Post by Mark » Tue Aug 06, 2013 9:07 am

Hi Miguel,

For this, don't use a menu bar. Instead, create your own fake menu bar with pulldown buttons. Create stacks with your menus, using buttons as menu items, and set the menuName of each button to the name of one of the stacks.

You can set the menuName in the properties inspector or with the syntax

Code: Select all

set the menuName of button "Your Button" to stack "Your Menu Stack"
You can use buttons with icons or transparent buttons with graphic objects behind them or any other combination, as long as the buttons are in front of everything else.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Re: HOW TO - Custom Option menu

Post by palanolho » Sun Aug 18, 2013 12:48 pm

hello again everyone.

I Have successfully created a the pull-down menus using the stack as suggested previously.

However I'm having a small issues and would like to know if anyone know how can I deal with it.

I have several OptionMenu buttons. if none of the pull-down options is being displayed at the moment and I click on one of the buttons, the corresponding pull-down options becomes visible.
however, if one of the pull-down options is already visible, if I click on another OptionMEnu button, instead of showing the other corresponding pull-down list, it only hides the pull-down list that is visible at the moment.

So, I would like to know, what could I do so that:
  • When I click off the pull-down list of an OptionMenu button, the pull-down list disappears (default behaviour of livecode)
  • When I click on a OptionMenu button, the corresponding drop-list menu will become visible and any other visible drop-list will become hidden
Thanks in advance for any help

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: HOW TO - Custom Option menu

Post by Simon » Mon Aug 19, 2013 12:35 am

Hi palanolho,
Since I think you have made a custom dropdown menu I'd have to see your code.
Any chance you can make a small stack and post it here.

There are many ways to do what you want but it would be pointless to give you code because it's dependent on what code you already have in place.
I could say:

Code: Select all

on mouseEnter
if the bottom of grp "options" > 22 then -- this means it's visable
set the bottom of grp "opitions" to 22
end if
-- dropdown the 'other' menu
end mouseEnter
That would move one option menu up when you hovered over a different option.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply