void DemoKeeper::destroyScene() { removeRenderBoxes(); destroyWindows(); delete mEditorWindow; mEditorWindow = nullptr; delete mMainPanel; mMainPanel = nullptr; }
void DemoKeeper::destroyScene() { MyGUI::Gui::getInstance().eventFrameStart -= MyGUI::newDelegate(this, &DemoKeeper::notifyFrameStart); removeRenderBoxes(); destroyWindows(); delete mEditorWindow; mEditorWindow = nullptr; delete mMainPanel; mMainPanel = nullptr; }
void DemoKeeper::notifyEventAction(MainPanel::TypeEvents _action, size_t _index) { if (_action == MainPanel::EventQuit) { quit(); } else if (_action == MainPanel::EventNew) { removeRenderBoxes(); destroyWindows(); mEditorWindow->clearView(); } else if (_action == MainPanel::EventLoad) { createWindows(); } else if (_action == MainPanel::EventCreate) { MyGUI::Widget* view = mEditorWindow->getView(); const MyGUI::IntCoord& coord = view->getClientCoord(); if (_index == 0) { const MyGUI::IntSize size(80, 80); MyGUI::Window* window = view->createWidget<MyGUI::Window>(MyGUI::WidgetStyle::Overlapped, "WindowCS", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); window->setCaption("Frame"); window->setMinSize(size); } else if (_index == 1) { const MyGUI::IntSize size(180, 15); MyGUI::ScrollBar* scroll = view->createWidget<MyGUI::ScrollBar>("ScrollBarH", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); scroll->setScrollRange(200); scroll->setScrollPosition(10); scroll->setScrollPage(1); scroll->setScrollViewPage(20); } else if (_index == 2) { const MyGUI::IntSize size(15, 180); MyGUI::ScrollBar* scroll = view->createWidget<MyGUI::ScrollBar>("ScrollBarV", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); scroll->setScrollRange(200); scroll->setScrollPosition(10); scroll->setScrollPage(1); scroll->setScrollViewPage(20); } else if (_index == 3) { const MyGUI::IntSize size(80, 26); MyGUI::TextBox* text = view->createWidget<MyGUI::TextBox>("TextBox", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); text->setCaption("TextBox"); } else if (_index == 4) { const MyGUI::IntSize size(50, 50); MyGUI::ImageBox* image = view->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); image->setImageTexture("HelpIcon.png"); } else if (_index == 5) { const MyGUI::IntSize size(150, 150); MyGUI::Window* window = view->createWidget<MyGUI::Window>(MyGUI::WidgetStyle::Overlapped, "WindowC", MyGUI::IntCoord(getRand(0, coord.width - size.width), getRand(0, coord.height - size.height), size.width, size.height), MyGUI::Align::Default); window->setCaption("Render"); MyGUI::Canvas* canvas = window->createWidget<MyGUI::Canvas>("Canvas", MyGUI::IntCoord(0, 0, window->getClientCoord().width, window->getClientCoord().height), MyGUI::Align::Stretch); createRenderBox(canvas); } } }