comparison os2/dw.c @ 547:291f3eae2c25

Use 16x16 mini icon, and added code to draw the depressed button when using icons.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 04 Apr 2004 18:45:40 +0000
parents dac29596615d
children 0369176130af
comparison
equal deleted inserted replaced
546:dac29596615d 547:291f3eae2c25
3006 { 3006 {
3007 HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap"); 3007 HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap");
3008 HPIXMAP disable = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap_disabled"); 3008 HPIXMAP disable = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap_disabled");
3009 HPOINTER icon = (HPOINTER)dw_window_get_data(hwnd, "_dw_button_icon"); 3009 HPOINTER icon = (HPOINTER)dw_window_get_data(hwnd, "_dw_button_icon");
3010 MRESULT res; 3010 MRESULT res;
3011 unsigned long width, height;
3012 int x, y;
3013
3014 dw_window_get_pos_size(hwnd, NULL, NULL, &width, &height);
3011 3015
3012 if(!oldproc) 3016 if(!oldproc)
3013 res = WinDefWindowProc(hwnd, msg, mp1, mp2); 3017 res = WinDefWindowProc(hwnd, msg, mp1, mp2);
3014 res = oldproc(hwnd, msg, mp1, mp2); 3018 res = oldproc(hwnd, msg, mp1, mp2);
3015 3019
3019 HPS hps = WinGetPS(hwnd); 3023 HPS hps = WinGetPS(hwnd);
3020 3024
3021 if(dw_window_get_data(hwnd, "_dw_disabled")) 3025 if(dw_window_get_data(hwnd, "_dw_disabled"))
3022 halftone = DP_HALFTONED; 3026 halftone = DP_HALFTONED;
3023 3027
3024 WinDrawPointer(hps, 5, 5, icon, halftone); 3028 x = (width - 16)/2;
3029 y = (height - 16)/2;
3030
3031 WinDrawPointer(hps, x + indent, y - indent, icon, halftone | DP_MINI);
3025 WinReleasePS(hps); 3032 WinReleasePS(hps);
3026 } 3033 }
3027 else if(pixmap) 3034 else if(pixmap)
3028 { 3035 {
3029 unsigned long width, height;
3030 int x, y;
3031
3032 dw_window_get_pos_size(hwnd, NULL, NULL, &width, &height);
3033
3034 x = (width - pixmap->width)/2; 3036 x = (width - pixmap->width)/2;
3035 y = (height - pixmap->height)/2; 3037 y = (height - pixmap->height)/2;
3038
3036 3039
3037 if(disable && dw_window_get_data(hwnd, "_dw_disabled")) 3040 if(disable && dw_window_get_data(hwnd, "_dw_disabled"))
3038 dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, disable, 0, 0); 3041 dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, disable, 0, 0);
3039 else 3042 else
3040 dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, pixmap, 0, 0); 3043 dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, pixmap, 0, 0);