FindFocus() and wxSpinCtrl fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -379,7 +379,7 @@ wxWindow *wxWindowBase::FindFocus()
|
|||||||
HWND hWnd = ::GetFocus();
|
HWND hWnd = ::GetFocus();
|
||||||
if ( hWnd )
|
if ( hWnd )
|
||||||
{
|
{
|
||||||
return wxFindWinFromHandle((WXHWND) hWnd);
|
return wxGetWindowFromHWND((WXHWND)hWnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -396,7 +396,7 @@ bool wxWindow::Enable(bool enable)
|
|||||||
|
|
||||||
// VZ: no, this is a bad idea: imagine that you have a dialog with some
|
// VZ: no, this is a bad idea: imagine that you have a dialog with some
|
||||||
// disabled controls and disable it - you really wouldn't like the
|
// disabled controls and disable it - you really wouldn't like the
|
||||||
// disabled controls eb reenabled too when you reenable the dialog!
|
// disabled controls be reenabled too when you reenable the dialog!
|
||||||
#if 0
|
#if 0
|
||||||
wxWindowList::Node *node = GetChildren().GetFirst();
|
wxWindowList::Node *node = GetChildren().GetFirst();
|
||||||
while ( node )
|
while ( node )
|
||||||
@@ -3939,24 +3939,37 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
|
|||||||
win = wxFindWinFromHandle((WXHWND)hwnd);
|
win = wxFindWinFromHandle((WXHWND)hwnd);
|
||||||
if ( !win )
|
if ( !win )
|
||||||
{
|
{
|
||||||
// the radiobox pointer is stored in GWL_USERDATA only under Win32
|
// all these hacks only work under Win32 anyhow
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
|
|
||||||
|
#if wxUSE_RADIOBOX
|
||||||
// native radiobuttons return DLGC_RADIOBUTTON here and for any
|
// native radiobuttons return DLGC_RADIOBUTTON here and for any
|
||||||
// wxWindow class which overrides WM_GETDLGCODE processing to
|
// wxWindow class which overrides WM_GETDLGCODE processing to
|
||||||
// do it as well, win would be already non NULL
|
// do it as well, win would be already non NULL
|
||||||
if ( ::SendMessage((HWND)hwnd, WM_GETDLGCODE,
|
if ( ::SendMessage(hwnd, WM_GETDLGCODE, 0, 0) & DLGC_RADIOBUTTON )
|
||||||
0, 0) & DLGC_RADIOBUTTON )
|
|
||||||
{
|
{
|
||||||
win = (wxWindow *)::GetWindowLong(hwnd, GWL_USERDATA);
|
win = (wxWindow *)::GetWindowLong(hwnd, GWL_USERDATA);
|
||||||
}
|
}
|
||||||
else
|
//else: it's a wxRadioButton, not a radiobutton from wxRadioBox
|
||||||
|
#endif // wxUSE_RADIOBOX
|
||||||
|
|
||||||
|
// spin control text buddy window should be mapped to spin ctrl
|
||||||
|
// itself so try it too
|
||||||
|
#if wxUSE_SPINCTRL
|
||||||
|
if ( !win )
|
||||||
|
{
|
||||||
|
win = wxSpinCtrl::GetSpinForTextCtrl((WXHWND)hwnd);
|
||||||
|
}
|
||||||
|
#endif // wxUSE_SPINCTRL
|
||||||
|
|
||||||
#endif // Win32
|
#endif // Win32
|
||||||
|
|
||||||
|
if ( !win )
|
||||||
{
|
{
|
||||||
// hwnd is not a wxWindow, try its parent next below
|
// hwnd is not a wxWindow, try its parent next below
|
||||||
hwnd = ::GetParent(hwnd);
|
hwnd = ::GetParent(hwnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else: it's a wxRadioButton, not a radiobutton from wxRadioBox
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while ( hwnd && !win )
|
while ( hwnd && !win )
|
||||||
|
Reference in New Issue
Block a user