comparison os2/dw.c @ 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 0369176130af
children 788299414ae0
comparison
equal deleted inserted replaced
550:ebb26cb6bfb2 551:756477206006
4608 * text: Bubble help text to be displayed. 4608 * text: Bubble help text to be displayed.
4609 * id: An ID of a bitmap in the resource file. 4609 * id: An ID of a bitmap in the resource file.
4610 */ 4610 */
4611 HWND API dw_bitmapbutton_new(char *text, ULONG id) 4611 HWND API dw_bitmapbutton_new(char *text, ULONG id)
4612 { 4612 {
4613 char idbuf[256]; 4613 char idbuf[256], *name = NULL;
4614 HWND tmp; 4614 HWND tmp;
4615 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1); 4615 BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
4616 4616 HPOINTER icon = WinLoadPointer(HWND_DESKTOP, 0L, id);
4617 _GenResIDStr(idbuf, id); 4617
4618 if(!icon)
4619 {
4620 name = idbuf;
4621 _GenResIDStr(idbuf, id);
4622 }
4618 4623
4619 tmp = WinCreateWindow(HWND_OBJECT, 4624 tmp = WinCreateWindow(HWND_OBJECT,
4620 WC_BUTTON, 4625 WC_BUTTON,
4621 idbuf, 4626 name,
4622 WS_VISIBLE | BS_PUSHBUTTON | 4627 WS_VISIBLE | BS_PUSHBUTTON |
4623 BS_BITMAP | BS_AUTOSIZE | 4628 BS_BITMAP | BS_AUTOSIZE |
4624 BS_NOPOINTERFOCUS, 4629 BS_NOPOINTERFOCUS,
4625 0,0,2000,1000, 4630 0,0,2000,1000,
4626 NULLHANDLE, 4631 NULLHANDLE,
4627 HWND_TOP, 4632 HWND_TOP,
4628 id, 4633 id,
4629 NULL, 4634 NULL,
4630 NULL); 4635 NULL);
4636
4637 if(icon)
4638 dw_window_set_data(tmp, "_dw_button_icon", (void *)icon);
4631 4639
4632 bubble->id = id; 4640 bubble->id = id;
4633 strncpy(bubble->bubbletext, text, BUBBLE_HELP_MAX - 1); 4641 strncpy(bubble->bubbletext, text, BUBBLE_HELP_MAX - 1);
4634 bubble->bubbletext[BUBBLE_HELP_MAX - 1] = '\0'; 4642 bubble->bubbletext[BUBBLE_HELP_MAX - 1] = '\0';
4635 bubble->pOldProc = WinSubclassWindow(tmp, _BtProc); 4643 bubble->pOldProc = WinSubclassWindow(tmp, _BtProc);