Context popup menu removes focus from text field

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
andyt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 15
Joined: Mon Mar 08, 2010 10:41 am

Context popup menu removes focus from text field

Post by andyt » Tue Feb 17, 2015 6:23 pm

I have a text field for basic text entering and I've created a context sensitive popup menu to perform functions such as 'cut and paste'. However when the popup appears the text field loses focus and any text selections made disappear so there is nothing to cut or copy and the cursor disappears so I cannot paste. How do I stop this behaviour?

Less of an issue - but how do I change the cursor back to an arrow when navigating the popup menu - it remains as a text edit icon (as it does in the Live Code IDE editor actually).

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Context popup menu removes focus from text field

Post by Klaus » Tue Feb 17, 2015 6:45 pm

Hi Andy,

problem is that new popup menu buttons have their TRAVERSALON property set to true!
This will cause the focus to go to the button and the text selection will disappear :(

Unfortunately this cannot be set in the inspector, so you need to use the message box:
set the traversalon of btn "your popup button here" to false

That should ease your pain :D
but how do I change the cursor back to an arrow when navigating the popup menu - it remains as a text edit icon (as it does in the Live Code IDE editor actually).
Here I get the arrow when using the popup but it turns back to the LC EDIT tool icon after releasing the mouse!?
Clicking in the field returns to text edit icon again? Hm, that should in fact work correctly automatically :?


Best

Klaus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Context popup menu removes focus from text field

Post by FourthWorld » Tue Feb 17, 2015 6:48 pm

Set the traversalOn of the button to false.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Context popup menu removes focus from text field

Post by Klaus » Tue Feb 17, 2015 6:49 pm

FourthWorld wrote:Set the traversalOn of the button to false.
Yes, Richard :D

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Context popup menu removes focus from text field

Post by FourthWorld » Tue Feb 17, 2015 7:33 pm

Wow. Two messages came in close together. Never seen that on the Internet before. ;)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

andyt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 15
Joined: Mon Mar 08, 2010 10:41 am

Re: Context popup menu removes focus from text field

Post by andyt » Tue Feb 17, 2015 8:38 pm

Thanks gentlemen for you prompt replies - my context menu now works fine. However I still have the cursor issue - oddly I have the same behaviour in the Live Code IDE script editor under Windows 7 (hovering over the context menu still gives me a text edit cursor).

Post Reply