MCPcopy Create free account
hub / github.com/MyGUI/mygui / onAction

Method onAction

Tools/LayoutEditor/PropertyFieldPosition.cpp:70–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 9

convertFromRelativeFunction · 0.85
getRelativeModeMethod · 0.80
getParentSizeMethod · 0.80
onSetWidgetCoordMethod · 0.80
getAbsoluteCoordMethod · 0.80
getWidgetMethod · 0.80
findMethod · 0.45
setCoordMethod · 0.45
setPropertyMethod · 0.45

Tested by

no test coverage detected