Option Menu Question

Pete pete at mollysrevenge.com
Thu Dec 22 19:37:24 EST 2011


I think I have found a way to do this without using multiple controls.

I have a preOpenCard handler like this:

on preOpenCard
   set the text of button "myMenu" to "Select an option..."
   set the textColor of myMenu to "#666666" --makes the text grey
end preOpenCard

I put the following mouseDown handler into the option menu script.

*on* mouseDown

   *set* the text of me to the textOptions of me

   *set* the textColor of me to black

*end* mouseDown


The textOption custom property contains the real options for the menu.
 I'll probably put the initial prompt text into a custom property too so
it's more general purpose - will also make it easier to check if the user
selected an option or not.


That seems to work just fine but there may be some corner cases I haven't
tested.

On Thu, Dec 22, 2011 at 2:49 PM, Mark Schonewille <
m.schonewille at economy-x-talk.com> wrote:

> Hi Craig,
>
> I put a field on top of the option menu button and send the message to the
> underlying option menu button, which shows the popup menu button, or you
> can do it all directly from the field. The script in the popup menu button
> can put the picked item into the field.
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
>
> Become our partner in sales http://qery.us/1bq Start selling Color
> Converter today. 20% commission!
>
> On 22 dec 2011, at 23:44, dunbarx at aol.com wrote:
>
> > Mark.
> >
> >
> > The same issue with a popup as with the option: you can grey out a
> pulled menuItem with a prepended "(", but it will not show such in the
> normal rest state. Did you mean that this style of button can have this
> feature?
> >
> >
> > Or did you mean that you can roll your own, with greyed text in an
> opaque field overlying the combo? Pete wanted the rest state of menuItem 1
> to be greyed. The options themselves can be managed directly once pulled.
> >
> >
> > Craig
> >
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>


-- 
Pete
Molly's Revenge <http://www.mollysrevenge.com>



More information about the Use-livecode mailing list