]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/combobox.cpp
Added support for frames without borders (such as for
[wxWidgets.git] / src / gtk1 / combobox.cpp
index f6a53acda16464c8d9016e3b6ce947e83f12eae5..59f2f9821e63630665c6ac0512a35786b7691e74 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        combobox.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -130,6 +129,12 @@ void wxComboBox::Append( const wxString &item, char *clientData )
         gtk_widget_get_style( m_widget ) ) ); 
   }
   
+  if (m_backgroundColour != wxNullColour)
+  {
+    GtkBin *bin = GTK_BIN( list_item );
+    SetBackgroundColourHelper( bin->child->window );
+  }
+  
   gtk_signal_connect( GTK_OBJECT(list_item), "select", 
     GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
   
@@ -300,19 +305,31 @@ void wxComboBox::SetValue( const wxString& value )
 void wxComboBox::Copy(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
+#if (GTK_MINOR_VERSION == 1)
+  gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
+#else
   gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
+#endif
 }
 
 void wxComboBox::Cut(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
+#if (GTK_MINOR_VERSION == 1)
+  gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
+#else
   gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
+#endif
 }
 
 void wxComboBox::Paste(void)
 {
   GtkWidget *entry = GTK_COMBO(m_widget)->entry;
+#if (GTK_MINOR_VERSION == 1)
+  gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
+#else
   gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
+#endif
 }
 
 void wxComboBox::SetInsertionPoint( long pos )
@@ -414,3 +431,18 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
            (window == GTK_COMBO(m_widget)->button->window ) );
 }
 
+void wxComboBox::SetBackgroundColour( const wxColour &colour )
+{
+  wxWindow::SetBackgroundColour( colour );
+  
+  GtkWidget *list = GTK_COMBO(m_widget)->list;
+  
+  GList *child = GTK_LIST(list)->children;
+  while (child)
+  {
+    GtkBin *bin = (GtkBin*) child->data;
+    SetBackgroundColourHelper( bin->child->window );
+    child = child->next;
+  }
+}
+