]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/renderer.cpp
Fix explicitly setting focus to generic wxSpinCtrl.
[wxWidgets.git] / src / gtk / renderer.cpp
index a70d4e35b70089fb21749fe34d9616768f77ae46..d859f6846b1556dc242fa7e364c1177ed6e01614 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     20.07.2003
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
 // Created:     20.07.2003
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
-// License:     wxWindows licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -114,7 +114,7 @@ public:
                                 const wxRect& rect,
                                 int flags=0);
 
                                 const wxRect& rect,
                                 int flags=0);
 
-    virtual void DrawRadioButton(wxWindow* win,
+    virtual void DrawRadioBitmap(wxWindow* win,
                                 wxDC& dc,
                                 const wxRect& rect,
                                 int flags=0);
                                 wxDC& dc,
                                 const wxRect& rect,
                                 int flags=0);
@@ -530,27 +530,21 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
                                      const wxRect& rect,
                                      int flags )
 {
                                      const wxRect& rect,
                                      int flags )
 {
-    GtkWidget *tree = wxGTKPrivate::GetTreeWidget();
-
     GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
     wxASSERT_MSG( gdk_window,
                   wxT("cannot use wxRendererNative on wxDC of this type") );
 
     GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
     wxASSERT_MSG( gdk_window,
                   wxT("cannot use wxRendererNative on wxDC of this type") );
 
-    int x_diff = 0;
-    if (win->GetLayoutDirection() == wxLayout_RightToLeft)
-        x_diff = rect.width;
-
-    GtkStateType state = GTK_STATE_NORMAL;
-
     if (flags & wxCONTROL_SELECTED)
     {
     if (flags & wxCONTROL_SELECTED)
     {
+        int x_diff = 0;
+        if (win->GetLayoutDirection() == wxLayout_RightToLeft)
+            x_diff = rect.width;
+
         // the wxCONTROL_FOCUSED state is deduced
         // directly from the m_wxwindow by GTK+
         // the wxCONTROL_FOCUSED state is deduced
         // directly from the m_wxwindow by GTK+
-        state = GTK_STATE_SELECTED;
-
-        gtk_paint_flat_box( tree->style, // win->m_widget->style,
+        gtk_paint_flat_box(wxGTKPrivate::GetTreeWidget()->style,
                         gdk_window,
                         gdk_window,
-                        state,
+                        GTK_STATE_SELECTED,
                         GTK_SHADOW_NONE,
                         NULL,
                         win->m_wxwindow,
                         GTK_SHADOW_NONE,
                         NULL,
                         win->m_wxwindow,
@@ -560,32 +554,9 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
                         rect.width,
                         rect.height );
     }
                         rect.width,
                         rect.height );
     }
-    else // !wxCONTROL_SELECTED
-    {
-        state = GTK_STATE_NORMAL;
-    }
 
     if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED))
 
     if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED))
-    {
-        if (flags & wxCONTROL_SELECTED)
-            state = GTK_STATE_SELECTED;
-
-        gtk_paint_focus( tree->style,
-                         gdk_window,
-                         state,
-                         NULL,
-                         win->m_wxwindow,
-                         // Detail "treeview" causes warning with GTK+ 2.12 Clearlooks theme:
-                         // "... no property named `row-ending-details'"
-                         // Using "treeview-middle" would fix the warning, but the right
-                         // edge of the focus rect is not getting erased properly either.
-                         // Better to not specify this detail unless the drawing is fixed.
-                         "",
-                         dc.LogicalToDeviceX(rect.x),
-                         dc.LogicalToDeviceY(rect.y),
-                         rect.width,
-                         rect.height );
-    }
+        DrawFocusRect(win, dc, rect, flags);
 }
 
 void wxRendererGTK::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
 }
 
 void wxRendererGTK::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
@@ -728,7 +699,7 @@ void wxRendererGTK::DrawChoice(wxWindow* win, wxDC& dc,
 
 
 // Draw a themed radio button
 
 
 // Draw a themed radio button
-void wxRendererGTK::DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
+void wxRendererGTK::DrawRadioBitmap(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
 {
     GtkWidget *button = wxGTKPrivate::GetRadioButtonWidget();
 
 {
     GtkWidget *button = wxGTKPrivate::GetRadioButtonWidget();