MCPcopy Create free account
hub / github.com/TankOs/SFGUI / SetCurrentPage

Method SetCurrentPage

src/SFGUI/Notebook.cpp:312–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void Notebook::SetCurrentPage( IndexType page_number ) {
313 auto old_page = m_current_page;
314
315 if( ( m_current_page >= 0 ) && ( m_current_page < GetPageCount() ) ) {
316 m_children[static_cast<std::size_t>( m_current_page )].child->Show( false );
317 }
318
319 if( ( page_number >= 0 ) && ( page_number < GetPageCount() ) ) {
320 m_current_page = page_number;
321 }
322 else {
323 m_current_page = GetPageCount() - 1;
324 }
325
326 if( ( m_current_page >= 0 ) && ( m_current_page < GetPageCount() ) ) {
327 m_children[static_cast<std::size_t>( m_current_page )].child->Show( true );
328 }
329
330 if( m_current_page != old_page ) {
331 GetSignals().Emit( OnTabChange );
332 }
333
334 Invalidate();
335}
336
337Notebook::IndexType Notebook::GetPrelightTab() const {
338 return m_prelight_tab;

Callers

nothing calls this directly

Calls 2

EmitMethod · 0.80
ShowMethod · 0.45

Tested by

no test coverage detected