]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/renderer.cpp
Correct conversion from text file to charset (which is read in that text file)
[wxWidgets.git] / src / gtk / renderer.cpp
index 34554c2b63377b0ba3fddcdbd69906589ea8fb3d..ce6cc046e05d72f93f9582fc242cac052f180735 100644 (file)
@@ -54,6 +54,9 @@ public:
                                   wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
                                   wxHeaderButtonParams* params = NULL);
 
+    virtual int GetHeaderButtonHeight(wxWindow *win);
+
+
     // draw the expanded/collapsed icon for a tree control item
     virtual void DrawTreeItemButton(wxWindow *win,
                                     wxDC& dc,
@@ -171,6 +174,10 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
 {
 
     GtkWidget *button = wxGTKPrivate::GetHeaderButtonWidget();
+    if (flags & wxCONTROL_SPECIAL)
+        button = wxGTKPrivate::GetHeaderButtonWidgetFirst();
+    if (flags & wxCONTROL_DIRTY)
+        button = wxGTKPrivate::GetHeaderButtonWidgetLast();
 
     GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
     wxASSERT_MSG( gdk_window,
@@ -200,10 +207,21 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
         "button",
         dc.LogicalToDeviceX(rect.x) - x_diff, rect.y, rect.width, rect.height
     );
-
     return DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params);
 }
 
+int wxRendererGTK::GetHeaderButtonHeight(wxWindow *WXUNUSED(win))
+{
+    GtkWidget *button = wxGTKPrivate::GetHeaderButtonWidget();
+    
+    GtkRequisition req;
+    GTK_WIDGET_GET_CLASS(button)->size_request(button, &req);
+    
+    return req.height;
+}
+
+
 // draw a ">" or "v" button
 void
 wxRendererGTK::DrawTreeItemButton(wxWindow* win,
@@ -507,6 +525,8 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
                                      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") );
@@ -515,14 +535,15 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
     if (win->GetLayoutDirection() == wxLayout_RightToLeft)
         x_diff = rect.width;
 
-    GtkStateType state;
+    GtkStateType state = GTK_STATE_NORMAL;
+    
     if (flags & wxCONTROL_SELECTED)
     {
         // the wxCONTROL_FOCUSED state is deduced
         // directly from the m_wxwindow by GTK+
         state = GTK_STATE_SELECTED;
 
-        gtk_paint_flat_box( win->m_widget->style,
+        gtk_paint_flat_box( tree->style, // win->m_widget->style,
                         gdk_window,
                         state,
                         GTK_SHADOW_NONE,
@@ -541,7 +562,10 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
 
     if ((flags & wxCONTROL_CURRENT) && (flags & wxCONTROL_FOCUSED))
     {
-        gtk_paint_focus( win->m_widget->style,
+        if (flags & wxCONTROL_SELECTED)
+            state = GTK_STATE_SELECTED;
+            
+        gtk_paint_focus( tree->style,
                          gdk_window,
                          state,
                          NULL,
@@ -551,7 +575,8 @@ wxRendererGTK::DrawItemSelectionRect(wxWindow* win,
                          // 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.
-                         NULL,
+                         // RR: I added that to the Pizza widget class.
+                         "treeview",
                          dc.LogicalToDeviceX(rect.x),
                          dc.LogicalToDeviceY(rect.y),
                          rect.width,