StringObject ReadOnly

3 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
StringObject ReadOnly

Is there a way to make a string object read only YET still allow to click in to copy the text? I don't want the user to be able to type or delete characters, but still copy the string to paste somewhere else (text editor).

I would imagine it would need a hook and ignore all input (except double click to select all, then Copy).

This would make for a nice addition to the class.

STRINGA_NoInput, TRUE,

Windows has this very handy feature; we need it.

trixie
trixie's picture
Offline
Last seen: 6 months 3 weeks ago
Joined: 2011-02-03 13:58
Re: StringObject ReadOnly

If this feature ever gets implemented, I sincerely hope it will not be as goofed-up as in the Texteditor Gadget. Currently, if you select/copy text from a read-only texteditor, the gadget grabs input focus and your keyboard shortcuts stop working until you click somewhere outside the texteditor. This sucks. I understand the inner workings (selecting text activates the gadget) but I repeat: this sucks.

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
I use this STRINGA_EditHook

I use this STRINGA_EditHook with GA_ReadOnly,FALSE, so the cursor is active.

  1. uint32
  2. BlockInputHookFunc(struct Hook *hook,struct SGWork *sgw,uint32 *msg)
  3. {
  4. if (*msg==SGH_KEY)
  5. {
  6. sgw->Actions &= ~SGA_BEEP;
  7. sgw->Actions &= ~SGA_USE;
  8.  
  9. return(~0L);
  10. }
  11.  
  12. return(0);
  13. }

I don't want the screen to beep in error since there really isn't one.

Log in or register to post comments