]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/radiobox.cpp
Fix for problem when Realize is re-called on a vertical toolbar, it
[wxWidgets.git] / src / gtk / radiobox.cpp
index 7af0bde3dd342e39f495fef2c3a1f42573b1f2eb..938fe515ca061bb7452faca17e9d88b033585244 100644 (file)
@@ -52,7 +52,6 @@ public:
 WX_DEFINE_LIST( wxRadioBoxButtonsInfoList );
 
 extern bool          g_blockEventsOnDrag;
-extern wxWindowGTK  *g_delayedFocus;
 
 //-----------------------------------------------------------------------------
 // "clicked"
@@ -83,8 +82,7 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo
 extern "C" {
 static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb )
 {
-    if (g_isIdle)
-        wxapp_install_idle_handler();
+    // don't need to install idle handler, its done from "event" signal
 
     if (!rb->m_hasVMT) return FALSE;
     if (g_blockEventsOnDrag) return FALSE;
@@ -121,8 +119,6 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_
         return FALSE;
     }
 
-    g_signal_stop_emission_by_name (widget, "key_press_event");
-
     if ((gdk_event->keyval == GDK_Up) ||
         (gdk_event->keyval == GDK_Left))
     {
@@ -197,12 +193,11 @@ static void gtk_radiobutton_size_allocate( GtkWidget *widget,
                                            GtkAllocation * alloc,
                                            wxRadioBox *win )
 {
-    unsigned int n = 0;
     for ( wxRadioBoxButtonsInfoList::compatibility_iterator node = win->m_buttonsInfo.GetFirst();
           node;
-          node = node->GetNext(), n++ )
+          node = node->GetNext())
     {
-        if( widget == GTK_WIDGET(node->GetData()->button) )
+        if (widget == GTK_WIDGET(node->GetData()->button))
         {
             const wxPoint origin = win->GetPosition();
             wxRect rect = wxRect( alloc->x - origin.x, alloc->y - origin.y,
@@ -638,30 +633,27 @@ void wxRadioBox::DoSetItemToolTip(unsigned int n, wxToolTip *tooltip)
 
 #endif // wxUSE_TOOLTIPS
 
-bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
+GdkWindow *wxRadioBox::GTKGetWindow(wxArrayGdkWindows& windows) const
 {
-    if (window == m_widget->window)
-        return true;
+    windows.push_back(m_widget->window);
 
     wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
     while (node)
     {
         GtkWidget *button = GTK_WIDGET( node->GetData()->button );
 
-        if (window == button->window)
-            return true;
+        windows.push_back(button->window);
 
         node = node->GetNext();
     }
 
-    return false;
+    return NULL;
 }
 
 void wxRadioBox::OnInternalIdle()
 {
-    // Check if we have to show window now
-    if (GtkShowFromOnIdle()) return;
-    
+    wxControl::OnInternalIdle();
+
     if ( m_lostFocus )
     {
         m_hasFocus = false;
@@ -672,18 +664,6 @@ void wxRadioBox::OnInternalIdle()
 
         (void)GetEventHandler()->ProcessEvent( event );
     }
-
-    if (g_delayedFocus == this)
-    {
-        if (GTK_WIDGET_REALIZED(m_widget))
-        {
-            g_delayedFocus = NULL;
-            SetFocus();
-        }
-    }
-
-    if (wxUpdateUIEvent::CanUpdate(this))
-        UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
 }
 
 // static
@@ -707,7 +687,7 @@ int wxRadioBox::GetItemFromPoint(const wxPoint& point) const
     for ( wxRadioBoxButtonsInfoList::compatibility_iterator
             node = m_buttonsInfo.GetFirst(); node; node = node->GetNext(), n++ )
     {
-        if ( m_buttonsInfo[n]->rect.Inside(pt) )
+        if ( m_buttonsInfo[n]->rect.Contains(pt) )
             return n;
     }