Page 1 of 1
Msg box works differently than button?
Posted: Tue May 30, 2017 8:39 pm
by dunbarx
This has me stumped. Can't believe I never noticed it before.
Put a few words of text in a field. From a button:
Code: Select all
on mouseUp
select word 2 of fld 1
end mouseUp
No problem, right? But if I run the same line of code from the message box, the selection flashes and does not stick.
HC does not act this way. Not sure if it has always been so in LC (v.6x and 8x).
Craig Newman
Re: Msg box works differently than button?
Posted: Tue May 30, 2017 8:43 pm
by FourthWorld
The LC Message Box selects its text when executed. I don't believe HC did that. Most OSes allow only one text selection at a time, so when something becomes selected any other selection becomes deselected.
What are you working on that needs this behavior in the Message Box? There may be ways to modify the Message Box to support that.
Re: Msg box works differently than button?
Posted: Tue May 30, 2017 9:52 pm
by dunbarx
Richard.
Not sure I know what you mean by
selects its text when executed.
I miswrote slightly. From msg, I simply had they single line "select word 2 of fld 1". In a button, I had the full handler. So when I hit enter in msg, the selection is made, but then lost. Where does it go? What "other" selection is coming up?
Thanks for working this...
Craig
Re: Msg box works differently than button?
Posted: Tue May 30, 2017 10:15 pm
by FourthWorld
When I run a statement from the Message Box, after it's done executing that statement line is then selected in the Message Box window.
Since there can be only one active text selection at a time, once the Message Box selects its text after execution the text that the statement you had run loses its selection.
Re: Msg box works differently than button?
Posted: Tue May 30, 2017 10:33 pm
by dunbarx
Ah.
Now I see what you mean, and how hacking msg might be a way around it. I do not need that at all, I was just testing.
Craig