offset += m_art->GetIndentSize();
// prepare the tab-close-button array
+ while (m_tab_close_buttons.GetCount() > page_count)
+ m_tab_close_buttons.RemoveAt(m_tab_close_buttons.GetCount()-1);
+
while (m_tab_close_buttons.GetCount() < page_count)
{
wxAuiTabContainerButton tempbtn;
m_tab_close_buttons.Add(tempbtn);
}
+
+ // buttons before the tab offset must be set to hidden
for (i = 0; i < m_tab_offset; ++i)
{
- // buttons before the tab offset must be set to hidden
m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN;
}
if (rect.width <= 0)
break;
-
-
-
m_art->DrawTab(dc,
wnd,
rect,
offset += x_extent;
}
+
+ // make sure to deactivate buttons which are off the screen to the right
+ for (++i; i < m_tab_close_buttons.GetCount(); ++i)
+ {
+ m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN;
+ }
+
+
// draw the active tab again so it stands in the foreground
if (active >= m_tab_offset && active < m_pages.GetCount())
{