void wxAuiTabContainer::DrawTab(wxDC* dc,
const wxRect& in_rect,
- const wxString& caption,
+ const wxString& caption_text,
bool active,
wxRect* out_rect,
int* x_extent)
wxCoord textx, texty;
+ // if the caption is empty, measure some temporary text
+ wxString caption = caption_text;
+ if (caption_text.empty())
+ caption = wxT("Xj");
+
// measure text
dc->SetFont(m_measuring_font);
dc->GetTextExtent(caption, &measured_textx, &measured_texty);
dc->SetFont(m_normal_font);
dc->GetTextExtent(caption, &normal_textx, &normal_texty);
+ caption = caption_text;
wxCoord tab_height = measured_texty + 4;
wxCoord tab_width = measured_textx + tab_height + 5;
m_tabs->SetSize(m_rect.x, m_rect.y, m_rect.width, tab_height);
m_tabs->SetRect(wxRect(0, 0, m_rect.width, tab_height));
m_tabs->Refresh();
+ m_tabs->Update();
wxAuiNotebookPageArray& pages = m_tabs->GetPages();
size_t i, page_count = pages.GetCount();
wxAuiNotebookPage& info = ctrl->GetPage(ctrl_idx);
info.caption = text;
ctrl->Refresh();
+ ctrl->Update();
}
-
return true;
}