Cafu Engine
cf::GuiSys::GuiManImplT Class Reference

This class implements a GUI manager. More...

#include "GuiManImpl.hpp"

Public Member Functions

 GuiManImplT (GuiResourcesT &GuiRes)
 The constructor. More...
 
IntrusivePtrT< GuiImplTRegister (const std::string &GuiScriptName)
 Creates a GUI from the script with name GuiScriptName and registers it with the GUI manager. More...
 
IntrusivePtrT< GuiImplTRegister (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< GuiImplTFind (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< GuiImplTGetTopmostActiveAndInteractive ()
 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...
 

Detailed Description

This class implements a GUI manager.

Constructor & Destructor Documentation

GuiManImplT::GuiManImplT ( GuiResourcesT GuiRes)

The constructor.

The MatSys must be initialized before this constructor is called (i.e. a GuiManImplT is instantiated)!

Member Function Documentation

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.

Parameters
tThe 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.

Parameters
GuiScriptNameThe filename of the GUI script to search for.
AutoRegisterWhether 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.

Parameters
KEKeyboard 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.

Parameters
MEMouse 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.


The documentation for this class was generated from the following files: