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

Method fillSeparatorData

Tools/SkinEditor/SkinExportSerializer.cpp:299–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297 }
298
299 void SkinExportSerializer::fillSeparatorData(DataPtr _data, pugi::xml_node _node)
300 {
301 pugi::xpath_node_set regions = _node.select_nodes(R"(BasisSkin[@type="SubSkin"or@type="TileRect"])");
302 for (auto region : regions)
303 {
304 MyGUI::IntCoord offset = MyGUI::IntCoord::parse(region.node().attribute("offset").value());
305
306 MyGUI::Align align = MyGUI::Align::parse(region.node().attribute("align").value());
307 if (align.isLeft())
308 {
309 DataPtr data = getChildData(_data, "Separator", "Left");
310 data->setPropertyValue("Visible", "True");
311 data->setPropertyValue("Offset", MyGUI::utility::toString(offset.width));
312 }
313 else if (align.isRight())
314 {
315 DataPtr data = getChildData(_data, "Separator", "Right");
316 data->setPropertyValue("Visible", "True");
317 data->setPropertyValue("Offset", MyGUI::utility::toString(offset.width));
318 }
319 if (align.isTop())
320 {
321 DataPtr data = getChildData(_data, "Separator", "Top");
322 data->setPropertyValue("Visible", "True");
323 data->setPropertyValue("Offset", MyGUI::utility::toString(offset.height));
324 }
325 else if (align.isBottom())
326 {
327 DataPtr data = getChildData(_data, "Separator", "Bottom");
328 data->setPropertyValue("Visible", "True");
329 data->setPropertyValue("Offset", MyGUI::utility::toString(offset.height));
330 }
331 }
332 }
333
334 DataPtr SkinExportSerializer::getChildData(DataPtr _data, std::string_view _dataType, std::string_view _name)
335 {

Callers

nothing calls this directly

Calls 7

toStringFunction · 0.85
parseFunction · 0.50
select_nodesMethod · 0.45
valueMethod · 0.45
attributeMethod · 0.45
nodeMethod · 0.45
setPropertyValueMethod · 0.45

Tested by

no test coverage detected