[PATCH 2/5] Make prev/next month day a current selection on LButton release

Nikolay Sivov bunglehead at gmail.com
Tue Sep 29 14:49:08 CDT 2009


---
 dlls/comctl32/monthcal.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index 583260d..bbf6cb7 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -1564,16 +1564,17 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
 
   infoPtr->status = MC_SEL_LBUTUP;
 
-  if(hit == MCHT_CALENDARDATENEXT) {
-    MONTHCAL_GoToNextMonth(infoPtr);
-    InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
-    return TRUE;
-  }
-  if(hit == MCHT_CALENDARDATEPREV){
-    MONTHCAL_GoToPrevMonth(infoPtr);
+  if((hit == MCHT_CALENDARDATENEXT) || (hit == MCHT_CALENDARDATEPREV)) {
+    SYSTEMTIME st[2];
+
+    st[0] = st[1] = ht.st;
+    MONTHCAL_SetSelRange(infoPtr, st);
+    MONTHCAL_SetCurSel(infoPtr, &st[0]);
+
     InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
     return TRUE;
   }
+
   nmhdr.hwndFrom = infoPtr->hwndSelf;
   nmhdr.idFrom   = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
   nmhdr.code     = NM_RELEASEDCAPTURE;
-- 
1.5.6.5


--=-T4kKbr2gVlJHEjp8Qg16--




More information about the wine-patches mailing list