Mercurial > dwindows
comparison os2/dw.c @ 553:788299414ae0
Fixes for resource based bitmap buttons using icons.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 11 Apr 2004 06:42:13 +0000 |
parents | 756477206006 |
children | 6707adaa093d |
comparison
equal
deleted
inserted
replaced
552:d940dc1ff462 | 553:788299414ae0 |
---|---|
3027 HPS hps = WinGetPS(hwnd); | 3027 HPS hps = WinGetPS(hwnd); |
3028 | 3028 |
3029 if(dw_window_get_data(hwnd, "_dw_disabled")) | 3029 if(dw_window_get_data(hwnd, "_dw_disabled")) |
3030 halftone = DP_HALFTONED; | 3030 halftone = DP_HALFTONED; |
3031 | 3031 |
3032 x = (width - 16)/2; | 3032 x = (width - 16)/2; |
3033 y = (height - 16)/2; | 3033 y = (height - 16)/2; |
3034 | 3034 |
3035 WinDrawPointer(hps, x + indent, y - indent, icon, halftone | DP_MINI); | 3035 WinDrawPointer(hps, x + indent, y - indent, icon, halftone | DP_MINI); |
3036 WinReleasePS(hps); | 3036 WinReleasePS(hps); |
3037 } | 3037 } |
3038 else if(pixmap) | 3038 else if(pixmap) |
4623 | 4623 |
4624 tmp = WinCreateWindow(HWND_OBJECT, | 4624 tmp = WinCreateWindow(HWND_OBJECT, |
4625 WC_BUTTON, | 4625 WC_BUTTON, |
4626 name, | 4626 name, |
4627 WS_VISIBLE | BS_PUSHBUTTON | | 4627 WS_VISIBLE | BS_PUSHBUTTON | |
4628 BS_BITMAP | BS_AUTOSIZE | | 4628 BS_NOPOINTERFOCUS | BS_AUTOSIZE | |
4629 BS_NOPOINTERFOCUS, | 4629 (icon ? 0 : BS_BITMAP), |
4630 0,0,2000,1000, | 4630 0,0,2000,1000, |
4631 NULLHANDLE, | 4631 NULLHANDLE, |
4632 HWND_TOP, | 4632 HWND_TOP, |
4633 id, | 4633 id, |
4634 NULL, | 4634 NULL, |
4635 NULL); | 4635 NULL); |
4636 | 4636 |
4637 if(icon) | |
4638 dw_window_set_data(tmp, "_dw_button_icon", (void *)icon); | |
4639 | |
4640 bubble->id = id; | 4637 bubble->id = id; |
4641 strncpy(bubble->bubbletext, text, BUBBLE_HELP_MAX - 1); | 4638 strncpy(bubble->bubbletext, text, BUBBLE_HELP_MAX - 1); |
4642 bubble->bubbletext[BUBBLE_HELP_MAX - 1] = '\0'; | 4639 bubble->bubbletext[BUBBLE_HELP_MAX - 1] = '\0'; |
4643 bubble->pOldProc = WinSubclassWindow(tmp, _BtProc); | 4640 bubble->pOldProc = WinSubclassWindow(tmp, _BtProc); |
4644 | 4641 |
4645 WinSetWindowPtr(tmp, QWP_USER, bubble); | 4642 WinSetWindowPtr(tmp, QWP_USER, bubble); |
4643 | |
4644 if(icon) | |
4645 dw_window_set_data(tmp, "_dw_button_icon", (void *)icon); | |
4646 dw_window_set_data(tmp, "_dw_bitmapbutton", (void *)1); | 4646 dw_window_set_data(tmp, "_dw_bitmapbutton", (void *)1); |
4647 return tmp; | 4647 return tmp; |
4648 } | 4648 } |
4649 | 4649 |
4650 /* | 4650 /* |