GA_Underscore

10 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
GA_Underscore
  1. LAYOUT_AddChild, Objects[GAD_DETAILS7]=ButtonObject,
  2. GA_ID, GAD_DETAILS7,
  3. GA_ReadOnly, TRUE,
  4. GA_Underscore, "^",
  5. GA_Text, "",
  6. BUTTON_BevelStyle, BVS_NONE,
  7. BUTTON_Transparent, TRUE,
  8. BUTTON_Justification, BCJ_LEFT,
  9. TAG_DONE),

I use the GA_Underscore like this in all of my button gadgets because I don't want a keyboard shortcut. The text changes and it may have an _ in there occasionally.

Even with the ^ I still get the occasional underscore shortcut implemented when there is no _ in the text. A lot of times on a space character. Is there a better, more reliable way to not get any shortcuts?

I would love a global tag so don't have to put the GA_Underscore in every gadget.

OR

Is there a better gadget/class to use to just show some text, no border, instead of a Button?

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
I am quite sure that

I am quite sure that GA_Underscore needs a character, not a string. So it should be GA_Underscore,'^'. If you supply an address instead, the least signifciant byte of the address will be interpreted as a character. So if the address is for example 0x12345620, the space character (0x20) will be used as underscore.

I would use GA_Underscore,0 to disable this feature.

Thinking of another method, you could try LAYOUT_AddImage,LabelObject,...

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Try GA_Underscore,

Try
GA_Underscore, ~0,
or
GA_Underscore, 0,
as thomas suggested.

  1. LAYOUT_AddImage, LabelObject,
  2. IA_Mode, JAM2,
  3. IA_BGPen, 3,
  4. LABEL_Text, "This is a test",
  5. EndObject,

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
Got home from work and did

Got home from work and did some testing. GA_Underscore,0, does what I want.

Thanks

broadblues
broadblues's picture
Offline
Last seen: 4 years 9 months ago
Joined: 2012-05-02 21:48
Using a Label object would

Using a Label object would work for display purposes but doesn't side step the underscore issue, it would just require IA_Underscore instead....

mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
GA_Underscore, ~0, works

GA_Underscore, ~0, works better/in more classes.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: GA_Underscore

Reopen this topic.

What is better to use for LABEL_Underscore, '0' or '~0' to disable underscore?
I had in KeyMapSwitcher.docky prefs window source set it to '~0', but with russian catalog some strings show wrong (missing some character), changing it to '0' solves the problem.

But if I change LABEL class/object to use BUTTON class/object setting 'GA_Underscore, ~0,' shows same russian string ok.

So how to know when to use '0' or '~0'? Trial & error?

TIA

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

salass00
salass00's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-02-03 11:27
Re: GA_Underscore

The fact is that there hasn't been really an official way to disable shortcut processing. A few gadget/image classes supported using 0 for this purpose but far from all of them which is why I've spent time fixing them as well as replacing deprecated function calls and such.

Using ~0 is a hack that really only works as long as your string doesn't contain any 0xff characters (don't know if this is a valid code in any charset).

gazelle
gazelle's picture
Offline
Last seen: 1 year 9 months ago
Joined: 2011-04-13 12:52
Re: GA_Underscore

At least in ISO 8859 charsets, 0xff is a valid code.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: GA_Underscore

OK thx salas00 & gazelle.
So will stick to use '0' instead of '~0' from now. :-)

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments