本文整理汇总了C++中mygui::Widget::getClientCoord方法的典型用法代码示例。如果您正苦于以下问题:C++ Widget::getClientCoord方法的具体用法?C++ Widget::getClientCoord怎么用?C++ Widget::getClientCoord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mygui::Widget
的用法示例。
在下文中一共展示了Widget::getClientCoord方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: notifyEventAction
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);
}
}
}
示例2: notifyEventAction
void DemoKeeper::notifyEventAction(MainPanel::TypeEvents _action, size_t _index)
{
static MyGUI::IVertexBuffer* vbo = nullptr;
if (_action == MainPanel::EventQuit)
{
if (vbo)
MyGUI::RenderManager::getInstance().destroyVertexBuffer(vbo);
quit();
}
else if (_action == MainPanel::EventNew)
{
//cocos2d::extension::CCNotificationCenter::sharedNotificationCenter()->postNotification(EVENT_COME_TO_BACKGROUND);
//cocos2d::CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND);
//removeRenderBoxes();
//destroyWindows();
//mEditorWindow->clearView();
//MyGUI::Widget *tempWindow = mEditorWindow->getView()->findWidget("tempWindow");
//if (tempWindow)
// MyGUI::Gui::getInstance().destroyWidget(tempWindow);
if (vbo)
{
MyGUI::RenderManager::getInstance().destroyVertexBuffer(vbo);
vbo = nullptr;
}
}
else if (_action == MainPanel::EventLoad)
{
//mEditorWindow->getView()->createWidget<MyGUI::Window>(
// MyGUI::WidgetStyle::Overlapped, "WindowCSX",
// MyGUI::IntCoord(10, 10, 100, 100),
// MyGUI::Align::Default, "", "tempWindow");
if (!vbo)
{
vbo = MyGUI::RenderManager::getInstance().createVertexBuffer();
}
for (unsigned i = 2; i < 2048; i += 4)
{
vbo->setVertexCount(i);
vbo->lock();
vbo->unlock();
}
//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(480, 320);
MyGUI::Window* window = view->createWidget<MyGUI::Window>(MyGUI::WidgetStyle::Overlapped, "WindowCSX", 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);
//.........这里部分代码省略.........