bool GuiInspectorField::onAdd() { setInspectorProfile(); if ( !Parent::onAdd() ) return false; if ( !mInspector ) return false; mEdit = constructEditControl(); if ( mEdit == NULL ) return false; setBounds(0,0,100,18); // Add our edit as a child addObject( mEdit ); // Calculate Caption and EditCtrl Rects updateRects(); // Force our editField to set it's value updateValue(); return true; }
void GuiInspectorField::updateValue() { if( mInspector->getNumInspectObjects() > 1 ) { setInspectorProfile(); if( !hasSameValueInAllObjects() ) setValue( StringTable->EmptyString() ); else setValue( getData() ); } else setValue( getData() ); }
bool GuiInspectorVariableField::onAdd() { setInspectorProfile(); // Hack: skip our immediate parent if ( !Parent::Parent::onAdd() ) return false; { GuiTextEditCtrl *edit = new GuiTextEditCtrl(); edit->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorTextEditProfile" ); edit->registerObject(); char szBuffer[512]; dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), edit->getId() ); edit->setField("AltCommand", szBuffer ); edit->setField("Validate", szBuffer ); mEdit = edit; } setBounds(0,0,100,18); // Add our edit as a child addObject( mEdit ); // Calculate Caption and EditCtrl Rects updateRects(); // Force our editField to set it's value updateValue(); return true; }