X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9456d8d5b35a80f28b8bb4cce9a6b8a53ca770d..8f0db49cd26130a7bc49816853ce832324ee85da:/src/generic/panelg.cpp diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp index 3cab12dccb..73a7a04cf3 100644 --- a/src/generic/panelg.cpp +++ b/src/generic/panelg.cpp @@ -36,9 +36,6 @@ #include "wx/log.h" #endif -#include "wx/toolbar.h" -#include "wx/statusbr.h" - #include "wx/generic/panelg.h" // ---------------------------------------------------------------------------- @@ -65,7 +62,9 @@ END_EVENT_TABLE() void wxPanel::Init() { m_winLastFocused = (wxWindow *)NULL; +#if wxUSE_BUTTON m_btnDefault = (wxButton *)NULL; +#endif // wxUSE_BUTTON } bool wxPanel::Create(wxWindow *parent, wxWindowID id, @@ -74,15 +73,7 @@ bool wxPanel::Create(wxWindow *parent, wxWindowID id, long style, const wxString& name) { - bool ret = wxWindow::Create(parent, id, pos, size, style, name); - - if ( ret ) - { - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); - SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); - } - - return ret; + return wxWindow::Create(parent, id, pos, size, style, name); } // ---------------------------------------------------------------------------- @@ -251,7 +242,7 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) wxWindow *child = node->GetData(); - if ( child->AcceptsFocus() ) + if ( child->AcceptsFocusFromKeyboard() ) { m_winLastFocused = child; // should be redundant, but it is not @@ -292,6 +283,13 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) 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()); @@ -360,7 +358,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) // It might happen that the window got reparented or no longer accepts // the focus. if ( (*childLastFocused)->GetParent() == win && - (*childLastFocused)->AcceptsFocus() ) + (*childLastFocused)->AcceptsFocusFromKeyboard() ) { wxLogTrace(_T("focus"), _T("SetFocusToChild() => last child (0x%08x)."), @@ -382,15 +380,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) { wxWindow *child = node->GetData(); - if ( child->AcceptsFocus() - && !child->IsTopLevel() -#if wxUSE_TOOLBAR - && !wxDynamicCast(child, wxToolBar) -#endif // wxUSE_TOOLBAR -#if wxUSE_STATUSBAR - && !wxDynamicCast(child, wxStatusBar) -#endif // wxUSE_STATUSBAR - ) + if ( child->AcceptsFocusFromKeyboard() && !child->IsTopLevel() ) { wxLogTrace(_T("focus"), _T("SetFocusToChild() => first child (0x%08x)."),