]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/radiobox.cpp
added functions for setting the columns order in wxListCtrl (modified patch 1828074)
[wxWidgets.git] / src / gtk / radiobox.cpp
index 2665e621a0e2f7cad3c4ceb06ea81d09ba1da98a..418c82be3efe8c83fcbe857074de8a21a79310eb 100644 (file)
@@ -27,8 +27,6 @@
 #include "wx/gtk/private.h"
 #include <gdk/gdkkeysyms.h>
 
-#include "wx/gtk/win_gtk.h"
-
 //-----------------------------------------------------------------------------
 // wxGTKRadioButtonInfo
 //-----------------------------------------------------------------------------
@@ -60,8 +58,6 @@ extern bool          g_blockEventsOnDrag;
 extern "C" {
 static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBox *rb )
 {
-    if (g_isIdle) wxapp_install_idle_handler();
-
     if (!rb->m_hasVMT) return;
     if (g_blockEventsOnDrag) return;
 
@@ -82,8 +78,6 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo
 extern "C" {
 static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb )
 {
-    // don't need to install idle handler, its done from "event" signal
-
     if (!rb->m_hasVMT) return FALSE;
     if (g_blockEventsOnDrag) return FALSE;
 
@@ -144,7 +138,7 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
 }
 
 extern "C" {
-static gint gtk_radiobutton_focus_in( GtkWidget *widget,
+static gint gtk_radiobutton_focus_in( GtkWidget * WXUNUSED(widget),
                                       GdkEvent *WXUNUSED(event),
                                       wxRadioBox *win )
 {
@@ -170,7 +164,7 @@ static gint gtk_radiobutton_focus_in( GtkWidget *widget,
 }
 
 extern "C" {
-static gint gtk_radiobutton_focus_out( GtkWidget *widget,
+static gint gtk_radiobutton_focus_out( GtkWidget * WXUNUSED(widget),
                                        GdkEvent *WXUNUSED(event),
                                        wxRadioBox *win )
 {
@@ -218,8 +212,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
 
 void wxRadioBox::Init()
 {
-    m_needParent = true;
-
     m_hasFocus =
     m_lostFocus = false;
 }
@@ -283,7 +275,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
             radio_button_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON(rbtn) );
 
         label.Empty();
-        for ( const wxChar *pc = choices[i]; *pc; pc++ )
+        for ( wxString::const_iterator pc = choices[i].begin();
+              pc != choices[i].end(); ++pc )
         {
             if ( *pc != wxT('&') )
                 label += *pc;
@@ -562,9 +555,8 @@ void wxRadioBox::GtkDisableEvents()
     wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
     while (node)
     {
-        g_signal_handlers_disconnect_by_func (node->GetData()->button,
-                                              (gpointer) gtk_radiobutton_clicked_callback,
-                                              this);
+        g_signal_handlers_block_by_func(node->GetData()->button,
+            (gpointer)gtk_radiobutton_clicked_callback, this);
 
         node = node->GetNext();
     }
@@ -575,8 +567,8 @@ void wxRadioBox::GtkEnableEvents()
     wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
     while (node)
     {
-        g_signal_connect (node->GetData()->button, "clicked",
-                          G_CALLBACK (gtk_radiobutton_clicked_callback), this);
+        g_signal_handlers_unblock_by_func(node->GetData()->button,
+            (gpointer)gtk_radiobutton_clicked_callback, this);
 
         node = node->GetNext();
     }
@@ -609,7 +601,7 @@ void wxRadioBox::GTKWidgetDoSetMnemonic(GtkWidget* w)
 }
 
 #if wxUSE_TOOLTIPS
-void wxRadioBox::ApplyToolTip(GtkTooltips * WXUNUSED(tips), const wxChar *tip)
+void wxRadioBox::ApplyToolTip(GtkTooltips * WXUNUSED(tips), const gchar *tip)
 {
     // set this tooltip for all radiobuttons which don't have their own tips
     unsigned n = 0;
@@ -619,8 +611,7 @@ void wxRadioBox::ApplyToolTip(GtkTooltips * WXUNUSED(tips), const wxChar *tip)
     {
         if ( !GetItemToolTip(n) )
         {
-            wxToolTip::Apply(GTK_WIDGET(node->GetData()->button),
-                             wxConvCurrent->cWX2MB(tip));
+            wxToolTip::Apply(GTK_WIDGET(node->GetData()->button), tip);
         }
     }
 }