]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/combobox.cpp
Typo fix
[wxWidgets.git] / src / gtk1 / combobox.cpp
index 326381bcb41edc77bce20cb0dac4475a4dc9d572..3cd992283dc03bf70c57b9f640342acd514416e3 100644 (file)
@@ -20,8 +20,7 @@
 
 #include "wx/textctrl.h"    // for wxEVT_COMMAND_TEXT_UPDATED
 
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
+#include "wx/gtk/private.h"
 
 //-----------------------------------------------------------------------------
 // idle system
@@ -492,11 +491,7 @@ void wxComboBox::Copy()
     wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
 
     GtkWidget *entry = GTK_COMBO(m_widget)->entry;
-#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
-    gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
-#else
-    gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
-#endif
+    gtk_editable_copy_clipboard( GTK_EDITABLE(entry) DUMMY_CLIPBOARD_ARG );
 }
 
 void wxComboBox::Cut()
@@ -504,11 +499,7 @@ void wxComboBox::Cut()
     wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
 
     GtkWidget *entry = GTK_COMBO(m_widget)->entry;
-#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
-    gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
-#else
-    gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
-#endif
+    gtk_editable_cut_clipboard( GTK_EDITABLE(entry) DUMMY_CLIPBOARD_ARG );
 }
 
 void wxComboBox::Paste()
@@ -516,11 +507,7 @@ void wxComboBox::Paste()
     wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
 
     GtkWidget *entry = GTK_COMBO(m_widget)->entry;
-#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
-    gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
-#else
-    gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
-#endif
+    gtk_editable_paste_clipboard( GTK_EDITABLE(entry) DUMMY_CLIPBOARD_ARG);
 }
 
 void wxComboBox::SetInsertionPoint( long pos )
@@ -540,8 +527,7 @@ void wxComboBox::SetInsertionPointEnd()
 
 long wxComboBox::GetInsertionPoint() const
 {
-    GtkWidget *entry = GTK_COMBO(m_widget)->entry;
-    return (long) GTK_EDITABLE(entry)->current_pos;
+    return (long) GET_EDITABLE_POS( GTK_COMBO(m_widget)->entry );
 }
 
 long wxComboBox::GetLastPosition() const
@@ -615,7 +601,26 @@ void wxComboBox::OnChar( wxKeyEvent &event )
                 event.SetEventObject( this );
                 GetEventHandler()->ProcessEvent( event );
             }
-            //else: do nothing, this will open the listbox
+            else
+            {
+                // This will invoke the dialog default action, such
+                // as the clicking the default button.
+    
+                wxWindow *top_frame = m_parent;
+                while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
+                top_frame = top_frame->GetParent();
+        
+                if (top_frame && GTK_IS_WINDOW(top_frame->m_widget))
+                {
+                    GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
+
+                    if (window->default_widget)
+                    {
+                        gtk_widget_activate (window->default_widget);
+                        return;
+                    }
+                }
+            }
         }
     }