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

Method notifyTreeNodePrepare

UnitTests/UnitTest_TreeControl/DemoKeeper.cpp:69–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void SampleLayout::notifyTreeNodePrepare(MyGUI::TreeControl* pTreeControl, MyGUI::TreeControl::Node* pNode)
70{
71 if (pNode == pTreeControl->getRoot())
72 return;
73
74 pNode->removeAll();
75
76 /*#ifdef MYGUI_OGRE_PLATFORM
77 Ogre::Archive* pArchive = *(pNode->getData<Ogre::Archive*>());
78
79 MyGUI::UString strPath(getPath(pNode));
80 Ogre::StringVectorPtr Resources = pArchive->find(strPath + "*", false, true);
81 for (Ogre::StringVector::iterator Iterator = Resources->begin(); Iterator != Resources->end(); ++Iterator)
82 {
83 MyGUI::TreeControl::Node* pChild = new MyGUI::TreeControl::Node(*Iterator, "Folder");
84 pChild->setData(pArchive);
85 pNode->add(pChild);
86 }
87
88 Resources = pArchive->find(strPath + "*", false, false);
89 for (Ogre::StringVector::iterator Iterator = Resources->begin(); Iterator != Resources->end(); ++Iterator)
90 {
91 MyGUI::UString strName(*Iterator);
92 MyGUI::UString strExtension;
93 size_t nPosition = strName.rfind(".");
94 if (nPosition != MyGUI::UString::npos)
95 {
96 strExtension = strName.substr(nPosition + 1);
97 std::transform(strExtension.begin(), strExtension.end(), strExtension.begin(), tolower);
98 }
99
100 MyGUI::UString strImage;
101 if (strExtension == "png" || strExtension == "tif" || strExtension == "tiff" || strExtension == "jpg" || strExtension == "jpeg")
102 strImage = "Image";
103 else
104 if (strExtension == "mat" || strExtension == "material")
105 strImage = "Material";
106 else
107 if (strExtension == "layout")
108 strImage = "Layout";
109 else
110 if (strExtension == "ttf" || strExtension == "font" || strExtension == "fontdef")
111 strImage = "Font";
112 else
113 if (strExtension == "txt" || strExtension == "text")
114 strImage = "Text";
115 else
116 if (strExtension == "xml")
117 strImage = "XML";
118 else
119 if (strExtension == "mesh")
120 strImage = "Mesh";
121 else
122 if (strExtension == "htm" || strExtension == "html")
123 strImage = "HTML";
124 else
125 strImage = "Unknown";
126

Callers

nothing calls this directly

Calls 10

getSystemFileListFunction · 0.85
removeAllMethod · 0.80
rfindMethod · 0.80
substrMethod · 0.80
setPreparedMethod · 0.80
getRootMethod · 0.45
setDataMethod · 0.45
addMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected