Just popping in
Joined: 2006/12/5 5:55 Last Login
: 2023/8/9 11:58
Group:
Registered Users
|
Hello,
I have some buttons in my program which have as their label an image and two texts. These work fine under OS3.9; however on OS4.1.1 the blue highlight you expect when pressing it is restricted to just the label area rather than the whole button (this can be seen in eg. palette editor of AmiArcadia V14.51 for OS4). Buttons which are text-only highlight normally. Is this a known bug in OS4?
Each button is defined similarly to this:
LAYOUT_AddChild, gadgets[GID_BU62] = ButtonObject, GA_ID, GID_BU62, GA_RelVerify, TRUE, GA_Image, LabelObject, LABEL_Image, miscglyphimage[0], LABEL_DrawInfo, DrawInfoPtr, LABEL_Text, " ", LABEL_Text, LLL, MSG_OK, "OK"), LabelEnd, ButtonEnd,
and loadmiscglyphs() is like this:
EXPORT void loadmiscglyphs(void) { TRANSIENT int i; TRANSIENT ULONG buttonheight, miscglyphheight; // used to be hardcoded to 9 PERSIST FLAG first = TRUE; PERSIST const STRPTR miscglyphimagename[MISCGLYPHIMAGES] = { "PROGDIR:images/ok", "PROGDIR:images/cancel" };
if (first) { first = FALSE;
DISCARD lockscreen(TRUE);
if (!(miscglyphimage[0] = BitMapObject, BITMAP_SourceFile, miscglyphimagename[0], BITMAP_Screen, ScreenPtr, End)) { unlockscreen(); strcpy(errstring, GetCatalogStr(CatalogPtr, MSG_ERROR_CANTLOAD, "Can't load")); strcat(errstring, " "); strcat(errstring, miscglyphimagename[0]); strcat(errstring, "!"); rq(errstring); } DISCARD GetAttr(BITMAP_Height, miscglyphimage[0], (ULONG *) &miscglyphheight); if (DrawInfoPtr->dri_Font->tf_YSize > miscglyphheight) { buttonheight = DrawInfoPtr->dri_Font->tf_YSize; } else { buttonheight = miscglyphheight; } // buttonheight is whichever is taller: font or bitmap DisposeObject(miscglyphimage[0]); miscglyphimage[0] = NULL;
for (i = 0; i < MISCGLYPHIMAGES; i++) { if (!(miscglyphimage[i] = BitMapObject, BITMAP_SourceFile, miscglyphimagename[i], BITMAP_Screen, ScreenPtr, BITMAP_Masking, TRUE, BITMAP_Transparent, TRUE, IA_Height, buttonheight, End)) { unlockscreen(); strcpy(errstring, GetCatalogStr(CatalogPtr, MSG_ERROR_CANTLOAD, "Can't load")); strcat(errstring, " "); strcat(errstring, miscglyphimagename[i]); strcat(errstring, "!"); rq(errstring); } } unlockscreen(); } }
|