Various wxMotif changes including size optimisation and debugging operator fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -207,7 +207,12 @@ void wxTabControl::OnDraw(wxDC& dc, bool lastInRow)
|
||||
dc.GetTextExtent(GetLabel(), &textWidth, &textHeight);
|
||||
|
||||
int textX = (int)(tabX + (GetWidth() - textWidth)/2.0);
|
||||
if (textX < (tabX + 2))
|
||||
textX = (tabX + 2);
|
||||
|
||||
dc.SetClippingRegion(tabX, tabY, GetWidth(), GetHeight());
|
||||
dc.DrawText(GetLabel(), textX, textY);
|
||||
dc.DestroyClippingRegion();
|
||||
|
||||
if (m_isSelected)
|
||||
{
|
||||
@@ -615,6 +620,7 @@ bool wxTabView::RemoveTab(int id)
|
||||
m_tabSelection = -1;
|
||||
delete tab;
|
||||
delete tabNode;
|
||||
m_noTabs --;
|
||||
|
||||
// The layout has changed
|
||||
Layout();
|
||||
@@ -626,6 +632,24 @@ bool wxTabView::RemoveTab(int id)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxTabView::SetTabText(int id, const wxString& label)
|
||||
{
|
||||
wxTabControl* control = FindTabControlForId(id);
|
||||
if (!control)
|
||||
return FALSE;
|
||||
control->SetLabel(label);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxString wxTabView::GetTabText(int id) const
|
||||
{
|
||||
wxTabControl* control = FindTabControlForId(id);
|
||||
if (!control)
|
||||
return wxEmptyString;
|
||||
else
|
||||
return control->GetLabel();
|
||||
}
|
||||
|
||||
// Returns the total height of the tabs component -- this may be several
|
||||
// times the height of a tab, if there are several tab layers (rows).
|
||||
@@ -674,6 +698,7 @@ void wxTabView::ClearTabs(bool deleteTabs)
|
||||
delete layerNode;
|
||||
layerNode = nextLayerNode;
|
||||
}
|
||||
m_noTabs = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -761,6 +786,10 @@ void wxTabView::Layout(void)
|
||||
// Draw all tabs
|
||||
void wxTabView::Draw(wxDC& dc)
|
||||
{
|
||||
// Don't draw anything if there are no tabs.
|
||||
if (GetNumberOfTabs() == 0)
|
||||
return;
|
||||
|
||||
// Draw top margin area (beneath tabs and above view area)
|
||||
if (GetTabStyle() & wxTAB_STYLE_COLOUR_INTERIOR)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user