Page 1 of 1

Context popup menu removes focus from text field

Posted: Tue Feb 17, 2015 6:23 pm
by andyt
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).

Re: Context popup menu removes focus from text field

Posted: Tue Feb 17, 2015 6:45 pm
by Klaus
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

Re: Context popup menu removes focus from text field

Posted: Tue Feb 17, 2015 6:48 pm
by FourthWorld
Set the traversalOn of the button to false.

Re: Context popup menu removes focus from text field

Posted: Tue Feb 17, 2015 6:49 pm
by Klaus
FourthWorld wrote:Set the traversalOn of the button to false.
Yes, Richard :D

Re: Context popup menu removes focus from text field

Posted: Tue Feb 17, 2015 7:33 pm
by FourthWorld
Wow. Two messages came in close together. Never seen that on the Internet before. ;)

Re: Context popup menu removes focus from text field

Posted: Tue Feb 17, 2015 8:38 pm
by andyt
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).