]> git.saurik.com Git - wxWidgets.git/commitdiff
Ignore non-existant string selection in wxComboBox::SetValue() in read-only mode...
authorRobert Roebling <robert@roebling.de>
Mon, 16 Aug 2010 17:48:28 +0000 (17:48 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 16 Aug 2010 17:48:28 +0000 (17:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/combobox.h
src/gtk/combobox.cpp

index df97c6bfcc09435223ad4866738a6807489a3b6f..fb718013c5f136c1cf5bc4807ef176aba63ad17c 100644 (file)
@@ -101,6 +101,8 @@ public:
 
     void OnChar( wxKeyEvent &event );
 
 
     void OnChar( wxKeyEvent &event );
 
+    virtual void SetValue(const wxString& value);
+
     // Standard event handling
     void OnCut(wxCommandEvent& event);
     void OnCopy(wxCommandEvent& event);
     // Standard event handling
     void OnCut(wxCommandEvent& event);
     void OnCopy(wxCommandEvent& event);
index 69c1373dde8c9ac096f4ba53a93f8184524d8ea3..8ff0dc6b7976a735b44be44e6ff141e0cb67d60e 100644 (file)
@@ -276,6 +276,14 @@ wxComboBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_combo_box_entry_new, true);
 }
 
     return GetDefaultAttributesFromGTKWidget(gtk_combo_box_entry_new, true);
 }
 
+void wxComboBox::SetValue(const wxString& value)
+{
+    if ( HasFlag(wxCB_READONLY) )
+        SetStringSelection(value);
+    else
+        wxTextEntry::SetValue(value);
+}
+
 // ----------------------------------------------------------------------------
 // standard event handling
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // standard event handling
 // ----------------------------------------------------------------------------