putting images with options in a dropdown list

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
shalu
Posts: 72
Joined: Fri Mar 20, 2015 1:05 pm

putting images with options in a dropdown list

Post by shalu » Fri Nov 06, 2015 8:22 am

Hi All,

How to add icon along with menu items in a "Option Menu" is it possible

Thanks
Shalu
--
Thanks
Shalu S

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: putting images with options in a dropdown list

Post by MaxV » Fri Nov 06, 2015 2:01 pm

No, you have to create your option menu grouping some controls.
For example create a visible button (or graphic element), clicking on it a group of button appears and clicking on one of the new buttons the button group disappears and the first button get icon and value.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: putting images with options in a dropdown list

Post by dunbarx » Fri Nov 06, 2015 2:56 pm

HI.

Another possibility, a dataGrid of type "form" will do all you ask and more.

It hardly takes more than five minutes to learn how to use one.

Craig Newman

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: putting images with options in a dropdown list

Post by jacque » Fri Nov 06, 2015 7:51 pm

There is also the ability to use a stack as a menu, and display it using the popup command:

popup stack "myMenuStack"

This used to be the only way to create popup menus until the popup command started allowing buttons. It places the first card of the stack into a contextual menu. Each menu item should be a button on the card, and the stack should be sized appropriately for a menu list. Because it's just a regular stack, you can include images, graphics, colors, or whatever you want. The menu stack is usually stored as a substack so it is always available. Call the popup command on a mouseDown, and put a mouseUp handler in the stack to act on that message. If you put the mouseUp handler into the card script, it could use a switch statement just like any other menu.

One advantage of menu stacks is that they behave like regular menus; when an item is selected the menu closes, clicking outside the stack closes the menu, and basically it behaves as you'd expect without much scripting. The disadvantage is that it requires a more careful layout for buttons and their properties so that the visual appearance is correct.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

Re: putting images with options in a dropdown list

Post by sritcp » Fri Nov 06, 2015 10:58 pm

Or, use a list field

Regards,
Sri
Attachments
ListFieldMenu.png
ListFieldMenu.png (10.92 KiB) Viewed 3559 times

Post Reply