This class implements a GUI manager. More...
#include "GuiManImpl.hpp"
Public Member Functions | |
GuiManImplT (GuiResourcesT &GuiRes) | |
The constructor. More... | |
IntrusivePtrT< GuiImplT > | Register (const std::string &GuiScriptName) |
Creates a GUI from the script with name GuiScriptName and registers it with the GUI manager. More... | |
IntrusivePtrT< GuiImplT > | Register (IntrusivePtrT< GuiImplT > NewGui) |
Registers a programmatically instantiated GUI with the GUI manager. More... | |
void | Free (IntrusivePtrT< GuiImplT > Gui) |
Removes the Gui from the GUI manager. More... | |
IntrusivePtrT< GuiImplT > | Find (const std::string &GuiScriptName, bool AutoRegister=false) |
Searches the GUI manager for a GUI whose script name is GuiScriptName. More... | |
void | BringToFront (IntrusivePtrT< GuiImplT > Gui) |
Makes sure that if multiple GUIs are active, Gui is the topmost one. More... | |
IntrusivePtrT< GuiImplT > | GetTopmostActiveAndInteractive () |
Returns the top-most GUI that is both active and interactive. More... | |
void | ReloadAllGuis () |
Reloads all registered GUIs. More... | |
void | RenderAll () |
Renders all the GUIs. More... | |
void | ProcessDeviceEvent (const CaKeyboardEventT &KE) |
Processes a keyboard event from the device that this GuiMan is running under, sending it to the top-most GUI that is both active and interactive. More... | |
void | ProcessDeviceEvent (const CaMouseEventT &ME) |
Processes a mouse event from the device that this GuiMan is running under, sending it to the top-most GUI that is both active and interactive. More... | |
void | DistributeClockTickEvents (float t) |
"Creates" a time tick event for each window of each active GUI by calling its OnTimeTickEvent() methods. More... | |
This class implements a GUI manager.
GuiManImplT::GuiManImplT | ( | GuiResourcesT & | GuiRes | ) |
The constructor.
The MatSys must be initialized before this constructor is called (i.e. a GuiManImplT is instantiated)!
void GuiManImplT::BringToFront | ( | IntrusivePtrT< GuiImplT > | Gui | ) |
Makes sure that if multiple GUIs are active, Gui is the topmost one.
void GuiManImplT::DistributeClockTickEvents | ( | float | t | ) |
"Creates" a time tick event for each window of each active GUI by calling its OnTimeTickEvent() methods.
Note that inactive GUIs do not get the time tick event, but active GUIs who get them usually pass them to all their (sub-)windows, even if that part of the window(-hierarchy) is currently invisible.
t | The time in seconds since the last clock-tick. |
IntrusivePtrT< GuiImplT > GuiManImplT::Find | ( | const std::string & | GuiScriptName, |
bool | AutoRegister = false |
||
) |
Searches the GUI manager for a GUI whose script name is GuiScriptName.
If the GUI was found, the pointer to the GuiImplT instance is returned. Otherwise (GUI not found), Register() is called and its result returned if AutoRegister was true, NULL is returned if AutoRegister was false.
GuiScriptName | The filename of the GUI script to search for. |
AutoRegister | Whether the script should be registered with this GUI manager if it is not found. |
void GuiManImplT::Free | ( | IntrusivePtrT< GuiImplT > | Gui | ) |
Removes the Gui from the GUI manager.
IntrusivePtrT< GuiImplT > GuiManImplT::GetTopmostActiveAndInteractive | ( | ) |
Returns the top-most GUI that is both active and interactive.
NULL is returned if no such GUI exists.
void GuiManImplT::ProcessDeviceEvent | ( | const CaKeyboardEventT & | KE | ) |
Processes a keyboard event from the device that this GuiMan is running under, sending it to the top-most GUI that is both active and interactive.
KE | Keyboard event to process. |
void GuiManImplT::ProcessDeviceEvent | ( | const CaMouseEventT & | ME | ) |
Processes a mouse event from the device that this GuiMan is running under, sending it to the top-most GUI that is both active and interactive.
ME | Mouse event to process. |
IntrusivePtrT< GuiImplT > GuiManImplT::Register | ( | const std::string & | GuiScriptName | ) |
Creates a GUI from the script with name GuiScriptName and registers it with the GUI manager.
IntrusivePtrT< GuiImplT > GuiManImplT::Register | ( | IntrusivePtrT< GuiImplT > | NewGui | ) |
Registers a programmatically instantiated GUI with the GUI manager.
void GuiManImplT::ReloadAllGuis | ( | ) |
Reloads all registered GUIs.
void GuiManImplT::RenderAll | ( | ) |
Renders all the GUIs.