comparison win/dw.c @ 555:0d47bec8a5fb

Use LoadImage() and BS_ICON for properly loading the odd sized icon images for bitmap buttons.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 11 Apr 2004 08:35:43 +0000
parents d940dc1ff462
children 1a210e2f214b
comparison
equal deleted inserted replaced
554:6707adaa093d 555:0d47bec8a5fb
4499 HWND API dw_bitmapbutton_new(char *text, ULONG id) 4499 HWND API dw_bitmapbutton_new(char *text, ULONG id)
4500 { 4500 {
4501 HWND tmp; 4501 HWND tmp;
4502 BubbleButton *bubble = calloc(1, sizeof(BubbleButton)); 4502 BubbleButton *bubble = calloc(1, sizeof(BubbleButton));
4503 HBITMAP hbitmap = LoadBitmap(DWInstance, MAKEINTRESOURCE(id)); 4503 HBITMAP hbitmap = LoadBitmap(DWInstance, MAKEINTRESOURCE(id));
4504 HICON icon = LoadIcon(DWInstance, MAKEINTRESOURCE(id)); 4504 HICON icon = LoadImage(DWInstance, MAKEINTRESOURCE(id), IMAGE_ICON, 0, 0, LR_SHARED);
4505 4505
4506 tmp = CreateWindow(BUTTONCLASSNAME, 4506 tmp = CreateWindow(BUTTONCLASSNAME,
4507 "", 4507 "",
4508 WS_CHILD | BS_PUSHBUTTON | 4508 WS_CHILD | BS_PUSHBUTTON |
4509 BS_BITMAP | WS_CLIPCHILDREN | 4509 WS_VISIBLE | WS_CLIPCHILDREN |
4510 WS_VISIBLE, 4510 (icon ? BS_ICON : BS_BITMAP),
4511 0,0,2000,1000, 4511 0,0,2000,1000,
4512 DW_HWND_OBJECT, 4512 DW_HWND_OBJECT,
4513 (HMENU)id, 4513 (HMENU)id,
4514 DWInstance, 4514 DWInstance,
4515 NULL); 4515 NULL);