Fixed bug 2555 (Calendar window does not close automaticaly)
authorGregor Brunmar <gbrunmar.ros@gmail.com>
Wed, 3 Oct 2007 20:47:59 +0000 (20:47 +0000)
committerGregor Brunmar <gbrunmar.ros@gmail.com>
Wed, 3 Oct 2007 20:47:59 +0000 (20:47 +0000)
See issue #2555 for more details.

svn path=/trunk/; revision=29386

reactos/dll/win32/comctl32/comctl32_ros.diff
reactos/dll/win32/comctl32/monthcal.c

index cd77929..6dc3df1 100644 (file)
@@ -195,3 +195,31 @@ Index: treeview.c
      return 0;
  }
  
+Index: monthcal.c
+===================================================================
+--- monthcal.c (revision 29360)
++++ monthcal.c (working copy)
+@@ -1703,11 +1703,12 @@
+ static LRESULT
+-MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr)
++MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr, HWND hFocusWnd)
+ {
+   TRACE("\n");
+-  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
++  if (infoPtr->hwndNotify != hFocusWnd)
++    ShowWindow(infoPtr->hwndSelf, SW_HIDE);
+   return 0;
+ }
+@@ -2015,7 +2016,7 @@
+     return DLGC_WANTARROWS | DLGC_WANTCHARS;
+   case WM_KILLFOCUS:
+-    return MONTHCAL_KillFocus(infoPtr);
++    return MONTHCAL_KillFocus(infoPtr, wParam);
+   case WM_RBUTTONDOWN:
+     return MONTHCAL_RButtonDown(infoPtr, lParam);
index 83da9ad..642de23 100644 (file)
@@ -1703,11 +1703,12 @@ MONTHCAL_Paint(MONTHCAL_INFO *infoPtr, WPARAM wParam)
 
 
 static LRESULT
-MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr)
+MONTHCAL_KillFocus(const MONTHCAL_INFO *infoPtr, HWND hFocusWnd)
 {
   TRACE("\n");
 
-  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
+  if (infoPtr->hwndNotify != hFocusWnd)
+    ShowWindow(infoPtr->hwndSelf, SW_HIDE);
 
   return 0;
 }
@@ -2015,7 +2016,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     return DLGC_WANTARROWS | DLGC_WANTCHARS;
 
   case WM_KILLFOCUS:
-    return MONTHCAL_KillFocus(infoPtr);
+    return MONTHCAL_KillFocus(infoPtr, wParam);
 
   case WM_RBUTTONDOWN:
     return MONTHCAL_RButtonDown(infoPtr, lParam);