]> git.saurik.com Git - wxWidgets.git/commitdiff
Ticket #9592: gtk-choice-setcolumns.2.diff
authorRobert Roebling <robert@roebling.de>
Mon, 16 Jun 2008 13:32:43 +0000 (13:32 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 16 Jun 2008 13:32:43 +0000 (13:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/choice.h
interface/choice.h
src/gtk/choice.cpp

index 00d21b17189fb4a5507d7104d7015f49044c8bb4..a0750e61b755cf9cad248c7d1863bfe9b42e0fc8 100644 (file)
@@ -72,6 +72,9 @@ public:
     virtual wxString GetString(unsigned int n) const;
     virtual void SetString(unsigned int n, const wxString& string);
 
+    virtual void SetColumns(int n=1);
+    virtual int GetColumns() const;
+
     virtual void DisableEvents();
     virtual void EnableEvents();
 
index db7d1c10bf7c582bab35790b9108b9e703455f80..acb6033101fc0f921565607b33d2754f0a0ed5c6 100644 (file)
@@ -117,8 +117,8 @@ public:
     /**
         Gets the number of columns in this choice item.
 
-        @remarks This is implemented for Motif only and always returns 1 for
-                 the other platforms.
+        @remarks This is implemented for GTK and Motif only and always 
+                 returns 1 for the other platforms.
     */
     int GetColumns() const;
 
@@ -142,8 +142,8 @@ public:
         @param n
             Number of columns.
 
-        @remarks This is implemented for Motif only and doesn’t do anything
-                 under other platforms.
+        @remarks This is implemented for GTK and Motif only and doesn’t do 
+                 anything under other platforms.
     */
     void SetColumns(int n = 1);
 };
index 5028a57cf04a26ac4606f302cd1549ddda7a29db..2427fdc73f11109706218ead2515511fdea39aae 100644 (file)
@@ -306,6 +306,20 @@ void wxChoice::SetSelection( int n )
     EnableEvents();
 }
 
+void wxChoice::SetColumns(int n)
+{
+    gtk_combo_box_set_wrap_width(GTK_COMBO_BOX(m_widget), n);
+}
+
+int wxChoice::GetColumns() const
+{
+    // gtk_combo_box_get_wrap_width() was added in gtk 2.6
+    gint intval;
+    g_object_get(G_OBJECT(m_widget), "wrap-width", &intval, NULL);
+    return intval;
+}
+
+
 void wxChoice::DisableEvents()
 {
     g_signal_handlers_block_by_func(m_widget,