Fix client coordinates mapping for wxSpinCtrl in wxMSW
Add MSWDoClientToScreen() and MSWDoScreenToClient() helpers and use them with the correct HWND in DoClientToScreen() and DoScreenToClient() overridden in wxSpinCtrl, i.e. the HWND of the "buddy" text control and not the spin button, which is the main HWND of this control. This notably fixes wxSpinCtrl::GetScreenPosition() which returned the position of the spin button. Closes https://github.com/wxWidgets/wxWidgets/pull/1454 Closes #18455.
This commit is contained in:
@@ -846,4 +846,14 @@ void wxSpinCtrl::DoGetPosition(int *x, int *y) const
|
||||
*x = wxMin(xBuddy, xText);
|
||||
}
|
||||
|
||||
void wxSpinCtrl::DoScreenToClient(int *x, int *y) const
|
||||
{
|
||||
wxWindow::MSWDoScreenToClient(GetBuddyHwnd(), x, y);
|
||||
}
|
||||
|
||||
void wxSpinCtrl::DoClientToScreen(int *x, int *y) const
|
||||
{
|
||||
wxWindow::MSWDoClientToScreen(GetBuddyHwnd(), x, y);
|
||||
}
|
||||
|
||||
#endif // wxUSE_SPINCTRL
|
||||
|
Reference in New Issue
Block a user