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:
@@ -78,9 +78,7 @@ bool wxButton::Create(wxWindow *parent,
|
|||||||
label = wxGetStockLabel(id);
|
label = wxGetStockLabel(id);
|
||||||
|
|
||||||
long ctrl_style = style & ~wxBU_ALIGN_MASK;
|
long ctrl_style = style & ~wxBU_ALIGN_MASK;
|
||||||
|
ctrl_style = ctrl_style & ~wxALIGN_MASK;
|
||||||
wxASSERT_MSG( (ctrl_style & wxALIGN_MASK) == 0,
|
|
||||||
_T("Some style conflicts with align flags") );
|
|
||||||
|
|
||||||
if((style & wxBU_RIGHT) == wxBU_RIGHT)
|
if((style & wxBU_RIGHT) == wxBU_RIGHT)
|
||||||
ctrl_style |= wxALIGN_RIGHT;
|
ctrl_style |= wxALIGN_RIGHT;
|
||||||
|
@@ -130,7 +130,7 @@ wxString wxComboListBox::GetStringValue() const
|
|||||||
|
|
||||||
void wxComboListBox::SetStringValue(const wxString& value)
|
void wxComboListBox::SetStringValue(const wxString& value)
|
||||||
{
|
{
|
||||||
if ( !value.empty() )
|
if ( !value.empty() && (FindString(value) != wxNOT_FOUND) )
|
||||||
wxListBox::SetStringSelection(value);
|
wxListBox::SetStringSelection(value);
|
||||||
else
|
else
|
||||||
wxListBox::SetSelection(-1);
|
wxListBox::SetSelection(-1);
|
||||||
|
Reference in New Issue
Block a user