GadTools IM_MENU shortcuts

A forum for general AmigaOS 4.x support questions that are not platform-specific
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

GadTools IM_MENU shortcuts

Post by chris »

There seems to be some strange interaction between image menus and shortcuts.

In the attached examples, "shortcut2" has an image menu with a shortcut. The letter associated with that shortcut changes font when the entry is highlighted. There is no way of getting the AmigaKey image or the letter to actually highlight either.

A related problem, in "shortcut", we have a menu with a shortcut, and an image menu item without. The image menu always gains space to pad it out with the missing amigakey icon. I think this is fine, however again there is no way of getting that extra space to highlight when the user is over that entry.

So, to summarise:
An image menu item with a shortcut has the wrong font for the key needing to be pressed.
The space or image for the shortcut area does not highlight if the menu is an image menu item.

I haven't tried combining toggle select items with image menus yet :-)
Attachments
image_menu.lha
(22.49 KiB) Downloaded 347 times
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: GadTools IM_MENU shortcuts

Post by chris »

Also it seems a little bit strange that the AmigaKey+shortcut is added to image menus automatically, but the sub-menu arrow is not.
User avatar
trixie
Posts: 411
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: GadTools IM_MENU shortcuts

Post by trixie »

@chris

I already dread to imagine what I'll find working on that menu class :-D
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: GadTools IM_MENU shortcuts

Post by chris »

trixie wrote:I already dread to imagine what I'll find working on that menu class :-D
You'll be fine with text menus - it's just the image ones have never worked until recently (broken for.. 22 years?!), so they haven't exactly been well tested. I think it's still only me who has tried to use them!

As an aside, I was thinking about my second point a bit more - how the AmigaKey area does not highlight - and there's a bit of an oddity in how the highlighting works anyway.

Only the area the image extends to gets highlighted (horizontally, vertically is fine). It would be far better if the entire menu item was highlighted, and I think that would solve that problem and make it easier to create image menus that look consistent.

I'd been padding them out with a fillrectclass of 0 height, which works but is somewhat ridiculous and doesn't solve the AmigaKey area problem.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 534
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland
Contact:

Re: GadTools IM_MENU shortcuts

Post by salass00 »

chris wrote: So, to summarise:
An image menu item with a shortcut has the wrong font for the key needing to be pressed.
The space or image for the shortcut area does not highlight if the menu is an image menu item.
From doing some testing the former of these issues happens with non-BOOPSI as well as BOOPSI images while the latter one only happens with BOOPSI images (the highlight effect is done differently for these and seems to be restricted to the area covered by the image itself).
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: GadTools IM_MENU shortcuts

Post by chris »

salass00 wrote:
chris wrote: So, to summarise:
An image menu item with a shortcut has the wrong font for the key needing to be pressed.
The space or image for the shortcut area does not highlight if the menu is an image menu item.
the latter one only happens with BOOPSI images (the highlight effect is done differently for these and seems to be restricted to the area covered by the image itself).
Any reason for that? Surely the highlighting should be the same? Or at least the same size?
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: GadTools IM_MENU shortcuts

Post by thomasrapp »

chris wrote:Any reason for that? Surely the highlighting should be the same? Or at least the same size?
BOOPSI images can highlight themselves. Conventional images can't.
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: GadTools IM_MENU shortcuts

Post by chris »

thomasrapp wrote:
chris wrote:Any reason for that? Surely the highlighting should be the same? Or at least the same size?
BOOPSI images can highlight themselves. Conventional images can't.
OK, but there's still a dead zone which needs highlighting.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 534
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland
Contact:

Re: GadTools IM_MENU shortcuts

Post by salass00 »

chris wrote: An image menu item with a shortcut has the wrong font for the key needing to be pressed.
This wrong font problem is now fixed in the latest beta intuition.library. The reason was that normally menu shortcuts use the same font as the menu item text but if it's an image menu item then this is not possible and it will fall back to topaz 8. I've changed it so that it now falls back to the screen font instead which is what gadtools.library defaults to as well unless it's overridden by the program.

Another problem which still also needs to be fixed is that if the image is too high then the shortcut text isn't aligned correctly with the amiga button image. I'll look into that later...
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 534
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland
Contact:

Re: GadTools IM_MENU shortcuts

Post by salass00 »

salass00 wrote: Another problem which still also needs to be fixed is that if the image is too high then the shortcut text isn't aligned correctly with the amiga button image. I'll look into that later...
Just fixed this.

Now looking into the different highlighting of BOOPSI images. The main reason seems to be that BOOPSI image menu items use HIGHIMAGE while non-BOOPSI ones use HIGHCOMP highlighting method. If I change it so that BOOPSI image menu items also use HIGHCOMP it leads to a hard crash when the menu is opened so maybe some code there doesn't like BOOPSI images...
Post Reply