comparison os2/dw.c @ 366:4ed3b13ee48c

Code to do the OS/2 style indent when the button is pressed.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 27 Apr 2003 05:43:18 +0000
parents eb86c22a9328
children f19440c0ff71
comparison
equal deleted inserted replaced
365:eb86c22a9328 366:4ed3b13ee48c
2774 WinReleasePS(hpsTemp); 2774 WinReleasePS(hpsTemp);
2775 } 2775 }
2776 return res; 2776 return res;
2777 } 2777 }
2778 2778
2779 MRESULT EXPENTRY _button_draw(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2, PFNWP oldproc) 2779 MRESULT EXPENTRY _button_draw(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2, PFNWP oldproc, int indent)
2780 { 2780 {
2781 HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap"); 2781 HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap");
2782 MRESULT res; 2782 MRESULT res;
2783 2783
2784 if(!oldproc) 2784 if(!oldproc)
2793 dw_window_get_pos_size(hwnd, NULL, NULL, &width, &height); 2793 dw_window_get_pos_size(hwnd, NULL, NULL, &width, &height);
2794 2794
2795 x = (width - pixmap->width)/2; 2795 x = (width - pixmap->width)/2;
2796 y = (height - pixmap->height)/2; 2796 y = (height - pixmap->height)/2;
2797 2797
2798 dw_pixmap_bitblt(hwnd, 0, x, y, pixmap->width, pixmap->height, 0, pixmap, 0, 0); 2798 dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, pixmap, 0, 0);
2799 } 2799 }
2800 return res; 2800 return res;
2801 } 2801 }
2802 2802
2803 /* Function: BtProc 2803 /* Function: BtProc
2819 switch(msg) 2819 switch(msg)
2820 { 2820 {
2821 case WM_PAINT: 2821 case WM_PAINT:
2822 case WM_BUTTON2UP: 2822 case WM_BUTTON2UP:
2823 case WM_BUTTON3UP: 2823 case WM_BUTTON3UP:
2824 return _button_draw(hwnd, msg, mp1, mp2, oldproc); 2824 return _button_draw(hwnd, msg, mp1, mp2, oldproc, 0);
2825 case WM_SETFOCUS: 2825 case WM_SETFOCUS:
2826 if(mp2) 2826 if(mp2)
2827 _run_event(hwnd, msg, mp1, mp2); 2827 _run_event(hwnd, msg, mp1, mp2);
2828 else 2828 else
2829 WinSendMsg(hwnd, BM_SETDEFAULT, 0, 0); 2829 WinSendMsg(hwnd, BM_SETDEFAULT, 0, 0);
2834 case WM_BUTTON1DBLCLK: 2834 case WM_BUTTON1DBLCLK:
2835 case WM_BUTTON2DBLCLK: 2835 case WM_BUTTON2DBLCLK:
2836 case WM_BUTTON3DBLCLK: 2836 case WM_BUTTON3DBLCLK:
2837 if(dw_window_get_data(hwnd, "_dw_disabled")) 2837 if(dw_window_get_data(hwnd, "_dw_disabled"))
2838 return (MRESULT)FALSE; 2838 return (MRESULT)FALSE;
2839 return _button_draw(hwnd, msg, mp1, mp2, oldproc); 2839 return _button_draw(hwnd, msg, mp1, mp2, oldproc, 1);
2840 case WM_BUTTON1UP: 2840 case WM_BUTTON1UP:
2841 { 2841 {
2842 SignalHandler *tmp = Root; 2842 SignalHandler *tmp = Root;
2843 2843
2844 if(WinIsWindowEnabled(hwnd) && !dw_window_get_data(hwnd, "_dw_disabled")) 2844 if(WinIsWindowEnabled(hwnd) && !dw_window_get_data(hwnd, "_dw_disabled"))
2864 if(tmp) 2864 if(tmp)
2865 tmp= tmp->next; 2865 tmp= tmp->next;
2866 } 2866 }
2867 } 2867 }
2868 } 2868 }
2869 return _button_draw(hwnd, msg, mp1, mp2, oldproc); 2869 return _button_draw(hwnd, msg, mp1, mp2, oldproc, 0);
2870 case WM_USER: 2870 case WM_USER:
2871 { 2871 {
2872 SignalHandler *tmp = (SignalHandler *)mp1; 2872 SignalHandler *tmp = (SignalHandler *)mp1;
2873 int (* API clickfunc)(HWND, void *) = NULL; 2873 int (* API clickfunc)(HWND, void *) = NULL;
2874 2874