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.
This commit is contained in:
@@ -300,19 +300,6 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
const wxValidator& validator,
|
const wxValidator& validator,
|
||||||
const wxString& name)
|
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,
|
if ( !wxSearchCtrlBaseBaseClass::Create(parent, id, pos, size,
|
||||||
style, validator, name) )
|
style, validator, name) )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user