]> git.saurik.com Git - wxWidgets.git/commitdiff
Combobox corrections
authorJulian Smart <julian@anthemion.co.uk>
Thu, 9 Dec 2004 15:27:54 +0000 (15:27 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 9 Dec 2004 15:27:54 +0000 (15:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index c27d532b472960d6aa9467e1cd02275c817a12c8..7265f891e5e5769307a29a220f6e8523f919872b 100644 (file)
@@ -122,7 +122,7 @@ public:
     bool CanUndo() const;
     bool CanRedo() const;
     void SelectAll();
-    bool IsEditable() const { return !HasFlag(wxCB_READONLY); }
+    bool IsEditable() const ;
     bool HasSelection() const ;
 
     // implementation
index c27d532b472960d6aa9467e1cd02275c817a12c8..7265f891e5e5769307a29a220f6e8523f919872b 100644 (file)
@@ -122,7 +122,7 @@ public:
     bool CanUndo() const;
     bool CanRedo() const;
     void SelectAll();
-    bool IsEditable() const { return !HasFlag(wxCB_READONLY); }
+    bool IsEditable() const ;
     bool HasSelection() const ;
 
     // implementation
index 99e75910c29905834f95edd67f7051250dcd4d0c..9a1c2100bbc354794e9263936bc3d4800626947b 100644 (file)
@@ -674,7 +674,7 @@ void wxComboBox::Redo()
 
 void wxComboBox::SelectAll()
 {
-    Select(0, GetLastPosition());
+    SetSelection(0, GetLastPosition());
 }
 
 bool wxComboBox::CanUndo() const
@@ -769,9 +769,16 @@ void wxComboBox::GetSelection( long* from, long* to ) const
 {
     if (IsEditable())
     {
+#ifdef __WXGTK20__
         GtkEditable *editable = GTK_EDITABLE(GTK_COMBO(m_widget)->entry);
+        gint start, end;
+        gtk_editable_get_selection_bounds(editable, & start, & end);
+        *from = start;
+        *to = end;
+#else
         *from = (long) editable->selection_start_pos;
         *to = (long) editable->selection_end_pos;
+#endif
     }
 }
 
index 99e75910c29905834f95edd67f7051250dcd4d0c..9a1c2100bbc354794e9263936bc3d4800626947b 100644 (file)
@@ -674,7 +674,7 @@ void wxComboBox::Redo()
 
 void wxComboBox::SelectAll()
 {
-    Select(0, GetLastPosition());
+    SetSelection(0, GetLastPosition());
 }
 
 bool wxComboBox::CanUndo() const
@@ -769,9 +769,16 @@ void wxComboBox::GetSelection( long* from, long* to ) const
 {
     if (IsEditable())
     {
+#ifdef __WXGTK20__
         GtkEditable *editable = GTK_EDITABLE(GTK_COMBO(m_widget)->entry);
+        gint start, end;
+        gtk_editable_get_selection_bounds(editable, & start, & end);
+        *from = start;
+        *to = end;
+#else
         *from = (long) editable->selection_start_pos;
         *to = (long) editable->selection_end_pos;
+#endif
     }
 }