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

Method createScene

Demos/Demo_ItemBox/DemoKeeper.cpp:91–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 void DemoKeeper::createScene()
92 {
93 base::BaseDemoManager::createScene();
94 MyGUI::LayoutManager::getInstance().loadLayout("Wallpaper.layout");
95 const MyGUI::VectorWidgetPtr& root = MyGUI::LayoutManager::getInstance().loadLayout("HelpPanel.layout");
96 if (root.size() == 1)
97 root.at(0)->findWidget("Text")->castType<MyGUI::TextBox>()->setCaption(
98 "You can drag and drop items from one ItemBox to another. Hold mouse over item to see tool tip. Resize "
99 "windows to see vertical and horizontal ItebBox alignments.");
100
101 // регестрируем тип нашего ресурса
102 const std::string& resourceCategory = MyGUI::ResourceManager::getInstance().getCategoryName();
103 MyGUI::FactoryManager::getInstance().registerFactory<ResourceItemInfo>(resourceCategory);
104
105 MyGUI::ResourceManager::getInstance().load("Resources.xml");
106
107 mToolTip = new ToolTip();
108 mToolTip->hide();
109
110 mItemBoxV = new ItemBoxWindow("ItemBoxV.layout");
111 mItemBoxV->getItemBox()->addItem(new ItemData());
112 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item1", 5));
113 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item2", 5));
114 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item3", 5));
115 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item4", 5));
116 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item5", 5));
117 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item6", 5));
118 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item7", 5));
119 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item8", 5));
120 mItemBoxV->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item9", 5));
121
122 mItemBoxV->getItemBox()->eventStartDrag = MyGUI::newDelegate(this, &DemoKeeper::notifyStartDrop);
123 mItemBoxV->getItemBox()->eventRequestDrop = MyGUI::newDelegate(this, &DemoKeeper::notifyRequestDrop);
124 mItemBoxV->getItemBox()->eventDropResult = MyGUI::newDelegate(this, &DemoKeeper::notifyEndDrop);
125 mItemBoxV->getItemBox()->eventChangeDDState = newDelegate(this, &DemoKeeper::notifyDropState);
126 mItemBoxV->getItemBox()->eventNotifyItem = newDelegate(this, &DemoKeeper::notifyNotifyItem);
127 mItemBoxV->getItemBox()->eventToolTip = newDelegate(this, &DemoKeeper::notifyToolTip);
128
129 mItemBoxH = new ItemBoxWindow("ItemBoxH.layout");
130 mItemBoxH->getItemBox()->addItem(new ItemData());
131 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item1", 5));
132 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item2", 5));
133 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item3", 5));
134 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item4", 5));
135 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item5", 5));
136 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item6", 5));
137 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item7", 5));
138 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item8", 5));
139 mItemBoxH->getItemBox()->addItem(new ItemData("info_Crystal_Clear_Item9", 5));
140
141 mItemBoxH->getItemBox()->eventStartDrag = MyGUI::newDelegate(this, &DemoKeeper::notifyStartDrop);
142 mItemBoxH->getItemBox()->eventRequestDrop = MyGUI::newDelegate(this, &DemoKeeper::notifyRequestDrop);
143 mItemBoxH->getItemBox()->eventDropResult = MyGUI::newDelegate(this, &DemoKeeper::notifyEndDrop);
144 mItemBoxH->getItemBox()->eventChangeDDState = newDelegate(this, &DemoKeeper::notifyDropState);
145 mItemBoxH->getItemBox()->eventNotifyItem = newDelegate(this, &DemoKeeper::notifyNotifyItem);
146 mItemBoxH->getItemBox()->eventToolTip = newDelegate(this, &DemoKeeper::notifyToolTip);
147 }
148

Callers

nothing calls this directly

Calls 9

newDelegateFunction · 0.85
loadLayoutMethod · 0.80
findWidgetMethod · 0.80
sizeMethod · 0.45
setCaptionMethod · 0.45
loadMethod · 0.45
hideMethod · 0.45
addItemMethod · 0.45
getItemBoxMethod · 0.45

Tested by

no test coverage detected