void PropertyFieldPosition::onAction(const std::string& _value, bool _force) { EditorWidgets* ew = &EditorWidgets::getInstance(); WidgetContainer* widgetContainer = ew->find(mCurrentWidget); bool goodData = onCheckValue(); if (goodData) { if (widgetContainer->getRelativeMode()) { std::istringstream str(_value); MyGUI::FloatCoord float_coord; str >> float_coord; float_coord.left = float_coord.left / 100; float_coord.top = float_coord.top / 100; float_coord.width = float_coord.width / 100; float_coord.height = float_coord.height / 100; MyGUI::IntCoord coord = MyGUI::CoordConverter::convertFromRelative(float_coord, mCurrentWidget->getParentSize()); mCurrentWidget->setCoord(coord); EditorWidgets::getInstance().onSetWidgetCoord(mCurrentWidget, mCurrentWidget->getAbsoluteCoord(), "PropertiesPanelView"); } else {
void PropertiesPanelView::notifyApplyProperties(MyGUI::WidgetPtr _sender, bool _force) { EditorWidgets * ew = &EditorWidgets::getInstance(); WidgetContainer * widgetContainer = ew->find(current_widget); MyGUI::EditPtr senderEdit = _sender->castType<MyGUI::Edit>(); std::string action = senderEdit->getUserString("action"); std::string value = senderEdit->getOnlyText(); std::string type = senderEdit->getUserString("type"); ON_EXIT(UndoManager::getInstance().addValue(PR_PROPERTIES););