| 68 | } |
| 69 | |
| 70 | void PropertyFieldPosition::onAction(std::string_view _value, bool _force) |
| 71 | { |
| 72 | EditorWidgets* ew = &EditorWidgets::getInstance(); |
| 73 | WidgetContainer* widgetContainer = ew->find(mCurrentWidget); |
| 74 | |
| 75 | bool goodData = onCheckValue(); |
| 76 | |
| 77 | if (goodData) |
| 78 | { |
| 79 | if (widgetContainer->getRelativeMode()) |
| 80 | { |
| 81 | std::stringstream str; |
| 82 | str << _value; |
| 83 | MyGUI::DoubleCoord double_coord; |
| 84 | str >> double_coord; |
| 85 | double_coord.left /= 100; |
| 86 | double_coord.top /= 100; |
| 87 | double_coord.width /= 100; |
| 88 | double_coord.height /= 100; |
| 89 | MyGUI::IntCoord coord = |
| 90 | MyGUI::CoordConverter::convertFromRelative(double_coord, mCurrentWidget->getParentSize()); |
| 91 | |
| 92 | mCurrentWidget->setCoord(coord); |
| 93 | EditorWidgets::getInstance().onSetWidgetCoord( |
| 94 | mCurrentWidget, |
| 95 | mCurrentWidget->getAbsoluteCoord(), |
| 96 | "PropertiesPanelView"); |
| 97 | } |
| 98 | else |
| 99 | { |
| 100 | widgetContainer->getWidget()->setProperty("Coord", _value); |
| 101 | EditorWidgets::getInstance().onSetWidgetCoord( |
| 102 | mCurrentWidget, |
| 103 | mCurrentWidget->getAbsoluteCoord(), |
| 104 | "PropertiesPanelView"); |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | void PropertyFieldPosition::notifyTryApplyProperties(MyGUI::EditBox* _sender) |
| 110 | { |
nothing calls this directly
no test coverage detected