Popup menu button - how to prepare the button?

dunbarx at aol.com dunbarx at aol.com
Mon Jul 15 11:27:30 EDT 2013


Hi.


This is really klunky, but maybe you can refine it:




on mouseup
   wait 15
   if not the mouseClick then focus on nothing
end mouseup


LC creates a temporary field that overlays the "cell" in a table field. That is where the entered data goes, and the the engine updates the table field itself when you move on. The trick is to not allow that field to have focus on a single click.


There are likely better ways to do this...


Craig Newman


-----Original Message-----
From: Keith Clarke <keith.clarke at clarkeandclarke.co.uk>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Mon, Jul 15, 2013 10:06 am
Subject: Re: Popup menu button - how to prepare the button?


Thanks for the clarification, Klaus - that works perfectly.

My next challenge is that single left click on a basic table field highlights 
the row (good) and puts the item into edit mode (not desired). How might I go 
about suppressing this default behaviour and force the need for a double-click 
to enter item edit mode?
Best,
Keith..

On 15 Jul 2013, at 14:46, Klaus major-k <klaus at major-k.de> wrote:

> Hi Keith,
> 
> Am 15.07.2013 um 15:41 schrieb Keith Clarke <keith.clarke at clarkeandclarke.co.uk>:
> 
>> Hi folks,
>> I'm trying to set a contextual popup menu to fire when right-clicking in a 
table field - in any 'cell' - but can't find any documentation on how to prepare 
the button itself
>> (so that it's not visible but then appears at the mouse location).
> 
> Just hide the button, it will "popup" anyway :-)
> 
>> My script on the table field is:
>> 
>> on mouseDown
>>  if theButton is 3 then popup menu RowMenu
>>  else pass mouseDown
>> end mouseDown
> 
> try this:
> on mouseDown theButton
>  if theButton = 3 then 
>     popup BTN "RowMenu" at the mouseloc
>  else 
>    pass mouseDown
> end if
> end mouseDown
> 
>> …meanwhile, the RowMenu button just sits happily in the location I created 
it.
>> 
>> Lessons and docs seem to gloss over the button end of the recipe - so what's 
the secret, does it need to be on a different card or sub-stack?
>> Best, 
>> Keith..
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> http://www.major-k.de
> klaus at major-k.de


_______________________________________________
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

 



More information about the use-livecode mailing list