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

Method baseCreateWidget

MyGUIEngine/src/MyGUI_Widget.cpp:293–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291 }
292
293 Widget* Widget::baseCreateWidget(
294 WidgetStyle _style,
295 std::string_view _type,
296 std::string_view _skin,
297 const IntCoord& _coord,
298 Align _align,
299 std::string_view _layer,
300 std::string_view _name,
301 bool _template)
302 {
303 Widget* widget = nullptr;
304
305 if (_template)
306 {
307 widget = WidgetManager::getInstance().createWidget(
308 _style,
309 _type,
310 _skin,
311 _coord,
312 this,
313 _style == WidgetStyle::Popup ? nullptr : this,
314 _name);
315 mWidgetChildSkin.push_back(widget);
316 }
317 else
318 {
319 if (mWidgetClient != nullptr)
320 {
321 widget =
322 mWidgetClient->baseCreateWidget(_style, _type, _skin, _coord, _align, _layer, _name, _template);
323 onWidgetCreated(widget);
324 return widget;
325 }
326
327 widget = WidgetManager::getInstance().createWidget(
328 _style,
329 _type,
330 _skin,
331 _coord,
332 this,
333 _style == WidgetStyle::Popup ? nullptr : this,
334 _name);
335 addWidget(widget);
336 }
337
338 widget->setAlign(_align);
339
340 // присоединяем виджет с уровню
341 if (!_layer.empty() && widget->isRootWidget())
342 LayerManager::getInstance().attachToLayerNode(_layer, widget);
343
344 onWidgetCreated(widget);
345
346 return widget;
347 }
348
349 Widget* Widget::createWidgetRealT(
350 std::string_view _type,

Callers

nothing calls this directly

Calls 6

isRootWidgetMethod · 0.80
attachToLayerNodeMethod · 0.80
createWidgetMethod · 0.45
push_backMethod · 0.45
setAlignMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected