Commctrl cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ChangeLog:
  -- fix bug in mouse position reading
  -- remove useless code
  -- small code cleanups

Index: dlls/comctl32/comboex.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/comboex.c,v
retrieving revision 1.53
diff -u -r1.53 comboex.c
--- dlls/comctl32/comboex.c	6 Sep 2002 19:41:17 -0000	1.53
+++ dlls/comctl32/comboex.c	9 Sep 2002 02:28:16 -0000
@@ -1923,8 +1923,7 @@
 	    rect.bottom = rect.top + SendMessageW(infoPtr->hwndSelf,
 			                          CB_GETITEMHEIGHT, -1, 0);
 	    rect.left = rect.right - GetSystemMetrics(SM_CXVSCROLL);
-	    pt.x = LOWORD(lParam);
-	    pt.y = HIWORD(lParam);
+	    POINTSTOPOINT(pt, MAKEPOINTS(lParam));
 	    if (PtInRect(&rect, pt))
 		return CallWindowProcW (infoPtr->prevComboWndProc,
 				        hwnd, uMsg, wParam, lParam);
Index: dlls/comctl32/progress.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/progress.c,v
retrieving revision 1.24
diff -u -r1.24 progress.c
--- dlls/comctl32/progress.c	13 Aug 2002 18:08:45 -0000	1.24
+++ dlls/comctl32/progress.c	9 Sep 2002 02:14:33 -0000
@@ -42,10 +42,6 @@
 
 #define LED_GAP    2
 
-#define UNKNOWN_PARAM(msg, wParam, lParam) WARN(       \
-   "Unknown parameter(s) for message " #msg            \
-   "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
-
 /***********************************************************************
  * PROGRESS_Invalidate
  *
@@ -313,7 +309,6 @@
     case PBM_DELTAPOS:
     {
 	INT oldVal;
-        if(lParam) UNKNOWN_PARAM(PBM_DELTAPOS, wParam, lParam);
         oldVal = infoPtr->CurVal;
         if(wParam != 0) {
 	    infoPtr->CurVal += (INT)wParam;
@@ -327,7 +322,6 @@
     case PBM_SETPOS:
     {
 	INT oldVal;
-        if (lParam) UNKNOWN_PARAM(PBM_SETPOS, wParam, lParam);
         oldVal = infoPtr->CurVal;
         if(oldVal != wParam) {
 	    infoPtr->CurVal = (INT)wParam;
@@ -339,13 +333,11 @@
     }
 
     case PBM_SETRANGE:
-        if (wParam) UNKNOWN_PARAM(PBM_SETRANGE, wParam, lParam);
         return PROGRESS_SetRange (infoPtr, (int)LOWORD(lParam), (int)HIWORD(lParam));
 
     case PBM_SETSTEP:
     {
 	INT oldStep;
-        if (lParam) UNKNOWN_PARAM(PBM_SETSTEP, wParam, lParam);
         oldStep = infoPtr->Step;
         infoPtr->Step = (INT)wParam;
         return oldStep;
@@ -354,7 +346,6 @@
     case PBM_STEPIT:
     {
 	INT oldVal;
-        if (wParam || lParam) UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam);
         oldVal = infoPtr->CurVal;
         infoPtr->CurVal += infoPtr->Step;
         if(infoPtr->CurVal > infoPtr->MaxVal)
@@ -378,17 +369,14 @@
         return wParam ? infoPtr->MinVal : infoPtr->MaxVal;
 
     case PBM_GETPOS:
-        if (wParam || lParam) UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam);
         return infoPtr->CurVal;
 
     case PBM_SETBARCOLOR:
-        if (wParam) UNKNOWN_PARAM(PBM_SETBARCOLOR, wParam, lParam);
         infoPtr->ColorBar = (COLORREF)lParam;
 	InvalidateRect(hwnd, NULL, TRUE);
 	return 0;
 
     case PBM_SETBKCOLOR:
-        if (wParam) UNKNOWN_PARAM(PBM_SETBKCOLOR, wParam, lParam);
         infoPtr->ColorBk = (COLORREF)lParam;
 	InvalidateRect(hwnd, NULL, TRUE);
 	return 0;
Index: dlls/comctl32/updown.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/updown.c,v
retrieving revision 1.44
diff -u -r1.44 updown.c
--- dlls/comctl32/updown.c	6 Sep 2002 19:41:18 -0000	1.44
+++ dlls/comctl32/updown.c	9 Sep 2002 02:18:22 -0000
@@ -83,10 +83,6 @@
 #define BUDDY_UPDOWN_HWND        "buddyUpDownHWND"
 #define BUDDY_SUPERCLASS_WNDPROC "buddySupperClassWndProc"
 
-#define UNKNOWN_PARAM(msg, wParam, lParam) WARN(\
-        "Unknown parameter(s) for message " #msg \
-	"(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
-
 #define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongA (hwnd,0))
 #define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
 
@@ -626,9 +622,10 @@
  * 'pt' is the location of the mouse event in client or
  * windows coordinates.
  */
-static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt)
+static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINTS pts)
 {
     DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
+    POINT pt = { pts.x, pts.y };
     RECT rect;
     int temp, arrow;
 
@@ -802,18 +799,13 @@
 
 	case WM_LBUTTONDOWN:
 	case WM_MOUSEMOVE:
-	    if(UPDOWN_IsEnabled(infoPtr)){
-		POINT pt;
-		pt.x = SLOWORD(lParam);
-		pt.y = SHIWORD(lParam);
-		UPDOWN_HandleMouseEvent (infoPtr, message, pt );
-	    }
+	    if(UPDOWN_IsEnabled(infoPtr))
+		UPDOWN_HandleMouseEvent (infoPtr, message, MAKEPOINTS(lParam));
 	    break;
 
 	case WM_KEYDOWN:
-	    if((dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr)) {
+	    if((dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr))
 		return UPDOWN_KeyPressed(infoPtr, (int)wParam);
-	    }
 	    break;
 
 	case WM_PAINT:
@@ -826,7 +818,6 @@
 	        memcpy((void *)lParam, infoPtr->AccelVect, temp*sizeof(UDACCEL));
 	        return temp;
       	    }
-	    UNKNOWN_PARAM(UDM_GETACCEL, wParam, lParam);
 	    return 0;
 
 	case UDM_SETACCEL:
@@ -843,13 +834,10 @@
     	    return TRUE;
 
 	case UDM_GETBASE:
-	    if (wParam || lParam) UNKNOWN_PARAM(UDM_GETBASE, wParam, lParam);
 	    return infoPtr->Base;
 
 	case UDM_SETBASE:
 	    TRACE("UpDown Ctrl new base(%d), hwnd=%04x\n", wParam, hwnd);
-	    if ( !(wParam==10 || wParam==16) || lParam)
-		UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam);
 	    if (wParam==10 || wParam==16) {
 		temp = infoPtr->Base;
 		infoPtr->Base = wParam;
@@ -858,22 +846,18 @@
 	    break;
 
 	case UDM_GETBUDDY:
-	    if (wParam || lParam) UNKNOWN_PARAM(UDM_GETBUDDY, wParam, lParam);
 	    return (LRESULT)infoPtr->Buddy;
 
 	case UDM_SETBUDDY:
-	    if (lParam) UNKNOWN_PARAM(UDM_SETBUDDY, wParam, lParam);
 	    temp = (int)infoPtr->Buddy;
 	    UPDOWN_SetBuddy (infoPtr, (HWND)wParam);
 	    return temp;
 
 	case UDM_GETPOS:
-	    if (wParam || lParam) UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
 	    temp = UPDOWN_GetBuddyInt (infoPtr);
 	    return MAKELONG(infoPtr->CurVal, temp ? 0 : 1);
 
 	case UDM_SETPOS:
-	    if (wParam || HIWORD(lParam)) UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
 	    temp = SLOWORD(lParam);
 	    TRACE("UpDown Ctrl new value(%d), hwnd=%04x\n", temp, hwnd);
 	    if(!UPDOWN_InBounds(infoPtr, temp)) {
@@ -886,11 +870,9 @@
 	    return wParam;            /* return prev value */
 
 	case UDM_GETRANGE:
-	    if (wParam || lParam) UNKNOWN_PARAM(UDM_GETRANGE, wParam, lParam);
 	    return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal);
 
 	case UDM_SETRANGE:
-	    if (wParam) UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam);
 		                               /* we must have:     */
 	    infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
 	    infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
@@ -928,12 +910,10 @@
 	    return temp;                    /* return prev value */
 
 	case UDM_GETUNICODEFORMAT:
-	    if (wParam || lParam) UNKNOWN_PARAM(UDM_GETUNICODEFORMAT, wParam, lParam);
 	    /* we lie a bit here, we're always using Unicode internally */
 	    return infoPtr->UnicodeFormat;
 
 	case UDM_SETUNICODEFORMAT:
-	    if (lParam) UNKNOWN_PARAM(UDM_SETUNICODEFORMAT, wParam, lParam);
 	    /* do we really need to honour this flag? */
 	    temp = infoPtr->UnicodeFormat;
 	    infoPtr->UnicodeFormat = (BOOL)wParam;



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux