Skip to main content
History: QuickGUI FAQ
View published page
Source of version: 3
(current)
{maketoc} !Widgets, who can create what? __Panel__: Able to create all widgets, except for Windows, Sheets, and the TitleBar widget. __Window__: Same as Panel, but automatically creates a TitleBar widget. __Sheet__: Same as Panel, but can create Windows. __GUIManager__: Able to create Sheets. A DefaultSheet is created and available upon manager setup. __List__: Creates MenuLabels. !Widget Sizing and positioning QuickGUI uses Vertical and Horizontal Anchoring to achieve relative position and size. In order to maintain a relative size, you have to anchor left_and_right, as well as top_and_bottom. You can do one, both, left/right/top/bottom only, or none. __One important thing to note is that you have to let the GUIManager know when the viewport has been resized__, because the GUI manager cannot really auto detect that change. !What is an Event, EventHandler, and EventArgs? In ((QuickGUI)), an Event is a defined action that occurs. EventHandlers are user defined functions that are called when a specified Widget receives notification of a specific Event. EventArgs are required as a parameter of EventHandlers, and can provide useful information such as Mouse and Widget information. The following code shows how to retrieve the name of the Button that is clicked: {CODE(wrap="1", colors="c++")}// First, we want to register the event handler to our button. // An Event, Function Pointer, and object instance are required. loginButton->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_BUTTON_UP,&SimpleGUIDemoApp::evtHndlr_login, this); // All EventHandlers must return void, and have EventArgs as the only parameter. // Here is the eventHandler we have defined. void evtHndlr_login(const QuickGUI::EventArgs& args) { }{CODE} EventArgs also form WidgetEventArgs, MouseEventArgs and others. EventArgs come with an enumerated Type field, which denotes which type of EventArgs it is. Using this, we can safely cast the EventArgs into a more useful structure. {CODE(wrap="1", colors="c++")} // Cast EventArgs into WidgetEventArgs. Technically we could cast this to MouseEventArgs, since we // know QuickGUI Mouse Events involve MouseEventArgs. // Or we could just check the EventArgs::type field… const WidgetEventArgs wea = dynamic_cast<const WidgetEventArgs&>(args);{CODE} And just for reference, this is how you can retreive MouseEventArgs: {CODE(wrap="1", colors="c++")} const MouseEventArgs& mouseEventArgs = dynamic_cast<const MouseEventArgs&>(args);{CODE} !Other Important things to know QuickGUI __does not__ support use of materials. In the past, QuickGUI made use of Ogre Overlays, but this is no longer the case. QuickGUI __does__ support Ogre::Texture. Whether procedurally created, render to texture, or via supported Image types, QuickGUI will use these for its rendering of ((Widgets)) and GUI.
Search by Tags
Search Wiki by Freetags
Latest Changes
Projects using OGRE
Building Your Projects With CMake
Compiled API Reference
Overlay Editor
Introduction - JaJDoo Shader Guide - Basics
RT Shader System
RapidXML Dotscene Loader
One Function Ogre
One Function Ogre
...more
Search
Find
Online Users
201 online users
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