fixed infinite recursion in SetFocus()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -52,8 +52,9 @@ public:
|
|||||||
void HandleOnFocus(wxFocusEvent& event);
|
void HandleOnFocus(wxFocusEvent& event);
|
||||||
void HandleOnWindowDestroy(wxWindowBase *child);
|
void HandleOnWindowDestroy(wxWindowBase *child);
|
||||||
|
|
||||||
// should be called from SetFocus()
|
// should be called from SetFocus(), returns FALSE if we did nothing with
|
||||||
void DoSetFocus();
|
// the focus and the default processing should take place
|
||||||
|
bool DoSetFocus();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// set the focus to the child which had it the last time
|
// set the focus to the child which had it the last time
|
||||||
@@ -119,7 +120,8 @@ void classname::RemoveChild(wxWindowBase *child) \
|
|||||||
\
|
\
|
||||||
void classname::SetFocus() \
|
void classname::SetFocus() \
|
||||||
{ \
|
{ \
|
||||||
container->DoSetFocus(); \
|
if ( !container->DoSetFocus() ) \
|
||||||
|
wxWindow::SetFocus(); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
void classname::OnChildFocus(wxChildFocusEvent& event) \
|
void classname::OnChildFocus(wxChildFocusEvent& event) \
|
||||||
|
@@ -241,7 +241,7 @@ void wxControlContainer::HandleOnWindowDestroy(wxWindowBase *child)
|
|||||||
// focus handling
|
// focus handling
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxControlContainer::DoSetFocus()
|
bool wxControlContainer::DoSetFocus()
|
||||||
{
|
{
|
||||||
wxLogTrace(_T("focus"), _T("SetFocus on wxPanel 0x%08x."),
|
wxLogTrace(_T("focus"), _T("SetFocus on wxPanel 0x%08x."),
|
||||||
m_winParent->GetHandle());
|
m_winParent->GetHandle());
|
||||||
@@ -273,10 +273,7 @@ void wxControlContainer::DoSetFocus()
|
|||||||
//
|
//
|
||||||
// RR: Removed for now. Let's see what happens..
|
// RR: Removed for now. Let's see what happens..
|
||||||
|
|
||||||
if ( !SetFocusToChild() )
|
return SetFocusToChild();
|
||||||
{
|
|
||||||
m_winParent->SetFocus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxControlContainer::HandleOnFocus(wxFocusEvent& event)
|
void wxControlContainer::HandleOnFocus(wxFocusEvent& event)
|
||||||
|
Reference in New Issue
Block a user