Avoid flags that may clash with alignment flags

Don't try to set the string selection if not found


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2006-05-23 20:33:17 +00:00
parent 25e19bdf01
commit 390f811460
2 changed files with 2 additions and 4 deletions

View File

@ -78,9 +78,7 @@ bool wxButton::Create(wxWindow *parent,
label = wxGetStockLabel(id);
long ctrl_style = style & ~wxBU_ALIGN_MASK;
wxASSERT_MSG( (ctrl_style & wxALIGN_MASK) == 0,
_T("Some style conflicts with align flags") );
ctrl_style = ctrl_style & ~wxALIGN_MASK;
if((style & wxBU_RIGHT) == wxBU_RIGHT)
ctrl_style |= wxALIGN_RIGHT;

View File

@ -130,7 +130,7 @@ wxString wxComboListBox::GetStringValue() const
void wxComboListBox::SetStringValue(const wxString& value)
{
if ( !value.empty() )
if ( !value.empty() && (FindString(value) != wxNOT_FOUND) )
wxListBox::SetStringSelection(value);
else
wxListBox::SetSelection(-1);