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

Method SampleLayout

UnitTests/UnitTest_TreeControl/DemoKeeper.cpp:33–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31static SampleLayout* mSampleLayout;
32
33SampleLayout::SampleLayout() :
34 BaseLayout("SampleLayout.layout")
35{
36 assignWidget(mpResourcesTree, "ResourcesTree");
37 mpResourcesTree->eventTreeNodePrepare += newDelegate(this, &SampleLayout::notifyTreeNodePrepare);
38
39
40 MyGUI::TreeControl::Node* pRoot = mpResourcesTree->getRoot();
41
42 /*#ifdef MYGUI_OGRE_PLATFORM
43 Ogre::ArchiveManager::ArchiveMapIterator ArchiveIterator = Ogre::ArchiveManager::getSingleton().getArchiveIterator();
44 while (ArchiveIterator.hasMoreElements())
45 {
46 Ogre::Archive* pArchive = ArchiveIterator.getNext();
47
48 MyGUI::TreeControl::Node* pNode = new MyGUI::TreeControl::Node(pArchive->getName(), "Data");
49 pNode->setData(pArchive);
50 pRoot->add(pNode);
51 }
52#else*/
53 common::VectorFileInfo result;
54 common::getSystemFileList(result, gMediaBase, L"*.*");
55
56 for (auto& item : result)
57 {
58 if (item.name == L".." || item.name == L".")
59 continue;
60 MyGUI::TreeControl::Node* pNode = new MyGUI::TreeControl::Node(item.name, "Data");
61
62 pNode->setData(PairFileInfo(gMediaBase, item));
63 pRoot->add(pNode);
64 }
65
66 //#endif
67}
68
69void SampleLayout::notifyTreeNodePrepare(MyGUI::TreeControl* pTreeControl, MyGUI::TreeControl::Node* pNode)
70{

Callers

nothing calls this directly

Calls 6

assignWidgetFunction · 0.85
newDelegateFunction · 0.85
getSystemFileListFunction · 0.85
getRootMethod · 0.45
setDataMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected