{
}
-void wxAuiDefaultTabArt::DrawBackground(wxDC* dc,
+void wxAuiDefaultTabArt::DrawBackground(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxRect& rect)
{
// draw background
- dc->SetBrush(m_bkbrush);
- dc->SetPen(*wxTRANSPARENT_PEN);
- dc->DrawRectangle(-1, -1, rect.GetWidth()+2, rect.GetHeight()+2);
+ dc.SetBrush(m_bkbrush);
+ dc.SetPen(*wxTRANSPARENT_PEN);
+ dc.DrawRectangle(-1, -1, rect.GetWidth()+2, rect.GetHeight()+2);
// draw base line
- dc->SetPen(*wxGREY_PEN);
- dc->DrawLine(0, rect.GetHeight()-1, rect.GetWidth(), rect.GetHeight()-1);
+ dc.SetPen(*wxGREY_PEN);
+ dc.DrawLine(0, rect.GetHeight()-1, rect.GetWidth(), rect.GetHeight()-1);
}
// out_rect - actual output rectangle
// x_extent - the advance x; where the next tab should start
-void wxAuiDefaultTabArt::DrawTab(wxDC* dc,
+void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
wxWindow* wnd,
const wxRect& in_rect,
const wxString& caption_text,
if (caption_text.empty())
caption = wxT("Xj");
- dc->SetFont(m_selected_font);
- dc->GetTextExtent(caption, &selected_textx, &selected_texty);
+ dc.SetFont(m_selected_font);
+ dc.GetTextExtent(caption, &selected_textx, &selected_texty);
- dc->SetFont(m_normal_font);
- dc->GetTextExtent(caption, &normal_textx, &normal_texty);
+ dc.SetFont(m_normal_font);
+ dc.GetTextExtent(caption, &normal_textx, &normal_texty);
// figure out the size of the tab
wxSize tab_size = GetTabSize(dc, wnd, caption, active, close_button_state, x_extent);
if (active)
{
- dc->SetPen(m_selected_bkpen);
- dc->SetBrush(m_selected_bkbrush);
- dc->SetFont(m_selected_font);
+ dc.SetPen(m_selected_bkpen);
+ dc.SetBrush(m_selected_bkbrush);
+ dc.SetFont(m_selected_font);
textx = selected_textx;
texty = selected_texty;
}
else
{
- dc->SetPen(m_normal_bkpen);
- dc->SetBrush(m_normal_bkbrush);
- dc->SetFont(m_normal_font);
+ dc.SetPen(m_normal_bkpen);
+ dc.SetBrush(m_normal_bkbrush);
+ dc.SetFont(m_normal_font);
textx = normal_textx;
texty = normal_texty;
}
points[6] = points[0];
- dc->DrawPolygon(6, points);
+ dc.DrawPolygon(6, points);
- dc->SetPen(*wxGREY_PEN);
+ dc.SetPen(*wxGREY_PEN);
- //dc->DrawLines(active ? 6 : 7, points);
- dc->DrawLines(7, points);
+ //dc.DrawLines(active ? 6 : 7, points);
+ dc.DrawLines(7, points);
int text_offset;
// draw tab text
- dc->DrawText(caption,
+ dc.DrawText(caption,
text_offset,
(tab_y + tab_height)/2 - (texty/2) + 1);
tab_y + (tab_height/2) - (bmp.GetHeight()/2) + 1,
close_button_width,
tab_height - 1);
- DrawButtonS(*dc, rect, bmp, *wxWHITE, close_button_state);
+ DrawButtonS(dc, rect, bmp, *wxWHITE, close_button_state);
*out_button_rect = rect;
}
}
-wxSize wxAuiDefaultTabArt::GetTabSize(wxDC* dc,
+wxSize wxAuiDefaultTabArt::GetTabSize(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxString& caption,
bool WXUNUSED(active),
{
wxCoord measured_textx, measured_texty;
- dc->SetFont(m_measuring_font);
- dc->GetTextExtent(caption, &measured_textx, &measured_texty);
+ dc.SetFont(m_measuring_font);
+ dc.GetTextExtent(caption, &measured_textx, &measured_texty);
wxCoord tab_height = measured_texty + 4;
wxCoord tab_width = measured_textx + tab_height + 5;
void wxAuiDefaultTabArt::DrawButton(
- wxDC* dc,
+ wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxRect& in_rect,
int bitmap_id,
}
- DrawButtonS(*dc, rect, bmp, *wxWHITE, button_state);
+ DrawButtonS(dc, rect, bmp, *wxWHITE, button_state);
*out_rect = rect;
}
wxClientDC dc(wnd);
dc.SetFont(m_measuring_font);
int x_ext = 0;
- wxSize s = GetTabSize(&dc,
+ wxSize s = GetTabSize(dc,
wnd,
wxT("ABCDEFGHIj"),
true,
int x_extent = 0;
- wxSize size = m_art->GetTabSize(&dc,
+ wxSize size = m_art->GetTabSize(dc,
wnd,
page.caption,
page.active,
// draw background
- m_art->DrawBackground(&dc, wnd, m_rect);
+ m_art->DrawBackground(dc, wnd, m_rect);
// draw buttons
int left_buttons_width = 0;
button_rect.SetY(1);
button_rect.SetWidth(offset);
- m_art->DrawButton(&dc,
+ m_art->DrawButton(dc,
wnd,
button_rect,
button.id,
wxRect button_rect(offset, 1, 1000, m_rect.height);
- m_art->DrawButton(&dc,
+ m_art->DrawButton(dc,
wnd,
button_rect,
button.id,
rect.x = offset;
- m_art->DrawTab(&dc,
+ m_art->DrawTab(dc,
wnd,
rect,
page.caption,
}
rect.x = active_offset;
- m_art->DrawTab(&dc,
+ m_art->DrawTab(dc,
wnd,
rect,
page.caption,