StringObject ReadOnly

AmigaOS users can make feature requests in this forum.
Post Reply
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

StringObject ReadOnly

Post by mritter0 »

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.
Workbench Explorer - A better way to browse drawers
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: StringObject ReadOnly

Post by chris »

mritter0 wrote: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).
You can right-click and copy from the context menu, even in read-only/disabled string gadgets. You're forced to copy the entire string though, I don't know if this is good enough for your needs?
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: StringObject ReadOnly

Post by mritter0 »

People's natural instinct is to click in the gadget. If nothing happens then they probably won't try to do anything else. I don't think I would. A flashing cursor would tell me I can do things; even if limited.

So no, it is not good enough for my needs. This is one of the only ways a programmer can output data to the user to copy/paste into other apps (or the same app). Maybe I don't want/need to copy the entire string box. Don't limit me.

Come on, developers. Get your creative juices flowing and start pumping out some improvements for ReAction. YOU are holding US back.
Workbench Explorer - A better way to browse drawers
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: StringObject ReadOnly

Post by broadblues »

People's natural instinct is to click in the gadget. If nothing happens then they probably won't try to do anything else. I don't think I would. A flashing cursor would tell me I can do things; even if limited.
A tool tip would help here. I'm not sure if the menu is available in read only mode though anyway.
So no, it is not good enough for my needs. This is one of the only ways a programmer can output data to the user to copy/paste into other apps (or the same app).
Clearly that is not remotely the case as I just coppied and pasted your original message with no read only string gadgets involved :-)
Maybe I don't want/need to copy the entire string box. Don't limit me.
Your limiting yourself here, by not investigating the other ways to do this. You might want to consider the texteditor.gadget as a way of presenting text.
Come on, developers. Get your creative juices flowing and start pumping out some improvements for ReAction. YOU are holding US back.
Reaction has gone through many many improvements, and surelt there is more to do, but outbursts like that are hardly motivating.

Get *your* creative juices flowing and code solutions.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: StringObject ReadOnly

Post by broadblues »

BTW another option for displaying textual info might be via a text.datatype object.
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: StringObject ReadOnly

Post by chris »

broadblues wrote:
People's natural instinct is to click in the gadget. If nothing happens then they probably won't try to do anything else. I don't think I would. A flashing cursor would tell me I can do things; even if limited.
A tool tip would help here. I'm not sure if the menu is available in read only mode though anyway.
It is; I checked before I wrote my original comments.
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: StringObject ReadOnly

Post by mritter0 »

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

Code: Select all

uint32
BlockInputHookFunc(struct Hook *hook,struct SGWork *sgw,uint32 *msg)
{
	if (*msg==SGH_KEY)
	{
		sgw->Actions &= ~SGA_BEEP;
		sgw->Actions &= ~SGA_USE;

		return(~0L);
	}

	return(0);
}
I don't want the screen to beep in error since there isn't one.

Adding SHK_BlOCKINPUT to STRINGA_HookType would be nice.
Workbench Explorer - A better way to browse drawers
Post Reply