void TabControl::AddPage( TabButton* pButton ) { Base* pPage = pButton->GetPage(); pPage->SetParent( this ); pPage->SetHidden( true ); pPage->SetMargin( Margin( 6, 6, 6, 6 ) ); pPage->Dock( Pos::Fill ); pButton->SetParent( m_TabStrip ); pButton->Dock( Pos::Left ); pButton->SizeToContents(); if ( pButton->GetTabControl() ) pButton->onPress.RemoveHandler( pButton->GetTabControl() ); pButton->SetTabControl( this ); pButton->onPress.Add( this, &TabControl::OnTabPressed ); if ( !m_pCurrentButton ) { pButton->OnPress(); } onAddTab.Call( this ); Invalidate(); }