| 492 | } |
| 493 | |
| 494 | bool Notebook::HandleAdd( Widget::Ptr child ) { |
| 495 | auto allowed = false; |
| 496 | |
| 497 | for( const auto& tab : m_children ) { |
| 498 | if( ( tab.child == child ) || ( tab.tab_label == child ) ) { |
| 499 | allowed = true; |
| 500 | break; |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | // If the child or label isn't found on the children list, the user added the widget |
| 505 | // manually, which is not allowed for this class. |
| 506 | if( !allowed ) { |
| 507 | |
| 508 | #if defined( SFGUI_DEBUG ) |
| 509 | std::cerr << "SFGUI warning: Child must be added via AppendPage() or PrependPage() or InsertPage() for sfg::Notebook widgets.\n"; |
| 510 | #endif |
| 511 | |
| 512 | return false; |
| 513 | } |
| 514 | |
| 515 | Container::HandleAdd( child ); |
| 516 | |
| 517 | RequestResize(); |
| 518 | Invalidate(); |
| 519 | |
| 520 | return true; |
| 521 | } |
| 522 | |
| 523 | void Notebook::HandleRemove( Widget::Ptr child ) { |
| 524 | auto page_number = GetPageOf( child ); |
nothing calls this directly
no outgoing calls
no test coverage detected