# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1081665733 0 # Node ID 788299414ae08b3d97bc3c414f2a60f02aa1612a # Parent d940dc1ff46242b2fcad198c525e80d13f33278f Fixes for resource based bitmap buttons using icons. diff -r d940dc1ff462 -r 788299414ae0 os2/dw.c --- a/os2/dw.c Sun Apr 11 05:58:43 2004 +0000 +++ b/os2/dw.c Sun Apr 11 06:42:13 2004 +0000 @@ -3029,8 +3029,8 @@ if(dw_window_get_data(hwnd, "_dw_disabled")) halftone = DP_HALFTONED; - x = (width - 16)/2; - y = (height - 16)/2; + x = (width - 16)/2; + y = (height - 16)/2; WinDrawPointer(hps, x + indent, y - indent, icon, halftone | DP_MINI); WinReleasePS(hps); @@ -4625,8 +4625,8 @@ WC_BUTTON, name, WS_VISIBLE | BS_PUSHBUTTON | - BS_BITMAP | BS_AUTOSIZE | - BS_NOPOINTERFOCUS, + BS_NOPOINTERFOCUS | BS_AUTOSIZE | + (icon ? 0 : BS_BITMAP), 0,0,2000,1000, NULLHANDLE, HWND_TOP, @@ -4634,15 +4634,15 @@ NULL, NULL); - if(icon) - dw_window_set_data(tmp, "_dw_button_icon", (void *)icon); - bubble->id = id; strncpy(bubble->bubbletext, text, BUBBLE_HELP_MAX - 1); bubble->bubbletext[BUBBLE_HELP_MAX - 1] = '\0'; bubble->pOldProc = WinSubclassWindow(tmp, _BtProc); WinSetWindowPtr(tmp, QWP_USER, bubble); + + if(icon) + dw_window_set_data(tmp, "_dw_button_icon", (void *)icon); dw_window_set_data(tmp, "_dw_bitmapbutton", (void *)1); return tmp; }