Mercurial > dwindows
changeset 551:756477206006
Try to load icons for dw_bitmapbutton_new() before bitmaps from the
executable resources.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 11 Apr 2004 04:39:04 +0000 |
parents | ebb26cb6bfb2 |
children | d940dc1ff462 |
files | os2/dw.c |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/os2/dw.c Sun Apr 11 03:14:21 2004 +0000 +++ b/os2/dw.c Sun Apr 11 04:39:04 2004 +0000 @@ -4610,15 +4610,20 @@ */ HWND API dw_bitmapbutton_new(char *text, ULONG id) { - char idbuf[256]; + char idbuf[256], *name = NULL; HWND tmp; BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); - - _GenResIDStr(idbuf, id); + HPOINTER icon = WinLoadPointer(HWND_DESKTOP, 0L, id); + + if(!icon) + { + name = idbuf; + _GenResIDStr(idbuf, id); + } tmp = WinCreateWindow(HWND_OBJECT, WC_BUTTON, - idbuf, + name, WS_VISIBLE | BS_PUSHBUTTON | BS_BITMAP | BS_AUTOSIZE | BS_NOPOINTERFOCUS, @@ -4629,6 +4634,9 @@ 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';