Format drop-down 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
skindoc4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 77
Joined: Mon Jul 07, 2008 1:22 am

Format drop-down menu

Post by skindoc4 » Mon Dec 29, 2008 12:19 am

Is there a way to format the menuitems of a drop-down menu?

I have searched the documentation and the archives of this forum but cannot find a reference.

Using the Inspector I can choose the font characteristics of the title of the button but I cannot seem to get the same font characterisitics in the drop-down list - it looks a bit clunky to have one font on the title and another in the drop-down list?

Thanks

Alex

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Mon Dec 29, 2008 6:53 am

When you're using the "Appearance Manager" look-and-feel, Revolution asks the operating system to draw the drop-down menus. You may have better luck when using a different look-and-feel (like Windows emulated) as the engine will then do the rendering by itself.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

skindoc4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 77
Joined: Mon Jul 07, 2008 1:22 am

Post by skindoc4 » Mon Dec 29, 2008 7:39 am

mmm - I thought it might be something like that. Would be nice to have full control over the way objects look.

I shall try your suggestion - thanks Jan

Alex

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Mon Dec 29, 2008 12:58 pm

Hi Alex
Is there a way to format the menuitems of a drop-down menu?
If you use a Pull Down, Option or Pop Up Menu, then there is no way you can alter the typeface of the menu items, as Jan wrote.

But if you use a ComboBox Menu, you can: what I mean is, the font and size changes the menu items for a ComboBox, and as the chosen menu item appears in the main box when the ComboBox Menu is closed, the same font and size (as well as the menu pick) is shown.
Would be nice to have full control over the way objects look.
Chipp Walters has written many very useful, most-excellent stacks, some for designing custom controls, two that spring to mind is Custom Button Objects stack:

http://www.altuit.com/webs/altuit2/RunRev/Downloads.htm

and Custom Scrollbars in Revolution:

http://blog.chipp.com/search?updated-ma ... -results=7
(Klaus and Mark have also written stacks for custom scrollbars, found in RevOnline).

There is also an excellent plugin stack for creating gradient background effects but more importantly, custom controls for checkboxes, buttons and sliders, etc., called Interface Designer:

http://www.altuit.com/webs/hemingway/Pr ... oducts.htm

Anyhow, back to Menu Buttons:

I had the problem of altering the appearance of a menu button a couple of months ago and came up with a solution which works well:

1) Drag a ComboBox button to your stack. Put your menuPick menuItem code in this button, as usual.

2) Create your ComboBox button custom look in Photoshop or similar, saved as jpg or png; place this on top of your comboBox button to hide it.

3) In this new image script, put:

Code: Select all

 on mouseDown
    set the enabled of me to false
    end mouseDown  
OK, all's fine here, except the chosen menu item is now hidden, so:

4) Drag a Field to the stack, size it and place it over the image (the "bar" bit, not the picture of the "hold-down arrow", if you see what I mean). Enable Visible and Lock Text only. I'll call it it FieldA.

5) Now go back to the script of the original button and add at the end:

Code: Select all

    global gFormPick
on menuPick whichItem
-- blah
-- blah
--blah
put whichItem into gFormPick
    put gFormPick into field "FieldA"
end menuPick
(I can't remember if a global is absolutely necessary, perhaps a local or even a temporary variable will do...)

I think custom controls are the way to go if you want a consistent look across different platforms.

Hoping that's help for you...

:)

skindoc4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 77
Joined: Mon Jul 07, 2008 1:22 am

Post by skindoc4 » Tue Dec 30, 2008 1:12 am

That's just great, gyroscope :P (your name?)

I try to keep my interfaces simple and intuitive so the idea of having just a few custom controls really appeals. I was thinking about it but you have basically shown me how to approach the problem - thank you.

Alex

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Dec 30, 2008 1:26 pm

Glad it was of help, Alex. :)
That's just great, gyroscope (your name?)
My username, gyroscope, is fine, or David, Dave, Spider or even oi you! :wink:

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue Dec 30, 2008 2:01 pm

And where do you live?
What's your credit card number? (including the 3 numbers on the back) :lol:

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Dec 30, 2008 7:47 pm

Image
:wink:

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Wed Dec 31, 2008 1:03 am

:lol: very funny!

Actually - roughly where in Kent? You may not be too far from me!

skindoc4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 77
Joined: Mon Jul 07, 2008 1:22 am

Post by skindoc4 » Wed Dec 31, 2008 3:21 am

OK - oi you!

I am an old bloke so i like names and since i am in Oz, first ones. I find usernames impersonal.

Seriously - thanks David

Alex

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Wed Dec 31, 2008 2:04 pm

Your most welcome, Alex.
roughly where in Kent?
Sunny Gravesend (where I've lived for 98% of my life, for interest). It'd be a small world if you live just up the road, SparkOut! :)

PS Happy New Year to one and all!!

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Wed Dec 31, 2008 3:22 pm

Happy New Year too.

I used to work in Dartford, driving up the A2 past Gravesend every day. I live in Sittingbourne!

maverickalex
Posts: 108
Joined: Sun Mar 15, 2009 11:51 pm

Post by maverickalex » Wed Mar 18, 2009 1:45 am

Blimey i went to the sea Training College at Gravesend what seems like Eons ago!!! :D

Post Reply