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

Method finishNewWidget

Tools/LayoutEditor/WidgetCreatorManager.cpp:145–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143 }
144
145 void WidgetCreatorManager::finishNewWidget(const MyGUI::IntPoint& _point)
146 {
147 if (mNewWidget != nullptr)
148 {
149 MyGUI::IntCoord coord = getCoordNewWidget(_point);
150
151 if (coord.width != 0 && coord.height != 0)
152 {
153 mNewWidget->setCoord(coord);
154
155 // создали виджет, все счастливы
156 WidgetContainer* widgetContainer = new WidgetContainer(mWidgetType, mWidgetSkin, mNewWidget);
157 if (mPopupMode)
158 widgetContainer->setStyle(mNewWidget->getWidgetStyle().print());
159 mNewWidget = nullptr;
160
161 EditorWidgets::getInstance().add(widgetContainer);
162 UndoManager::getInstance().addValue();
163
164 // чтобы выделился созданый виджет
165 resetAllCreatorInfo();
166
167 WidgetSelectorManager::getInstance().setSelectedWidget(widgetContainer->getWidget());
168 }
169 else
170 {
171 // не удалось создать, т.к. размер нулевой
172 resetWidget();
173 }
174 }
175
176 resetAllCreatorInfo();
177
178 eventChangeSelector(false, MyGUI::IntCoord());
179 }
180
181 void WidgetCreatorManager::resetWidget()
182 {

Callers 1

onMouseButtonReleasedMethod · 0.80

Calls 9

setStyleMethod · 0.80
getWidgetStyleMethod · 0.80
addValueMethod · 0.80
setSelectedWidgetMethod · 0.80
getWidgetMethod · 0.80
IntCoordFunction · 0.50
setCoordMethod · 0.45
printMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected