]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
corrected off by 1 error in cMB2WC() call (thanks valgrind)
[wxWidgets.git] / src / gtk / window.cpp
index 7af19166b5c622eafedb37eb8c958fa33ec9f372..ccb4500d436d9297cd9514efcc6910a419979067 100644 (file)
@@ -424,6 +424,8 @@ void wxgtk_window_size_request_callback(GtkWidget *widget,
 }
 }
 
+#if wxUSE_COMBOBOX
+
 extern "C" {
 static
 void wxgtk_combo_size_request_callback(GtkWidget *widget,
@@ -459,6 +461,8 @@ void wxgtk_combo_size_request_callback(GtkWidget *widget,
 }
 }
 
+#endif // wxUSE_COMBOBOX
+
 //-----------------------------------------------------------------------------
 // "expose_event" of m_wxwindow
 //-----------------------------------------------------------------------------
@@ -1434,7 +1438,7 @@ gtk_window_button_press_callback( GtkWidget *widget,
 
     g_lastButtonNumber = gdk_event->button;
 
-    if (win->m_wxwindow && (g_focusWindow != win) && win->CanAcceptFocus())
+    if (win->m_wxwindow && (g_focusWindow != win) && win->IsFocusable())
     {
         gtk_widget_grab_focus( win->m_wxwindow );
     }
@@ -1570,7 +1574,7 @@ gtk_window_button_press_callback( GtkWidget *widget,
         return TRUE;
 
     if ((event_type == wxEVT_LEFT_DOWN) && !win->IsOfStandardClass() && 
-        (g_focusWindow != win) && win->CanAcceptFocus())
+        (g_focusWindow != win) && win->IsFocusable())
     {
         gtk_widget_grab_focus( win->m_wxwindow );
     }
@@ -2543,6 +2547,7 @@ void wxWindowGTK::PostCreation()
                           G_CALLBACK (gtk_window_size_callback), this);
     }
 
+#if wxUSE_COMBOBOX
     if (GTK_IS_COMBO(m_widget))
     {
         GtkCombo *gcombo = GTK_COMBO(m_widget);
@@ -2550,17 +2555,18 @@ void wxWindowGTK::PostCreation()
         g_signal_connect (gcombo->entry, "size_request",
                           G_CALLBACK (wxgtk_combo_size_request_callback),
                           this);
-    }
+    } else
+#endif // wxUSE_COMBOBOX
 #ifdef GTK_IS_FILE_CHOOSER_BUTTON
-    else if (!gtk_check_version(2,6,0) && GTK_IS_FILE_CHOOSER_BUTTON(m_widget))
+    if (!gtk_check_version(2,6,0) && GTK_IS_FILE_CHOOSER_BUTTON(m_widget))
     {
         // If we connect to the "size_request" signal of a GtkFileChooserButton
         // then that control won't be sized properly when placed inside sizers
         // (this can be tested removing this elseif and running XRC or WIDGETS samples)
         // FIXME: what should be done here ?
-    }
+    } else
 #endif
-    else if ( !IsTopLevel() ) // top level windows use their own callback
+    if ( !IsTopLevel() ) // top level windows use their own callback
     {
         // This is needed if we want to add our windows into native
         // GTK controls, such as the toolbar. With this callback, the
@@ -3179,11 +3185,13 @@ void wxWindowGTK::SetFocus()
     {
         if (GTK_IS_CONTAINER(m_widget))
         {
+#if wxUSE_RADIOBTN
             if (IsKindOf(CLASSINFO(wxRadioButton)))
             {
                 gtk_widget_grab_focus (m_widget);
                 return;
             }
+#endif // wxUSE_RADIOBTN
 
             gtk_widget_child_focus( m_widget, GTK_DIR_TAB_FORWARD );
         }
@@ -3380,7 +3388,7 @@ bool wxWindowGTK::DoNavigateIn(int flags)
     }
     else // navigate inside the container
     {
-        wxWindow *parent = wxGetTopLevelParent(this);
+        wxWindow *parent = wxGetTopLevelParent((wxWindow *)this);
         wxCHECK_MSG( parent, false, _T("every window must have a TLW parent") );
 
         GtkDirectionType dir;
@@ -4159,13 +4167,13 @@ void wxWindowGTK::SetScrollPos(int orient, int pos, bool WXUNUSED(refresh))
             pos = 0;
         m_scrollPos[dir] = adj->value = pos;
 
-        g_signal_handlers_disconnect_by_func( m_scrollBar[dir],
-                              (gpointer)gtk_scrollbar_value_changed, this);
+        g_signal_handlers_block_by_func(m_scrollBar[dir],
+            (gpointer)gtk_scrollbar_value_changed, this);
 
         gtk_adjustment_value_changed(adj);
-        
-        g_signal_connect_after(m_scrollBar[dir], "value_changed",
-                               G_CALLBACK(gtk_scrollbar_value_changed), this);
+
+        g_signal_handlers_unblock_by_func(m_scrollBar[dir],
+            (gpointer)gtk_scrollbar_value_changed, this);
     }
 }