X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87a1e3085bc19deacd312a1dcf7d4eb89f51d5a3..06298235850b7e576ef77a9a95b521534f18a4d9:/src/generic/panelg.cpp diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp index 52d864fbf5..e2b2c838e7 100644 --- a/src/generic/panelg.cpp +++ b/src/generic/panelg.cpp @@ -29,7 +29,6 @@ #include "wx/generic/panelg.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow) BEGIN_EVENT_TABLE(wxPanel, wxWindow) @@ -39,7 +38,6 @@ BEGIN_EVENT_TABLE(wxPanel, wxWindow) EVT_SIZE(wxPanel::OnSize) END_EVENT_TABLE() -#endif void wxPanel::Init() { @@ -57,10 +55,8 @@ bool wxPanel::Create(wxWindow *parent, wxWindowID id, if ( ret ) { -#ifndef __WXGTK__ SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); -#endif } return ret; @@ -183,14 +179,15 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) void wxPanel::OnSize(wxSizeEvent& WXUNUSED(event)) { #if wxUSE_CONSTRAINTS - if (GetAutoLayout()) Layout(); + if (GetAutoLayout()) + Layout(); #endif } void wxPanel::SetFocus() { // If the panel gets the focus *by way of getting it set directly* - // we move it to the first window that can get it. + // we move the focus to the first window that can get it. wxNode *node = GetChildren().First(); while (node) @@ -213,13 +210,15 @@ void wxPanel::SetFocus() void wxPanel::OnFocus(wxFocusEvent& event) { // If the panel gets the focus *by way of getting clicked on* - // we move it to either the last window that had the focus or - // the first one that can get it. + // we move the focus to either the last window that had the + // focus or the first one that can get it. if (m_winLastFocused) { - // it might happen that the window got reparented... - if ( m_winLastFocused->GetParent() == this ) + // It might happen that the window got reparented or no longer + // accepts the focus. + if ((m_winLastFocused->GetParent() == this) && + (m_winLastFocused->AcceptsFocus())) { m_winLastFocused->SetFocus(); return;