git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10341
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void SetLastFocus(wxWindow *win) { m_winLastFocused = win; }
wxWindow *GetLastFocus() const { return m_winLastFocused; }
+ virtual void RemoveChild(wxWindowBase *child);
+
protected:
// common part of all ctors
void Init();
wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") );
- // make sure that there are no dangling pointers left pointing to us
- wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
- if ( panel )
- {
- if ( panel->GetLastFocus() == this )
- {
- panel->SetLastFocus((wxWindow *)NULL);
- }
- }
-
#if wxUSE_CARET
if ( m_caret )
delete m_caret;
event.Skip();
}
+void wxPanel::RemoveChild(wxWindowBase *child)
+{
+ if ( child == m_winLastFocused )
+ m_winLastFocused = NULL;
+ wxWindow::RemoveChild(child);
+}
+
void wxPanel::SetFocus()
{
wxLogTrace(_T("focus"), _T("SetFocus on wxPanel 0x%08x."), GetHandle());