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

Function InitialiseByAttributes

Tools/EditorFramework/Control.h:59–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57
58 template<typename Type>
59 void InitialiseByAttributes(
60 Type* _owner,
61 MyGUI::Widget* _parent = nullptr,
62 bool _throw = true,
63 bool _createFakeWidgets = true)
64 {
65 typename attribute::AttributeFieldWidgetName<Type>::VectorBindPair& data =
66 attribute::AttributeFieldWidgetName<Type>::getData();
67 for (typename attribute::AttributeFieldWidgetName<Type>::VectorBindPair::iterator item = data.begin();
68 item != data.end();
69 ++item)
70 {
71 MyGUI::Widget* value = nullptr;
72 assignWidget(value, item->second, _throw, false);
73
74 bool result = item->first->set(_owner, value);
75
76 if (!result && _createFakeWidgets)
77 {
78 value = CreateFakeWidgetT(item->first->getFieldTypeName(), mMainWidget);
79 item->first->set(_owner, value);
80 }
81 }
82 }
83
84 virtual void OnInitialise(Control* _parent, MyGUI::Widget* _place, std::string_view _layoutName);
85 virtual void OnCommand(std::string_view _command);

Callers 3

OnInitialiseMethod · 0.85
OnInitialiseMethod · 0.85
OnInitialiseMethod · 0.85

Calls 5

assignWidgetFunction · 0.85
getFieldTypeNameMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected