From d3b722944bcdcbce9f16eafb646790a51e5d44e9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Mar 2018 18:10:08 +0100 Subject: [PATCH] Allow creating generic wxSearchCtrl without border Just remove the code manipulating the style from wxSearchCtrl::Create(), there doesn't seem to be any need to force anything for "more native appearance" as the control appears just fine by default under both wxMSW and wxGTK without doing anything here (and is not used under macOS). As a (desired) side effect, specifying wxBORDER_NONE now works as it's not overridden by the control itself any more. Closes #18105. --- src/generic/srchctlg.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 074bee8722..0bc04c38e0 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -300,19 +300,6 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - // force border style for more native appearance - style &= ~wxBORDER_MASK; -#ifdef __WXGTK__ - style |= wxBORDER_SUNKEN; -#elif defined(__WXMSW__) - // Don't set the style explicitly, let GetDefaultBorder() work it out, unless - // we will get a sunken border (e.g. on Windows 200) in which case we must - // override with a simple border. - if (GetDefaultBorder() == wxBORDER_SUNKEN) - style |= wxBORDER_SIMPLE; -#else - style |= wxBORDER_SIMPLE; -#endif if ( !wxSearchCtrlBaseBaseClass::Create(parent, id, pos, size, style, validator, name) ) {