changeset 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 63dd52ba9a8f
children b2e060f43329
files win/dw.c
diffstat 1 files changed, 9 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Thu Aug 25 19:33:40 2011 +0000
+++ b/win/dw.c	Thu Aug 25 21:12:25 2011 +0000
@@ -42,6 +42,7 @@
 #define PACKVERSION(major,minor) MAKELONG(minor,major)
 
 #define IS_XPPLUS (dwComctlVer >= PACKVERSION(5,82))
+#define IS_VISTAPLUS (dwComctlVer >= PACKVERSION(6,10))
 
 #ifndef MIN
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -886,21 +887,6 @@
    }
 }
 
-/* ResetWindow:
- *         Resizes window to the exact same size to trigger
- *         recalculation of frame.
- */
-void _ResetWindow(HWND hwndFrame)
-{
-   RECT rcl;
-
-   GetWindowRect(hwndFrame, &rcl);
-   SetWindowPos(hwndFrame, HWND_TOP, 0, 0, rcl.right - rcl.left,
-             rcl.bottom - rcl.top - 1, SWP_NOMOVE | SWP_NOZORDER);
-   SetWindowPos(hwndFrame, HWND_TOP, 0, 0, rcl.right - rcl.left,
-             rcl.bottom - rcl.top, SWP_NOMOVE | SWP_NOZORDER);
-}
-
 /* This function calculates how much space the widgets and boxes require
  * and does expansion as necessary.
  */
@@ -5525,7 +5511,14 @@
 
    cinfo = calloc(1, sizeof(ColorInfo));
    cinfo->buddy = buddy;
-   cinfo->pOldProc = SubclassWindow(tmp, _spinnerwndproc);
+   /* The horrible spinbutton workaround isn't necessary 
+    * any more on Vista or 7... but still seems necessary
+    * for XP, so only enable it if on XP or lower. 
+    */
+   if(!IS_VISTAPLUS)
+   {
+      cinfo->pOldProc = SubclassWindow(tmp, _spinnerwndproc);
+   }
 
    SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
    dw_window_set_font(buddy, DefaultFont);