HTML in pulldown menus?

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
danielrr
Posts: 142
Joined: Mon Mar 04, 2013 4:03 pm

HTML in pulldown menus?

Post by danielrr » Wed Jun 12, 2013 7:06 pm

Is it possible to use html formatting for the options of the pulldown menus in buttons (as you can, for instance) in dialog windows?

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

Re: HTML in pulldown menus?

Post by Mark » Thu Jun 13, 2013 1:09 am

Hi,

You can create a stack panel instead of a default menu. Use transparent buttons over fields and fill the fields with HTML.

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

danielrr
Posts: 142
Joined: Mon Mar 04, 2013 4:03 pm

Re: HTML in pulldown menus?

Post by danielrr » Thu Jun 13, 2013 6:27 pm

OK, I can live with that, but would't it be easier to create a field than behaver more or less like a pulldown menu?

a call like this one

set the HTMLText of field "listoid" to container
set the visible of field "listoid" to true
get the mouseloc
add 100 to item 1 of it
set the location of field "listoid" to it

is more or less ok, and something like this on the field's script does most of the stuff

on mouseUp
select the clickline
end mouseUp

on mouseDoubleUp
get the value of the clickline
set visible of me to false
doWhateverItTakes it
end mouseDoubleUp

on mouseleave
set visible of me to false
end mouseleave

But this works only it the field has a vertical scrollbar, which is very unlike a pulldown menu. To simulate the real thing and dispense with the scrollbar, some more scripting would be necessary. Before I start implementing one such thing Did anybody else ever wrote such a field-as-pulldown-menu thing and is willing to share with the world?

s

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

Re: HTML in pulldown menus?

Post by Mark » Fri Jun 14, 2013 10:14 am

Hi s,

I don't remember exactly why, as I tried it a very long time ago, but I think that stack panels work best with buttons.

Why do you set the visible to false after a mouseLeave? Perhaps that is the reason why I recommend buttons, together with having to have a scrollbar :wink:

I'd put a little more effort into building the interface and create a stack panel with separate fields for each item and transparent buttons.

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

Post Reply