| 159 | |
| 160 | template<typename Type> |
| 161 | void initialiseByAttributes( |
| 162 | Type* _owner, |
| 163 | MyGUI::Widget* _parent = nullptr, |
| 164 | bool _throw = true, |
| 165 | bool _createFakeWidgets = true) |
| 166 | { |
| 167 | initialise(attribute::AttributeLayout<Type>::getData(), _parent, _throw, _createFakeWidgets); |
| 168 | |
| 169 | typename attribute::AttributeFieldWidgetName<Type>::VectorBindPair& data = |
| 170 | attribute::AttributeFieldWidgetName<Type>::getData(); |
| 171 | for (typename attribute::AttributeFieldWidgetName<Type>::VectorBindPair::iterator item = data.begin(); |
| 172 | item != data.end(); |
| 173 | ++item) |
| 174 | { |
| 175 | MyGUI::Widget* value = nullptr; |
| 176 | assignWidget(value, item->second, _throw, false); |
| 177 | |
| 178 | bool result = item->first->set(_owner, value); |
| 179 | |
| 180 | if (!result && _createFakeWidgets) |
| 181 | { |
| 182 | value = _createFakeWidgetT(item->first->getFieldTypeName(), mMainWidget); |
| 183 | item->first->set(_owner, value); |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | private: |
| 189 | std::string FindParentPrefix(MyGUI::Widget* _parent) |
nothing calls this directly
no test coverage detected