| 153 | |
| 154 | |
| 155 | void GuiFormCtrl::addObject(SimObject *newObj ) |
| 156 | { |
| 157 | if( ( mHasMenu && size() > 1) || (!mHasMenu && size() > 0 ) ) |
| 158 | { |
| 159 | Con::warnf("GuiFormCtrl::addObject - Forms may only have one *direct* child - Placing on Parent!"); |
| 160 | |
| 161 | GuiControl* parent = getParent(); |
| 162 | if ( parent ) |
| 163 | parent->addObject( newObj ); |
| 164 | |
| 165 | return; |
| 166 | } |
| 167 | |
| 168 | GuiControl *newCtrl = dynamic_cast<GuiControl*>( newObj ); |
| 169 | GuiFormCtrl*formCtrl = dynamic_cast<GuiFormCtrl*>( newObj ); |
| 170 | |
| 171 | if( newCtrl && formCtrl ) |
| 172 | newCtrl->setCanSave( true ); |
| 173 | else if ( newCtrl ) |
| 174 | newCtrl->setCanSave( false ); |
| 175 | |
| 176 | Parent::addObject( newObj ); |
| 177 | } |
| 178 | |
| 179 | void GuiFormCtrl::removeObject( SimObject* object ) |
| 180 | { |
no test coverage detected