From 41410610eff483d102efacbe41ae20059b06f62b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 10 Jul 2020 00:00:56 +0200 Subject: [PATCH] Don't force wxPU_CONTAINS_CONTROLS on wxPopupTransientWindow Popups not using this style work too now (since the parent commit), so this style should be used only if the popup actually requires focus and not always, unconditionally. Turn on this style explicitly in the sample which shows a popup window with wxTextCtrl inside it (which requires focus to work). --- include/wx/popupwin.h | 7 ------- samples/popup/popup.cpp | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h index ba5a1421d5..c3964098b6 100644 --- a/include/wx/popupwin.h +++ b/include/wx/popupwin.h @@ -133,13 +133,6 @@ public: wxPopupTransientWindow() { } wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE) { Create(parent, style); } - bool Create(wxWindow *parent, int style = wxBORDER_NONE) - { - return wxPopupTransientWindowBase::Create - ( - parent, style | wxPU_CONTAINS_CONTROLS - ); - } // Implement base class pure virtuals. virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE; diff --git a/samples/popup/popup.cpp b/samples/popup/popup.cpp index 1e0cf61912..09a80b9df2 100644 --- a/samples/popup/popup.cpp +++ b/samples/popup/popup.cpp @@ -108,7 +108,9 @@ wxBEGIN_EVENT_TABLE(SimpleTransientPopup,wxPopupTransientWindow) wxEND_EVENT_TABLE() SimpleTransientPopup::SimpleTransientPopup( wxWindow *parent, bool scrolled ) - :wxPopupTransientWindow( parent ) + :wxPopupTransientWindow( parent, + wxBORDER_NONE | + wxPU_CONTAINS_CONTROLS ) { m_panel = new wxScrolledWindow( this, wxID_ANY ); m_panel->SetBackgroundColour( *wxLIGHT_GREY );