Page 1 of 1
Text field with classic cursor
Posted: Tue Feb 16, 2016 12:08 am
by croivo
Hello,
Is there any way to get rid of this cursor when part of the text is selected inside text field?

- Cursor
- WP_20160215_23_54_51_Pro.png (130.64 KiB) Viewed 4154 times
If you accidentaly drag, the whole text will mess up. I couldn't find any option how to disable this feature.
Thank you...
PS. I took photo with camera because cursor isn't visible on screenshot

Re: Text field with classic cursor
Posted: Tue Feb 16, 2016 3:01 am
by dunbarx
Hi.
I am on a Mac. You are talking about the cursor that appears when the, er, cursor is over the selectedText? Mine looks different, and, since I am on a Mac, not so much like demons have taken over that object.
But this is simple, because anything can be done with LC. Put this in the field script:
Code: Select all
on mouseMove
if the mouseLoc is within the rect of me then
lock cursor
set the cursor to arrow
else
unlock cursor
end if
end mouseMove
Now the cursor will not change when it enters the selected area. But it also will not show as a standard text selection cursor when in the UNSELECTED area of the field. Now for the fun part. The "selectedLoc" is a native function. Check the dictionary. This can be exploited to derive the dimensions of the "selectiedRect" (a function that I just made up). The point being that you might want to write a handler that changes the cursor only when it is within that selected (colored) region.
Get going. Write back if you get stuck..
Craig Newman
Re: Text field with classic cursor
Posted: Tue Feb 16, 2016 6:51 pm
by dunbarx
Hi again.
That the strange cursor you are trying to squash is indeed an indicator that a drag and drop operation is available. The gadget I made will not change that behavior.
But it got me to thinking. When you say "accidentally drag...", it is not easy to do that. The drag has to enter a valid "drop" object, like another field, in order to execute. Do you often accidentally drag that far? In other words, are you trying to get rid of the cursor, or prevent dragging at all?
Craig
Re: Text field with classic cursor
Posted: Thu Feb 18, 2016 1:46 am
by croivo
Prevent dragging at all.
I'm working with a lot of text fields next to each other... I mean, I don't drag text always, but it would be much nicer if there isn't dragging feature.
Thank you for your reply.
Re: Text field with classic cursor
Posted: Thu Feb 18, 2016 2:22 am
by dunbarx
Oh.
Just trap the 'dragStart" message. Two lines.
Craig
Re: Text field with classic cursor
Posted: Fri Feb 19, 2016 11:28 pm
by croivo
Thanks a lot
