void TabControl::OnTabPressed( Controls::Base* control ) { TabButton* pButton = gwen_cast<TabButton>(control); if ( !pButton ) return; Base* pPage = pButton->GetPage(); if ( !pPage ) return; if ( m_pCurrentButton == pButton) return; if ( m_pCurrentButton ) { Base* pPage = m_pCurrentButton->GetPage(); if ( pPage ) { pPage->SetHidden( true ); } m_pCurrentButton->Redraw(); m_pCurrentButton = NULL; } m_pCurrentButton = pButton; pPage->SetHidden( false ); m_TabStrip->Invalidate(); Invalidate(); }
void TabControl::OnTabPressed( Controls::Base* control ) { if (!control) return; TabButton* pButton = control->DynamicCastTabButton(); if ( !pButton ) return; Base* pPage = pButton->GetPage(); if ( !pPage ) return; if ( m_pCurrentButton == pButton) return; if ( m_pCurrentButton ) { Base* pPage = m_pCurrentButton->GetPage(); if ( pPage ) { pPage->SetHidden( true ); } m_pCurrentButton = NULL; } m_pCurrentButton = pButton; pPage->SetHidden( false ); m_TabStrip->Invalidate(); Invalidate(); }