From 95561ddfc3c0c84c71316d40cb539135fa68b440 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 27 Apr 2004 19:59:35 +0000 Subject: [PATCH] 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 --- include/wx/gtk/combobox.h | 2 +- include/wx/gtk1/combobox.h | 2 +- src/gtk/combobox.cpp | 7 ++++--- src/gtk1/combobox.cpp | 7 ++++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index 6cd8dafe5b..b3756066cc 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -96,7 +96,7 @@ public: int Number() const { return GetCount(); } void SetSelection( int 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); wxString GetValue() const; diff --git a/include/wx/gtk1/combobox.h b/include/wx/gtk1/combobox.h index 6cd8dafe5b..b3756066cc 100644 --- a/include/wx/gtk1/combobox.h +++ b/include/wx/gtk1/combobox.h @@ -96,7 +96,7 @@ public: int Number() const { return GetCount(); } void SetSelection( int 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); wxString GetValue() const; diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 43ed08ba4a..7660f4a9fa 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -557,13 +557,14 @@ void wxComboBox::SetSelection( int n ) 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 ); - if (res == -1) return; + if (res == -1) return false; SetSelection( res ); + return true; } wxString wxComboBox::GetValue() const diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index 43ed08ba4a..7660f4a9fa 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -557,13 +557,14 @@ void wxComboBox::SetSelection( int n ) 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 ); - if (res == -1) return; + if (res == -1) return false; SetSelection( res ); + return true; } wxString wxComboBox::GetValue() const -- 2.47.2