OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: MyGUI widget control
View page
Source of version: 6
(current)
!!Create !!!Manually To create a widget without a parent: {CODE(wrap="1",colors="cpp",wiki="1")} MyGUI::Gui::getInstance().createWidget<MyGUI::__widget_type__>("__skin_name__", __x__, __y__, __w__, __h__, MyGUI::__Align__, "__layer_name__"['', "__widget_name__"'']); MyGUI::Gui::getInstance().createWidgetReal<MyGUI::__widget_type__>("__skin_name__", __x_r__, __y_r__, __w_r__, __h_r__, MyGUI::__Align__, "__layer_name__"['', "__widget_name__"'']);{CODE} To create a child widget: {CODE(wrap="1",colors="cpp",wiki="1")} parent_ptr->createWidget<MyGUI::__widget_type__>("__skin_name__", __x__, __y__, __w__, __h__, MyGUI::__Align__ ['', "__widget_name__"'']); parent_ptr->createWidgetReal<MyGUI::__widget_type__>("__skin_name__", __x_r__, __y_r__, __w_r__, __h_r__, MyGUI::__Align__ ['', "__widget_name__"'']);{CODE} Possible __widget_type__ values can be found at the ((MyGUI|__MyGUI main page__)). __skin_name__ can be the same as the widget or any skin from the ((MyGUI|__MyGUI main page__)). __x__, __y__, __w__, __h__ is the widget position, width, and height in pixels. __x_r__, __y_r__, __w_r__, __h_r__ is the widget position width and height relative to its parent (or the screen, if it doesn't have a parent) in coordinates from 0 to 1. Possible __align__ values can be found in the ((MyGUI align table|__align table__)). All __layer_name__s can be found in the ((MyGUI layers|standard layers)). __widget_name__ is an optional parameter. !!Find To find a widget (for example a Button) {CODE(wrap="1",colors="cpp",wiki="1")} MyGUI::Button* button = MyGUI::Gui::getInstance().findWidget<MyGUI::Button>("button_name");{CODE} If you don't care about the widget type, you can write: {CODE(wrap="1",colors="cpp",wiki="1")}MyGUI::Widget* any_widget = MyGUI::Gui::getInstance().findWidget__T__("widget_name");{CODE} !!Destroy To destroy widgets you need to have pointers to them of the form (__widget_ptr__). Then write {CODE(wrap="1",colors="cpp",wiki="1")}MyGUI::Gui::getInstance().destroyWidget(__widget_ptr__);{CODE} If you don't have a pointer to your widget, you should get it by searching for it by name. {CODE(wrap="1",colors="cpp",wiki="1")}MyGUI::Widget* widget = MyGUI::Gui::getInstance().findWidgetT("widget_name"); MyGUI::Gui::getInstance().destroyWidget(widget);{CODE}
Search by Tags
Search Wiki by Freetags
Latest Changes
IDE Eclipse
FMOD SoundManager
HDRlib
Building Ogre V2 with CMake
Ogre 2.1 FAQ
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
...more
Search
Find
Advanced
Search Help
Online Users
142 online users