- int y, last_y = -1;
- for (y = points[0].y; y > points[2].y; --y)
- {
- if (y < tab_y+(tab_height*3/5) && y != last_y)
- {
- last_y = y;
- c = StepColour(c, 102);
- dc.SetPen(wxPen(c));
- }
-
- dc.DrawLine(points[0].x+1, y, points[5].x, y);
- }
+ // 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, r.y, r.width, r.height);
+
+ // 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+2, r.width-3, r.height);
+
+ // these two points help the rounded corners appear more antialiased
+ dc.SetPen(m_base_colour_pen);
+ dc.DrawPoint(r.x+2, r.y+2);
+ dc.DrawPoint(r.x+r.width-2, r.y+2);
+
+ // set rectangle down a bit for gradient drawing
+ r.SetHeight(r.GetHeight()/2);
+ r.x += 2;
+ r.width -= 2;
+ r.y += r.height;
+
+ // draw gradient background
+ wxColor start_color = StepColour(m_base_colour, 95);
+ wxColor end_color = *wxWHITE;
+ dc.GradientFillLinear(r, start_color, end_color, wxNORTH);