Textarea selection

I’m creating a program that uses a second screen for a projection device to project info. I can’t figure out how to prevent the operator – who is using the interface on the 1st screen (a laptop) – from moving his mouse into the 2nd screen and selecting text and highlighting. I have the textarea set to “read only” but that doesn’t stop what I’m describing. I’ve looked at every event available in both the textarea and the 2nd screen and its window and nothing seems to do the trick.

It seems I’ve done this before, that is, made a textarea unselectable. But I can’t for the life of me do it now. What am I missing?

in mousedown event for TextArea … return true

in Inspector

  • set readonly ON
  • set UseFocusRing OFF
  • you might also want to turn Scrollbars OFF

Thanks. That does stop the selection of text by mouse. Only problem left is it still leaves a blinking cursor at position 0 and you can still select text using arrow keys and shiftdown. Any cure for that?

Readonly on should make it so there’s no cursor in the text area.

The cursor is gone when I set a TA to those parameters.

Okay, just got rid of the selection by shift-arrow keys … but cursor is still there, blinking away.

I am using Styled text … would that factor in? And it is on the 2nd screen.

platform? this works perfectly in OSX/macos

Oh. Duh. I forgot you’re on Windows.
Uhm. Not sure?

Yeah, sorry, Windows. I always forget to tell that.

Return true in mouse down event on 1st screen works well. It’s this 2nd screen that’s giving me grief. My screen consists only of 3 labels and a textarea.

You could completely suppress any interaction by displaying the TextArea over canvas with DrawInto and keep the actual TextArea off view. Of course you also need to manage MouseWeel in the canvas to change scrollPosition in the actual TextArea.

Otherwise, if you don’t need styled text, a multiline label won’t accept focus.

[quote=310364:@Michel Bujardet]You could completely suppress any interaction by displaying the TextArea over canvas with DrawInto and keep the actual TextArea off view. Of course you also need to manage MouseWeel in the canvas to change scrollPosition in the actual TextArea.

Otherwise, if you don’t need styled text, a multiline label won’t accept focus.[/quote]

Sounds like a good work-around. I’ll see what happens.

btw, I think this may be a bug.

You know, it is much better to post in the Windows channel. You can also change the present thread channel in the Controls popupmenu on top right.

Ah. Didn’t know that. Thanks again.

[quote=310365:@Mark Jordan]Sounds like a good work-around. I’ll see what happens.

btw, I think this may be a bug.[/quote]

No, it is not a bug. Take browsers, for instance, or Adobe reader. They are read only, but they allow selection.

Oh. Then why is it not so on OSX?

It is. Heck, you can even select text in MsgBox.

That is one of my personal favorite features.
Last time I tried on Windows, I don’t recall being able to do so.

It makes sending in error reports so much easier.

But allowing it is one thing: why can’t the programmer prevent it?