| 310 | } |
| 311 | |
| 312 | void 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 | |
| 337 | Notebook::IndexType Notebook::GetPrelightTab() const { |
| 338 | return m_prelight_tab; |