| 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 | { |
no test coverage detected