| 1890 | //----------------------------------------------------------------------------- |
| 1891 | |
| 1892 | void GuiControl::addObject(SimObject *object) |
| 1893 | { |
| 1894 | GuiControl *ctrl = dynamic_cast<GuiControl *>(object); |
| 1895 | if(object->getGroup() == this) |
| 1896 | return; |
| 1897 | |
| 1898 | AssertFatal( ctrl, "GuiControl::addObject() - cannot add non-GuiControl as child of GuiControl" ); |
| 1899 | |
| 1900 | Parent::addObject(object); |
| 1901 | |
| 1902 | AssertFatal(!ctrl->isAwake(), "GuiControl::addObject: object is already awake before add"); |
| 1903 | if( mAwake ) |
| 1904 | ctrl->awaken(); |
| 1905 | |
| 1906 | // If we are a child, notify our parent that we've been removed |
| 1907 | GuiControl *parent = ctrl->getParent(); |
| 1908 | if( parent ) |
| 1909 | parent->onChildAdded( ctrl ); |
| 1910 | } |
| 1911 | |
| 1912 | //----------------------------------------------------------------------------- |
| 1913 |
no test coverage detected