+ int clip_width = tab_width;
+ if (tab_x + clip_width > in_rect.x + in_rect.width)
+ clip_width = (in_rect.x + in_rect.width) - tab_x;
+
+/*
+ wxPoint clip_points[6];
+ clip_points[0] = wxPoint(tab_x, tab_y+tab_height-3);
+ clip_points[1] = wxPoint(tab_x, tab_y+2);
+ clip_points[2] = wxPoint(tab_x+2, tab_y);
+ clip_points[3] = wxPoint(tab_x+clip_width-1, tab_y);
+ clip_points[4] = wxPoint(tab_x+clip_width+1, tab_y+2);
+ clip_points[5] = wxPoint(tab_x+clip_width+1, tab_y+tab_height-3);
+
+ // FIXME: these ports don't provide wxRegion ctor from array of points
+#if !defined(__WXDFB__) && !defined(__WXCOCOA__)
+ // set the clipping region for the tab --
+ wxRegion clipping_region(WXSIZEOF(clip_points), clip_points);
+ dc.SetClippingRegion(clipping_region);
+#endif // !wxDFB && !wxCocoa
+*/
+ // since the above code above doesn't play well with WXDFB or WXCOCOA,
+ // we'll just use a rectangle for the clipping region for now --
+ dc.SetClippingRegion(tab_x, tab_y, clip_width+1, tab_height-3);
+
+
+ wxPoint border_points[6];
+ border_points[0] = wxPoint(tab_x, tab_y+tab_height-4);
+ border_points[1] = wxPoint(tab_x, tab_y+2);
+ border_points[2] = wxPoint(tab_x+2, tab_y);
+ border_points[3] = wxPoint(tab_x+tab_width-2, tab_y);
+ border_points[4] = wxPoint(tab_x+tab_width, tab_y+2);
+ border_points[5] = wxPoint(tab_x+tab_width, tab_y+tab_height-4);
+
+
+ int drawn_tab_yoff = border_points[1].y;
+ int drawn_tab_height = border_points[0].y - border_points[1].y;
+
+
+ if (page.active)
+ {
+ // draw active tab
+
+ // draw base background color
+ wxRect r(tab_x, tab_y, tab_width, tab_height);
+ dc.SetPen(m_base_colour_pen);
+ dc.SetBrush(m_base_colour_brush);
+ dc.DrawRectangle(r.x+1, r.y+1, r.width-1, r.height-4);
+
+ // this white helps fill out the gradient at the top of the tab
+ dc.SetPen(*wxWHITE_PEN);
+ dc.SetBrush(*wxWHITE_BRUSH);
+ dc.DrawRectangle(r.x+2, r.y+1, r.width-3, r.height-4);
+
+ // these two points help the rounded corners appear more antialiased
+ dc.SetPen(m_base_colour_pen);
+ dc.DrawPoint(r.x+2, r.y+1);
+ dc.DrawPoint(r.x+r.width-2, r.y+1);
+
+ // set rectangle down a bit for gradient drawing
+ r.SetHeight(r.GetHeight()/2);
+ r.x += 2;
+ r.width -= 2;
+ r.y += r.height;
+ r.y -= 2;
+
+ // draw gradient background
+ wxColor top_color = *wxWHITE;
+ wxColor bottom_color = m_base_colour;
+ dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
+ }
+ else