comparison win/dw.c @ 1119:e8e7f048f0b8

Removed spinbutton workaround on Vista and higher... still needed for XP. I was hoping to be able to remove it completely but maybe later. Removed some dead code (_ResetWindow) that is no longer needed.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 25 Aug 2011 21:12:25 +0000
parents 03cd2f3e929d
children 5d27b8562c6f
comparison
equal deleted inserted replaced
1118:63dd52ba9a8f 1119:e8e7f048f0b8
40 SECURITY_DESCRIPTOR _dwsd; 40 SECURITY_DESCRIPTOR _dwsd;
41 41
42 #define PACKVERSION(major,minor) MAKELONG(minor,major) 42 #define PACKVERSION(major,minor) MAKELONG(minor,major)
43 43
44 #define IS_XPPLUS (dwComctlVer >= PACKVERSION(5,82)) 44 #define IS_XPPLUS (dwComctlVer >= PACKVERSION(5,82))
45 #define IS_VISTAPLUS (dwComctlVer >= PACKVERSION(6,10))
45 46
46 #ifndef MIN 47 #ifndef MIN
47 #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 48 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
48 #endif 49 #endif
49 50
882 if(thisbox) 883 if(thisbox)
883 { 884 {
884 if(_focus_check_box_back(thisbox, handle, 1, 0) == 0) 885 if(_focus_check_box_back(thisbox, handle, 1, 0) == 0)
885 _focus_check_box_back(thisbox, handle, 2, 0); 886 _focus_check_box_back(thisbox, handle, 2, 0);
886 } 887 }
887 }
888
889 /* ResetWindow:
890 * Resizes window to the exact same size to trigger
891 * recalculation of frame.
892 */
893 void _ResetWindow(HWND hwndFrame)
894 {
895 RECT rcl;
896
897 GetWindowRect(hwndFrame, &rcl);
898 SetWindowPos(hwndFrame, HWND_TOP, 0, 0, rcl.right - rcl.left,
899 rcl.bottom - rcl.top - 1, SWP_NOMOVE | SWP_NOZORDER);
900 SetWindowPos(hwndFrame, HWND_TOP, 0, 0, rcl.right - rcl.left,
901 rcl.bottom - rcl.top, SWP_NOMOVE | SWP_NOZORDER);
902 } 888 }
903 889
904 /* This function calculates how much space the widgets and boxes require 890 /* This function calculates how much space the widgets and boxes require
905 * and does expansion as necessary. 891 * and does expansion as necessary.
906 */ 892 */
5523 cinfo->pOldProc = SubclassWindow(buddy, _colorwndproc); 5509 cinfo->pOldProc = SubclassWindow(buddy, _colorwndproc);
5524 SetWindowLongPtr(buddy, GWLP_USERDATA, (LONG_PTR)cinfo); 5510 SetWindowLongPtr(buddy, GWLP_USERDATA, (LONG_PTR)cinfo);
5525 5511
5526 cinfo = calloc(1, sizeof(ColorInfo)); 5512 cinfo = calloc(1, sizeof(ColorInfo));
5527 cinfo->buddy = buddy; 5513 cinfo->buddy = buddy;
5528 cinfo->pOldProc = SubclassWindow(tmp, _spinnerwndproc); 5514 /* The horrible spinbutton workaround isn't necessary
5515 * any more on Vista or 7... but still seems necessary
5516 * for XP, so only enable it if on XP or lower.
5517 */
5518 if(!IS_VISTAPLUS)
5519 {
5520 cinfo->pOldProc = SubclassWindow(tmp, _spinnerwndproc);
5521 }
5529 5522
5530 SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo); 5523 SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
5531 dw_window_set_font(buddy, DefaultFont); 5524 dw_window_set_font(buddy, DefaultFont);
5532 return tmp; 5525 return tmp;
5533 } 5526 }