- Fix bug in mouse position reading.
- Remove useless code. - Small code cleanups.
This commit is contained in:
parent
d71749798b
commit
856a91b734
|
@ -1923,8 +1923,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
rect.bottom = rect.top + SendMessageW(infoPtr->hwndSelf,
|
rect.bottom = rect.top + SendMessageW(infoPtr->hwndSelf,
|
||||||
CB_GETITEMHEIGHT, -1, 0);
|
CB_GETITEMHEIGHT, -1, 0);
|
||||||
rect.left = rect.right - GetSystemMetrics(SM_CXVSCROLL);
|
rect.left = rect.right - GetSystemMetrics(SM_CXVSCROLL);
|
||||||
pt.x = LOWORD(lParam);
|
POINTSTOPOINT(pt, MAKEPOINTS(lParam));
|
||||||
pt.y = HIWORD(lParam);
|
|
||||||
if (PtInRect(&rect, pt))
|
if (PtInRect(&rect, pt))
|
||||||
return CallWindowProcW (infoPtr->prevComboWndProc,
|
return CallWindowProcW (infoPtr->prevComboWndProc,
|
||||||
hwnd, uMsg, wParam, lParam);
|
hwnd, uMsg, wParam, lParam);
|
||||||
|
|
|
@ -42,10 +42,6 @@ typedef struct
|
||||||
|
|
||||||
#define LED_GAP 2
|
#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
|
* PROGRESS_Invalidate
|
||||||
*
|
*
|
||||||
|
@ -313,7 +309,6 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
||||||
case PBM_DELTAPOS:
|
case PBM_DELTAPOS:
|
||||||
{
|
{
|
||||||
INT oldVal;
|
INT oldVal;
|
||||||
if(lParam) UNKNOWN_PARAM(PBM_DELTAPOS, wParam, lParam);
|
|
||||||
oldVal = infoPtr->CurVal;
|
oldVal = infoPtr->CurVal;
|
||||||
if(wParam != 0) {
|
if(wParam != 0) {
|
||||||
infoPtr->CurVal += (INT)wParam;
|
infoPtr->CurVal += (INT)wParam;
|
||||||
|
@ -327,7 +322,6 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
||||||
case PBM_SETPOS:
|
case PBM_SETPOS:
|
||||||
{
|
{
|
||||||
INT oldVal;
|
INT oldVal;
|
||||||
if (lParam) UNKNOWN_PARAM(PBM_SETPOS, wParam, lParam);
|
|
||||||
oldVal = infoPtr->CurVal;
|
oldVal = infoPtr->CurVal;
|
||||||
if(oldVal != wParam) {
|
if(oldVal != wParam) {
|
||||||
infoPtr->CurVal = (INT)wParam;
|
infoPtr->CurVal = (INT)wParam;
|
||||||
|
@ -339,13 +333,11 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
||||||
}
|
}
|
||||||
|
|
||||||
case PBM_SETRANGE:
|
case PBM_SETRANGE:
|
||||||
if (wParam) UNKNOWN_PARAM(PBM_SETRANGE, wParam, lParam);
|
|
||||||
return PROGRESS_SetRange (infoPtr, (int)LOWORD(lParam), (int)HIWORD(lParam));
|
return PROGRESS_SetRange (infoPtr, (int)LOWORD(lParam), (int)HIWORD(lParam));
|
||||||
|
|
||||||
case PBM_SETSTEP:
|
case PBM_SETSTEP:
|
||||||
{
|
{
|
||||||
INT oldStep;
|
INT oldStep;
|
||||||
if (lParam) UNKNOWN_PARAM(PBM_SETSTEP, wParam, lParam);
|
|
||||||
oldStep = infoPtr->Step;
|
oldStep = infoPtr->Step;
|
||||||
infoPtr->Step = (INT)wParam;
|
infoPtr->Step = (INT)wParam;
|
||||||
return oldStep;
|
return oldStep;
|
||||||
|
@ -354,7 +346,6 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
||||||
case PBM_STEPIT:
|
case PBM_STEPIT:
|
||||||
{
|
{
|
||||||
INT oldVal;
|
INT oldVal;
|
||||||
if (wParam || lParam) UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam);
|
|
||||||
oldVal = infoPtr->CurVal;
|
oldVal = infoPtr->CurVal;
|
||||||
infoPtr->CurVal += infoPtr->Step;
|
infoPtr->CurVal += infoPtr->Step;
|
||||||
if(infoPtr->CurVal > infoPtr->MaxVal)
|
if(infoPtr->CurVal > infoPtr->MaxVal)
|
||||||
|
@ -378,17 +369,14 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
|
||||||
return wParam ? infoPtr->MinVal : infoPtr->MaxVal;
|
return wParam ? infoPtr->MinVal : infoPtr->MaxVal;
|
||||||
|
|
||||||
case PBM_GETPOS:
|
case PBM_GETPOS:
|
||||||
if (wParam || lParam) UNKNOWN_PARAM(PBM_STEPIT, wParam, lParam);
|
|
||||||
return infoPtr->CurVal;
|
return infoPtr->CurVal;
|
||||||
|
|
||||||
case PBM_SETBARCOLOR:
|
case PBM_SETBARCOLOR:
|
||||||
if (wParam) UNKNOWN_PARAM(PBM_SETBARCOLOR, wParam, lParam);
|
|
||||||
infoPtr->ColorBar = (COLORREF)lParam;
|
infoPtr->ColorBar = (COLORREF)lParam;
|
||||||
InvalidateRect(hwnd, NULL, TRUE);
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case PBM_SETBKCOLOR:
|
case PBM_SETBKCOLOR:
|
||||||
if (wParam) UNKNOWN_PARAM(PBM_SETBKCOLOR, wParam, lParam);
|
|
||||||
infoPtr->ColorBk = (COLORREF)lParam;
|
infoPtr->ColorBk = (COLORREF)lParam;
|
||||||
InvalidateRect(hwnd, NULL, TRUE);
|
InvalidateRect(hwnd, NULL, TRUE);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -83,10 +83,6 @@ typedef struct
|
||||||
#define BUDDY_UPDOWN_HWND "buddyUpDownHWND"
|
#define BUDDY_UPDOWN_HWND "buddyUpDownHWND"
|
||||||
#define BUDDY_SUPERCLASS_WNDPROC "buddySupperClassWndProc"
|
#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 UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongA (hwnd,0))
|
||||||
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
|
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
|
||||||
|
|
||||||
|
@ -626,9 +622,10 @@ static BOOL UPDOWN_CancelMode (UPDOWN_INFO *infoPtr)
|
||||||
* 'pt' is the location of the mouse event in client or
|
* 'pt' is the location of the mouse event in client or
|
||||||
* windows coordinates.
|
* 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);
|
DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
|
||||||
|
POINT pt = { pts.x, pts.y };
|
||||||
RECT rect;
|
RECT rect;
|
||||||
int temp, arrow;
|
int temp, arrow;
|
||||||
|
|
||||||
|
@ -802,18 +799,13 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||||
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
if(UPDOWN_IsEnabled(infoPtr)){
|
if(UPDOWN_IsEnabled(infoPtr))
|
||||||
POINT pt;
|
UPDOWN_HandleMouseEvent (infoPtr, message, MAKEPOINTS(lParam));
|
||||||
pt.x = SLOWORD(lParam);
|
|
||||||
pt.y = SHIWORD(lParam);
|
|
||||||
UPDOWN_HandleMouseEvent (infoPtr, message, pt );
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
if((dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr)) {
|
if((dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr))
|
||||||
return UPDOWN_KeyPressed(infoPtr, (int)wParam);
|
return UPDOWN_KeyPressed(infoPtr, (int)wParam);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
|
@ -826,7 +818,6 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||||
memcpy((void *)lParam, infoPtr->AccelVect, temp*sizeof(UDACCEL));
|
memcpy((void *)lParam, infoPtr->AccelVect, temp*sizeof(UDACCEL));
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
UNKNOWN_PARAM(UDM_GETACCEL, wParam, lParam);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case UDM_SETACCEL:
|
case UDM_SETACCEL:
|
||||||
|
@ -843,13 +834,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case UDM_GETBASE:
|
case UDM_GETBASE:
|
||||||
if (wParam || lParam) UNKNOWN_PARAM(UDM_GETBASE, wParam, lParam);
|
|
||||||
return infoPtr->Base;
|
return infoPtr->Base;
|
||||||
|
|
||||||
case UDM_SETBASE:
|
case UDM_SETBASE:
|
||||||
TRACE("UpDown Ctrl new base(%d), hwnd=%04x\n", wParam, hwnd);
|
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) {
|
if (wParam==10 || wParam==16) {
|
||||||
temp = infoPtr->Base;
|
temp = infoPtr->Base;
|
||||||
infoPtr->Base = wParam;
|
infoPtr->Base = wParam;
|
||||||
|
@ -858,22 +846,18 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UDM_GETBUDDY:
|
case UDM_GETBUDDY:
|
||||||
if (wParam || lParam) UNKNOWN_PARAM(UDM_GETBUDDY, wParam, lParam);
|
|
||||||
return (LRESULT)infoPtr->Buddy;
|
return (LRESULT)infoPtr->Buddy;
|
||||||
|
|
||||||
case UDM_SETBUDDY:
|
case UDM_SETBUDDY:
|
||||||
if (lParam) UNKNOWN_PARAM(UDM_SETBUDDY, wParam, lParam);
|
|
||||||
temp = (int)infoPtr->Buddy;
|
temp = (int)infoPtr->Buddy;
|
||||||
UPDOWN_SetBuddy (infoPtr, (HWND)wParam);
|
UPDOWN_SetBuddy (infoPtr, (HWND)wParam);
|
||||||
return temp;
|
return temp;
|
||||||
|
|
||||||
case UDM_GETPOS:
|
case UDM_GETPOS:
|
||||||
if (wParam || lParam) UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
|
|
||||||
temp = UPDOWN_GetBuddyInt (infoPtr);
|
temp = UPDOWN_GetBuddyInt (infoPtr);
|
||||||
return MAKELONG(infoPtr->CurVal, temp ? 0 : 1);
|
return MAKELONG(infoPtr->CurVal, temp ? 0 : 1);
|
||||||
|
|
||||||
case UDM_SETPOS:
|
case UDM_SETPOS:
|
||||||
if (wParam || HIWORD(lParam)) UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
|
|
||||||
temp = SLOWORD(lParam);
|
temp = SLOWORD(lParam);
|
||||||
TRACE("UpDown Ctrl new value(%d), hwnd=%04x\n", temp, hwnd);
|
TRACE("UpDown Ctrl new value(%d), hwnd=%04x\n", temp, hwnd);
|
||||||
if(!UPDOWN_InBounds(infoPtr, temp)) {
|
if(!UPDOWN_InBounds(infoPtr, temp)) {
|
||||||
|
@ -886,11 +870,9 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||||
return wParam; /* return prev value */
|
return wParam; /* return prev value */
|
||||||
|
|
||||||
case UDM_GETRANGE:
|
case UDM_GETRANGE:
|
||||||
if (wParam || lParam) UNKNOWN_PARAM(UDM_GETRANGE, wParam, lParam);
|
|
||||||
return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal);
|
return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal);
|
||||||
|
|
||||||
case UDM_SETRANGE:
|
case UDM_SETRANGE:
|
||||||
if (wParam) UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam);
|
|
||||||
/* we must have: */
|
/* we must have: */
|
||||||
infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
|
infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
|
||||||
infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
|
infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
|
||||||
|
@ -928,12 +910,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||||
return temp; /* return prev value */
|
return temp; /* return prev value */
|
||||||
|
|
||||||
case UDM_GETUNICODEFORMAT:
|
case UDM_GETUNICODEFORMAT:
|
||||||
if (wParam || lParam) UNKNOWN_PARAM(UDM_GETUNICODEFORMAT, wParam, lParam);
|
|
||||||
/* we lie a bit here, we're always using Unicode internally */
|
/* we lie a bit here, we're always using Unicode internally */
|
||||||
return infoPtr->UnicodeFormat;
|
return infoPtr->UnicodeFormat;
|
||||||
|
|
||||||
case UDM_SETUNICODEFORMAT:
|
case UDM_SETUNICODEFORMAT:
|
||||||
if (lParam) UNKNOWN_PARAM(UDM_SETUNICODEFORMAT, wParam, lParam);
|
|
||||||
/* do we really need to honour this flag? */
|
/* do we really need to honour this flag? */
|
||||||
temp = infoPtr->UnicodeFormat;
|
temp = infoPtr->UnicodeFormat;
|
||||||
infoPtr->UnicodeFormat = (BOOL)wParam;
|
infoPtr->UnicodeFormat = (BOOL)wParam;
|
||||||
|
|
Loading…
Reference in New Issue