| 67 | } |
| 68 | |
| 69 | bool Box::HandleAdd( Widget::Ptr child ) { |
| 70 | ChildrenCont::const_iterator iter( std::find( m_box_children.begin(), m_box_children.end(), child ) ); |
| 71 | |
| 72 | // If there's no ChildInfo present for the widget, the user added the widget |
| 73 | // manually, which is not allowed for this class. |
| 74 | if( iter == m_box_children.end() ) { |
| 75 | |
| 76 | #if defined( SFGUI_DEBUG ) |
| 77 | std::cerr << "SFGUI warning: Child must be added via Pack() for sfg::Box widgets.\n"; |
| 78 | #endif |
| 79 | |
| 80 | return false; |
| 81 | } |
| 82 | |
| 83 | Container::HandleAdd( child ); |
| 84 | |
| 85 | RequestResize(); |
| 86 | Invalidate(); |
| 87 | |
| 88 | return true; |
| 89 | } |
| 90 | |
| 91 | void Box::HandleRemove( Widget::Ptr child ) { |
| 92 | ChildrenCont::iterator iter( std::find( m_box_children.begin(), m_box_children.end(), child ) ); |