Change SetStringSelection to return bool like in other classes and ports
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -96,7 +96,7 @@ public:
|
|||||||
int Number() const { return GetCount(); }
|
int Number() const { return GetCount(); }
|
||||||
void SetSelection( int n );
|
void SetSelection( int n );
|
||||||
void Select( int n ) { return SetSelection( n ); }
|
void Select( int n ) { return SetSelection( n ); }
|
||||||
void SetStringSelection( const wxString &string );
|
bool SetStringSelection( const wxString &string );
|
||||||
void SetString(int n, const wxString &text);
|
void SetString(int n, const wxString &text);
|
||||||
|
|
||||||
wxString GetValue() const;
|
wxString GetValue() const;
|
||||||
|
@@ -96,7 +96,7 @@ public:
|
|||||||
int Number() const { return GetCount(); }
|
int Number() const { return GetCount(); }
|
||||||
void SetSelection( int n );
|
void SetSelection( int n );
|
||||||
void Select( int n ) { return SetSelection( n ); }
|
void Select( int n ) { return SetSelection( n ); }
|
||||||
void SetStringSelection( const wxString &string );
|
bool SetStringSelection( const wxString &string );
|
||||||
void SetString(int n, const wxString &text);
|
void SetString(int n, const wxString &text);
|
||||||
|
|
||||||
wxString GetValue() const;
|
wxString GetValue() const;
|
||||||
|
@@ -557,13 +557,14 @@ void wxComboBox::SetSelection( int n )
|
|||||||
EnableEvents();
|
EnableEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboBox::SetStringSelection( const wxString &string )
|
bool wxComboBox::SetStringSelection( const wxString &string )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid combobox") );
|
||||||
|
|
||||||
int res = FindString( string );
|
int res = FindString( string );
|
||||||
if (res == -1) return;
|
if (res == -1) return false;
|
||||||
SetSelection( res );
|
SetSelection( res );
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxComboBox::GetValue() const
|
wxString wxComboBox::GetValue() const
|
||||||
|
@@ -557,13 +557,14 @@ void wxComboBox::SetSelection( int n )
|
|||||||
EnableEvents();
|
EnableEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboBox::SetStringSelection( const wxString &string )
|
bool wxComboBox::SetStringSelection( const wxString &string )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid combobox") );
|
||||||
|
|
||||||
int res = FindString( string );
|
int res = FindString( string );
|
||||||
if (res == -1) return;
|
if (res == -1) return false;
|
||||||
SetSelection( res );
|
SetSelection( res );
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxComboBox::GetValue() const
|
wxString wxComboBox::GetValue() const
|
||||||
|
Reference in New Issue
Block a user