fix assert because of passing more than one border bit in style to the base class Create()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-18 23:07:58 +00:00
parent 02c7347b7f
commit 88c23b64c7

View File

@@ -315,11 +315,14 @@ 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__ #ifdef __WXGTK__
if ( !wxTextCtrlBase::Create(parent, id, pos, size, wxSUNKEN_BORDER | style, validator, name) ) style |= wxBORDER_SUNKEN;
#else #else
if ( !wxTextCtrlBase::Create(parent, id, pos, size, wxSIMPLE_BORDER | style, validator, name) ) style |= wxBORDER_SIMPLE;
#endif #endif
if ( !wxTextCtrlBase::Create(parent, id, pos, size, style, validator, name) )
{ {
return false; return false;
} }
@@ -329,8 +332,12 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
wxSize sizeText = m_text->GetBestSize(); wxSize sizeText = m_text->GetBestSize();
m_searchButton = new wxSearchButton(this,wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN,m_searchBitmap); m_searchButton = new wxSearchButton(this,
m_cancelButton = new wxSearchButton(this,wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN,m_cancelBitmap); wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN,
m_searchBitmap);
m_cancelButton = new wxSearchButton(this,
wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN,
m_cancelBitmap);
SetForegroundColour( m_text->GetForegroundColour() ); SetForegroundColour( m_text->GetForegroundColour() );
m_searchButton->SetForegroundColour( m_text->GetForegroundColour() ); m_searchButton->SetForegroundColour( m_text->GetForegroundColour() );