fix typo, and fix screen<->client
svn: r3739
This commit is contained in:
parent
efc4ea0c7f
commit
2f6e4e1996
|
@ -273,9 +273,11 @@ void wxFrame::GetPosition(int *x, int *y)
|
|||
RECT rect;
|
||||
wxWindow *parent;
|
||||
POINT point;
|
||||
HWND hwnd;
|
||||
|
||||
parent = GetParent();
|
||||
|
||||
hwnd = GetHWND();
|
||||
if (::IsIconic(hwnd)) {
|
||||
WINDOWPLACEMENT wp;
|
||||
wp.length = sizeof(wp);
|
||||
|
@ -283,7 +285,7 @@ void wxFrame::GetPosition(int *x, int *y)
|
|||
point.x = wp.rcNormalPosition.left;
|
||||
point.y = wp.rcNormalPosition.top;
|
||||
} else {
|
||||
GetWindowRect(GetHWND(), &rect);
|
||||
GetWindowRect(hwnd, &rect);
|
||||
point.x = rect.left;
|
||||
point.y = rect.top;
|
||||
}
|
||||
|
|
|
@ -464,6 +464,15 @@ void wxWindow::ScreenToClient(int *x, int *y)
|
|||
pt.y = *y;
|
||||
::ScreenToClient(hWnd, &pt);
|
||||
|
||||
if (pt.x < -10000)
|
||||
pt.x = 10000;
|
||||
if (pt.x > 10000)
|
||||
pt.x = 10000;
|
||||
if (pt.y < -10000)
|
||||
pt.y = 10000;
|
||||
if (pt.y > 10000)
|
||||
pt.y = 10000;
|
||||
|
||||
*x = pt.x;
|
||||
*y = pt.y;
|
||||
}
|
||||
|
@ -478,6 +487,15 @@ void wxWindow::ClientToScreen(int *x, int *y)
|
|||
pt.y = *y;
|
||||
::ClientToScreen(hWnd, &pt);
|
||||
|
||||
if (pt.x < -10000)
|
||||
pt.x = 10000;
|
||||
if (pt.x > 10000)
|
||||
pt.x = 10000;
|
||||
if (pt.y < -10000)
|
||||
pt.y = 10000;
|
||||
if (pt.y > 10000)
|
||||
pt.y = 10000;
|
||||
|
||||
*x = pt.x;
|
||||
*y = pt.y;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user