]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/combobox.cpp
Changed the focus-window event handling back
[wxWidgets.git] / src / gtk1 / combobox.cpp
index 5ab1cd7b75e30c432b5323ea3ffb802a5d9b13f0..98b3ba7b826e13921455ae5c9d733c47566ccae6 100644 (file)
@@ -11,7 +11,6 @@
 #pragma implementation "combobox.h"
 #endif
 
-
 #include "wx/combobox.h"
 
 #include <wx/intl.h>
@@ -48,11 +47,9 @@ gtk_combo_clicked_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
 
     wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, combo->GetId() );
     event.SetInt( combo->GetSelection() );
-    event.SetString( copystring(combo->GetStringSelection()) );
+    event.SetString( combo->GetStringSelection() );
     event.SetEventObject( combo );
     combo->GetEventHandler()->ProcessEvent( event );
-
-    delete [] event.GetString();
 }
 
 //-----------------------------------------------------------------------------
@@ -63,11 +60,9 @@ static void
 gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
 {
     wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
-    event.SetString( copystring(combo->GetValue()) );
+    event.SetString( combo->GetValue() );
     event.SetEventObject( combo );
     combo->GetEventHandler()->ProcessEvent( event );
-
-    delete [] event.GetString();
 }
 
 //-----------------------------------------------------------------------------
@@ -439,7 +434,7 @@ void wxComboBox::Copy()
     wxCHECK_RET( m_widget != NULL, "invalid combobox" );
 
     GtkWidget *entry = GTK_COMBO(m_widget)->entry;
-#if (GTK_MINOR_VERSION == 1)
+#if (GTK_MINOR_VERSION > 0)
     gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
 #else
     gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
@@ -451,7 +446,7 @@ void wxComboBox::Cut()
     wxCHECK_RET( m_widget != NULL, "invalid combobox" );
 
     GtkWidget *entry = GTK_COMBO(m_widget)->entry;
-#if (GTK_MINOR_VERSION == 1)
+#if (GTK_MINOR_VERSION > 0)
     gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
 #else
     gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
@@ -463,7 +458,7 @@ void wxComboBox::Paste()
     wxCHECK_RET( m_widget != NULL, "invalid combobox" );
 
     GtkWidget *entry = GTK_COMBO(m_widget)->entry;
-#if (GTK_MINOR_VERSION == 1)
+#if (GTK_MINOR_VERSION > 0)
     gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
 #else
     gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
@@ -542,7 +537,7 @@ void wxComboBox::OnChar( wxKeyEvent &event )
             // all!
             wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, GetId() );
             event.SetInt( 0 );
-            event.SetString( (char *)value.c_str() );
+            event.SetString( value );
             event.SetEventObject( this );
             GetEventHandler()->ProcessEvent( event );
         }
@@ -556,7 +551,7 @@ void wxComboBox::OnChar( wxKeyEvent &event )
                 // and generate the selected event for it
                 wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, GetId() );
                 event.SetInt( Number() - 1 );
-                event.SetString( (char *)value.c_str() );
+                event.SetString( value );
                 event.SetEventObject( this );
                 GetEventHandler()->ProcessEvent( event );
             }