gui::manager Class Reference

Manages the user interface. More...

#include <gui_manager.hpp>

Inheritance diagram for gui::manager:
gui::event_receiver

List of all members.

Public Member Functions

 manager (const input::handler &mInputHandler, const std::string &sLocale, uint uiScreenWidth, uint uiScreenHeight, utils::refptr< manager_impl > pImpl)
 Constructor.
 ~manager ()
 Destructor.
 manager (const manager &mMgr)
 This class is non copiable.
manageroperator= (const manager &mMgr)
 This class is non copiable.
uint get_screen_width () const
 Returns the "screen" width.
uint get_screen_height () const
 Returns the "screen" height.
void add_addon_directory (const std::string &sDirectory)
 Adds a new directory to be parsed for UI addons.
void clear_addon_directory_list ()
 Clears the addon directory list.
bool check_uiobject_name (const std::string &sName) const
 Checks the provided string is suitable for naming a widget.
uiobjectcreate_uiobject (const std::string &sClassName)
 Creates a new uiobject.
framecreate_frame (const std::string &sClassName)
 Creates a new frame.
framecreate_frame (const std::string &sClassName, const std::string &sName, frame *pParent=nullptr, const std::string &sInheritance="")
 Creates a new frame, ready for use.
layered_regioncreate_layered_region (const std::string &sClassName)
 Creates a new layered_region.
utils::refptr< spritecreate_sprite (utils::refptr< material > pMat) const
 Creates a new sprite.
utils::refptr< spritecreate_sprite (utils::refptr< material > pMat, float fWidth, float fHeight) const
 Creates a new sprite.
utils::refptr< spritecreate_sprite (utils::refptr< material > pMat, float fU, float fV, float fWidth, float fHeight) const
 Creates a new sprite.
utils::refptr< materialcreate_material (const std::string &sFileName) const
 Creates a new material from a texture file.
utils::refptr< materialcreate_material (const color &mColor) const
 Creates a new material from a plain color.
utils::refptr< materialcreate_material (utils::refptr< render_target > pRenderTarget) const
 Creates a new material from a render target.
utils::refptr< render_targetcreate_render_target (uint uiWidth, uint uiHeight) const
 Creates a new render target.
utils::refptr< fontcreate_font (const std::string &sFontFile, uint uiSize) const
 Creates a new font.
bool add_uiobject (uiobject *pObj)
 Adds an uiobject to be handled by this manager.
void remove_uiobject (uiobject *pObj)
 Removes an uiobject from this manager.
void notify_object_has_parent (uiobject *pObj)
 Tells this manager that the provided object now has a parent.
const uiobjectget_uiobject (uint uiID) const
 Returns the uiobject associated with the given ID.
uiobjectget_uiobject (uint uiID)
 Returns the uiobject associated with the given ID.
const uiobjectget_uiobject_by_name (const std::string &sName, bool bVirtual=false) const
 Returns the uiobject associated with the given name.
uiobjectget_uiobject_by_name (const std::string &sName, bool bVirtual=false)
 Returns the uiobject associated with the given name.
void fire_build_strata_list ()
 Tells this manager it must rebuild its strata list.
void print_statistics ()
 Prints in the log several performance statistics.
std::string print_ui () const
 Prints debug informations in the log file.
addonget_current_addon ()
 Returns the addon that is being parsed.
void set_current_addon (addon *pAddOn)
 Sets the current addon.
std::string parse_file_name (const std::string &sFileName) const
 Reads a file address and completes it to make a working address.
void set_key_binding (uint uiKey, const std::string &sLuaString)
 Binds some Lua code to a key.
void set_key_binding (uint uiKey, uint uiModifier, const std::string &sLuaString)
 Binds some Lua code to a key.
void set_key_binding (uint uiKey, uint uiModifier1, uint uiModifier2, const std::string &sLuaString)
 Binds some Lua code to a key.
void remove_key_binding (uint uiKey)
 Unbinds a key.
void remove_key_binding (uint uiKey, uint uiModifier)
 Unbinds a key.
void remove_key_binding (uint uiKey, uint uiModifier1, uint uiModifier2)
 Unbinds a key.
utils::wptr< lua::state > get_lua ()
 Returns the GUI Lua state.
void create_lua (std::function< void()> pLuaRegs=nullptr)
 Creates the lua::State that will be used to communicate with the GUI.
void read_files ()
 Reads GUI files in the directory list.
void load_ui ()
 Loads the UI.
void close_ui ()
 Closes the UI, deletes widgets.
void reload_ui ()
 Closes the current UI and load it again.
void render_ui () const
 Renders the UI into the current render target.
void render_quad (const quad &mQuad) const
 Renders a quad.
void render_quads (const quad &mQuad, const std::vector< std::array< vertex, 4 >> &lQuadList) const
 Renders a set of quads.
bool is_loading_ui () const
 Checks if the UI is currently being loaded.
void start_moving (uiobject *pObj, anchor *pAnchor=nullptr, constraint mConstraint=CONSTRAINT_NONE, std::function< void()> pApplyConstraintFunc=nullptr)
 Ask this manager for movement management.
void stop_moving (uiobject *pObj)
 Stops movement for the given object.
bool is_moving (uiobject *pObj) const
 Checks if the given object is allowed to move.
void start_sizing (uiobject *pObj, anchor_point mPoint)
 Starts resizing a widget.
void stop_sizing (uiobject *pObj)
 Stops sizing for the given object.
bool is_sizing (uiobject *pObj) const
 Checks if the given object is allowed to be resized.
int get_movement_x () const
 Returns the cumuled horizontal mouse movement.
int get_movement_y () const
 Returns the cumuled vertical mouse movement.
void notify_object_moved ()
 Tells this manager an object has moved.
void fire_redraw (frame_strata mStrata) const
 Tells this manager to redraw the UI.
void enable_caching (bool bEnable)
 Enables/disables GUI caching.
void toggle_caching ()
 Toggles render caching.
bool is_caching_enabled () const
 Checks if GUI caching is enabled.
void enable_input (bool bEnable)
 Enables/disables input response for all widgets.
void toggle_input ()
 Toggles input response for all widgets.
bool is_input_enabled () const
 Checks if input response is enabled for all widgets.
void clear_fonts_on_close (bool bClear)
 Sets wether the Manager should clear all fonts when closed.
void create_strata_render_target (frame_strata mframe_strata)
 Manually create a strata's render target.
const frameget_overed_frame () const
 Returns the frame under the mouse.
void request_focus (focus_frame *pFocusFrame)
 Asks this manager for focus.
int get_highest_level (frame_strata mframe_strata) const
 Returns the highest level on the provided strata.
void update (float fDelta)
 updates this manager and its widgets.
void on_event (const event &mEvent)
 Called whenever an Event occurs.
void begin (utils::refptr< render_target > pTarget=nullptr) const
 Tells the underlying graphics engine to start rendering into a new target.
void end () const
 Tells the underlying graphics engine we're done rendering.
template<class T >
void register_frame_type (const std::string &sClassName)
 Registers a new frame type.
template<class T >
void register_region_type (const std::string &sClassName)
 Registers a new layered_region type.
utils::wptr< const manager_implget_impl () const
 Returns the implementation dependent manager_impl.
utils::wptr< manager_implget_impl ()
 Returns the implementation dependent manager_impl.
utils::wptr< event_managerget_event_manager ()
 Returns the gui event manager.
utils::wptr< input::managerget_input_manager ()
 Returns the input manager associated to this gui.
const std::string & get_locale () const
 Returns the current game locale ("enGB", ...).

Static Public Member Functions

static managerget_manager (lua::state *pState)
 Returns the gui manager associated to the provided lua::state.

Detailed Description

Manages the user interface.

Definition at line 113 of file gui_manager.hpp.


Constructor & Destructor Documentation

gui::manager::manager ( const input::handler mInputHandler,
const std::string &  sLocale,
uint  uiScreenWidth,
uint  uiScreenHeight,
utils::refptr< manager_impl pImpl 
)

Constructor.

Parameters:
mInputHandler The implementation input handler to use
sLocale The name of the game locale ("enGB", ...)
uiScreenWidth The width of the screen
uiScreenHeight The height of the screen
pImpl The implementation specific class

Definition at line 31 of file gui_manager.cpp.

gui::manager::~manager (  ) 

Destructor.

Definition at line 54 of file gui_manager.cpp.

gui::manager::manager ( const manager mMgr  ) 

This class is non copiable.


Member Function Documentation

void gui::manager::add_addon_directory ( const std::string &  sDirectory  ) 

Adds a new directory to be parsed for UI addons.

Parameters:
sDirectory The new directory

Definition at line 77 of file gui_manager.cpp.

bool gui::manager::add_uiobject ( uiobject pObj  ) 

Adds an uiobject to be handled by this manager.

Parameters:
pObj The object to add
Returns:
'false' if the name of the widget was already taken

Definition at line 293 of file gui_manager.cpp.

void gui::manager::begin ( utils::refptr< render_target pTarget = nullptr  )  const

Tells the underlying graphics engine to start rendering into a new target.

Parameters:
pTarget The target to render to (nullptr to render to the screen)

Definition at line 1647 of file gui_manager.cpp.

bool gui::manager::check_uiobject_name ( const std::string &  sName  )  const

Checks the provided string is suitable for naming a widget.

Parameters:
sName The string to test
Returns:
'true' if the provided string can be the name of a widget

Definition at line 88 of file gui_manager.cpp.

void gui::manager::clear_addon_directory_list (  ) 

Clears the addon directory list.

Note:
This is usefull whenever you need to reload a completely different UI (for example, when switching from your game's main menu to the real game).

Definition at line 83 of file gui_manager.cpp.

void gui::manager::clear_fonts_on_close ( bool  bClear  ) 

Sets wether the Manager should clear all fonts when closed.

Parameters:
bClear 'true' to clear fonts
Note:
Enabled by default. Note that when enabled, it will also clear fonts when the UI is reloaded, and load them once again.

Definition at line 1426 of file gui_manager.cpp.

void gui::manager::close_ui (  ) 

Closes the UI, deletes widgets.

Definition at line 763 of file gui_manager.cpp.

utils::refptr< font > gui::manager::create_font ( const std::string &  sFontFile,
uint  uiSize 
) const

Creates a new font.

Parameters:
sFontFile The file from which to read the font
uiSize The requested size of the characters (in points)
Note:
Even though the gui has been designed to use vector fonts files (such as .ttf or .otf font formats), nothing prevents the implementation from using any other font type, including bitmap fonts.

Definition at line 288 of file gui_manager.cpp.

frame * gui::manager::create_frame ( const std::string &  sClassName,
const std::string &  sName,
frame pParent = nullptr,
const std::string &  sInheritance = "" 
)

Creates a new frame, ready for use.

Parameters:
sClassName The sub class of the frame (Button, ...)
sName The name of this frame
pParent The parent of the created frame (can be nullptr)
sInheritance The name of the frame that should be inherited (empty if none)
Returns:
The new frame
Note:
You don't have the responsability to detroy the created frame, it will be done automatically, either by its parent or by this manager.
This function takes care of the basic initializing : the frame is directly usable.

Definition at line 161 of file gui_manager.cpp.

frame * gui::manager::create_frame ( const std::string &  sClassName  ) 

Creates a new frame.

Parameters:
sClassName The sub class of the frame (Button, ...)
Returns:
The new frame
Note:
You have the responsability to detroy and initialize the created frame by yourself.

Definition at line 144 of file gui_manager.cpp.

layered_region * gui::manager::create_layered_region ( const std::string &  sClassName  ) 

Creates a new layered_region.

Parameters:
sClassName The sub class of the layered_region (FontString or texture)
Returns:
The new layered_region
Note:
You have the responsability to detroy and initialize the created layered_region by yourself.

Definition at line 230 of file gui_manager.cpp.

void gui::manager::create_lua ( std::function< void()>  pLuaRegs = nullptr  ) 

Creates the lua::State that will be used to communicate with the GUI.

Parameters:
pLuaRegs Some code that will get exectued each time the lua state is created
Note:
This function is usefull if you need to create additionnal resources on the lua::State before the GUI files are loaded. You need to do this inside the provided argument function, because this code will need to be called again in case the GUI is reloaded (see reload_ui()). Else, you can simply use load_ui().

Definition at line 699 of file gui_manager.cpp.

utils::refptr< material > gui::manager::create_material ( utils::refptr< render_target pRenderTarget  )  const

Creates a new material from a render target.

Parameters:
pRenderTarget The render target from which to read the pixels
Returns:
The new material

Definition at line 278 of file gui_manager.cpp.

utils::refptr< material > gui::manager::create_material ( const color mColor  )  const

Creates a new material from a plain color.

Parameters:
mColor The color to use
Returns:
The new material

Definition at line 273 of file gui_manager.cpp.

utils::refptr< material > gui::manager::create_material ( const std::string &  sFileName  )  const

Creates a new material from a texture file.

Parameters:
sFileName The name of the file
Returns:
The new material
Note:
Supported texture formats are defined by implementation. The gui library is completely unaware of this.

Definition at line 268 of file gui_manager.cpp.

utils::refptr< render_target > gui::manager::create_render_target ( uint  uiWidth,
uint  uiHeight 
) const

Creates a new render target.

Parameters:
uiWidth The width of the render target
uiHeight The height of the render target

Definition at line 283 of file gui_manager.cpp.

utils::refptr< sprite > gui::manager::create_sprite ( utils::refptr< material pMat,
float  fU,
float  fV,
float  fWidth,
float  fHeight 
) const

Creates a new sprite.

Parameters:
pMat The material with which to create the sprite
fU The top left corner of the sprite in the material
fV The top left corner of the sprite in the material
fWidth The width of the sprite
fHeight The height of the sprite
Note:
If the width and height you provide are smaller than the texture's ones, the texture will be cut on the right and bottom edges.
However, if they are larger than the texture's one, the texture will be tiled.
Returns:
The new sprite

Definition at line 258 of file gui_manager.cpp.

utils::refptr< sprite > gui::manager::create_sprite ( utils::refptr< material pMat,
float  fWidth,
float  fHeight 
) const

Creates a new sprite.

Parameters:
pMat The material with which to create the sprite
fWidth The width of the sprite
fHeight The height of the sprite
Note:
If the width and height you provide are smaller than the texture's ones, the texture will be cut on the right and bottom edges.
However, if they are larger than the texture's one, the texture will be tiled.
Returns:
The new sprite

Definition at line 249 of file gui_manager.cpp.

utils::refptr< sprite > gui::manager::create_sprite ( utils::refptr< material pMat  )  const

Creates a new sprite.

Parameters:
pMat The material with which to create the sprite
Returns:
The new sprite

Definition at line 240 of file gui_manager.cpp.

void gui::manager::create_strata_render_target ( frame_strata  mframe_strata  ) 

Manually create a strata's render target.

Parameters:
mframe_strata The strata to create the render target for
Note:
Creating a render target can take some times. To avoid GUI hangs during creation, the manager automatically creates the render targets when read_files() is called, but only for strata that already contain frames when all .xml files are loaded. Other ones are created when needed, just before rendering on them. If you know that one of them is empty at load time, and is going to be filled later during run time, you can call this function to ensure the render target will be created at load time, causing no GUI hangs.

Definition at line 897 of file gui_manager.cpp.

uiobject * gui::manager::create_uiobject ( const std::string &  sClassName  ) 

Creates a new uiobject.

Parameters:
sClassName The class of the uiobject (Frame, fontString, Button, ...)
Returns:
The new uiobject
Note:
You have the responsability to detroy and initialize the created uiobject by yourself.

Definition at line 123 of file gui_manager.cpp.

void gui::manager::enable_caching ( bool  bEnable  ) 

Enables/disables GUI caching.

Parameters:
bEnable 'true' to enable
Note:
See toggle_caching().

Definition at line 1384 of file gui_manager.cpp.

void gui::manager::enable_input ( bool  bEnable  ) 

Enables/disables input response for all widgets.

bEnable 'true' to enable input

Note:
See toggle_input() and is_input_enabled().

Definition at line 1395 of file gui_manager.cpp.

void gui::manager::end (  )  const

Tells the underlying graphics engine we're done rendering.

Note:
For most engines, this is when the rendering is actually done, so don't forget to call it !

Definition at line 1652 of file gui_manager.cpp.

void gui::manager::fire_build_strata_list (  ) 

Tells this manager it must rebuild its strata list.

Definition at line 977 of file gui_manager.cpp.

void gui::manager::fire_redraw ( frame_strata  mStrata  )  const

Tells this manager to redraw the UI.

Definition at line 1365 of file gui_manager.cpp.

addon * gui::manager::get_current_addon (  ) 

Returns the addon that is being parsed.

Returns:
The addon that is being parsed

Definition at line 1555 of file gui_manager.cpp.

utils::wptr< event_manager > gui::manager::get_event_manager (  ) 

Returns the gui event manager.

Returns:
The gui event manager

Definition at line 1711 of file gui_manager.cpp.

int gui::manager::get_highest_level ( frame_strata  mframe_strata  )  const

Returns the highest level on the provided strata.

Parameters:
mframe_strata The strata to inspect
Returns:
The highest level on the provided strata

Definition at line 1539 of file gui_manager.cpp.

utils::wptr< manager_impl > gui::manager::get_impl (  ) 

Returns the implementation dependent manager_impl.

Returns:
The implementation dependent manager_impl

Definition at line 62 of file gui_manager.cpp.

utils::wptr<const manager_impl> gui::manager::get_impl (  )  const

Returns the implementation dependent manager_impl.

Returns:
The implementation dependent manager_impl
utils::wptr< input::manager > gui::manager::get_input_manager (  ) 

Returns the input manager associated to this gui.

Returns:
The input manager associated to this gui

Definition at line 1716 of file gui_manager.cpp.

const std::string & gui::manager::get_locale (  )  const

Returns the current game locale ("enGB", ...).

Returns:
The current game locale

Definition at line 1721 of file gui_manager.cpp.

utils::wptr< lua::state > gui::manager::get_lua (  ) 

Returns the GUI Lua state.

Returns:
The GUI Lua state

Definition at line 469 of file gui_manager.cpp.

manager * gui::manager::get_manager ( lua::state *  pState  )  [static]

Returns the gui manager associated to the provided lua::state.

Parameters:
pState The lua::state

Definition at line 49 of file gui_manager_glues.cpp.

int gui::manager::get_movement_x (  )  const

Returns the cumuled horizontal mouse movement.

Returns:
The cumuled horizontal mouse movement
Note:
This value is reset to zero whenever start_moving() or start_sizing() is called.

Definition at line 1350 of file gui_manager.cpp.

int gui::manager::get_movement_y (  )  const

Returns the cumuled vertical mouse movement.

Returns:
The cumuled vertical mouse movement
Note:
This value is reset to zero whenever start_moving() or start_sizing() is called.

Definition at line 1355 of file gui_manager.cpp.

const frame * gui::manager::get_overed_frame (  )  const

Returns the frame under the mouse.

Returns:
The frame under the mouse (nullptr if none)

Definition at line 1431 of file gui_manager.cpp.

uint gui::manager::get_screen_height (  )  const

Returns the "screen" height.

Returns:
The screen height
Note:
This is not necessarily the real screen height. If the GUI is rendered into a small render target that takes only a portion of the real screen, then this function returns the height of the render target.

Definition at line 72 of file gui_manager.cpp.

uint gui::manager::get_screen_width (  )  const

Returns the "screen" width.

Returns:
The screen width
Note:
This is not necessarily the real screen width. If the GUI is rendered into a small render target that takes only a portion of the real screen, then this function returns the width of the render target.

Definition at line 67 of file gui_manager.cpp.

uiobject * gui::manager::get_uiobject ( uint  uiID  ) 

Returns the uiobject associated with the given ID.

Parameters:
uiID The unique ID representing the widget
Returns:
The uiobject associated with the given ID

Definition at line 420 of file gui_manager.cpp.

const uiobject * gui::manager::get_uiobject ( uint  uiID  )  const

Returns the uiobject associated with the given ID.

Parameters:
uiID The unique ID representing the widget
Returns:
The uiobject associated with the given ID

Definition at line 411 of file gui_manager.cpp.

uiobject * gui::manager::get_uiobject_by_name ( const std::string &  sName,
bool  bVirtual = false 
)

Returns the uiobject associated with the given name.

Parameters:
sName The name of the widget you're after
bVirtual 'true' to search for a virtual frame
Returns:
The uiobject associated with the given name

Definition at line 449 of file gui_manager.cpp.

const uiobject * gui::manager::get_uiobject_by_name ( const std::string &  sName,
bool  bVirtual = false 
) const

Returns the uiobject associated with the given name.

Parameters:
sName The name of the widget you're after
bVirtual 'true' to search for a virtual frame
Returns:
The uiobject associated with the given name

Definition at line 429 of file gui_manager.cpp.

bool gui::manager::is_caching_enabled (  )  const

Checks if GUI caching is enabled.

Returns:
'true' if GUI caching is enabled

Definition at line 1390 of file gui_manager.cpp.

bool gui::manager::is_input_enabled (  )  const

Checks if input response is enabled for all widgets.

Returns:
'true' if input response is enabled
Note:
All widgets must call this function and check its return value before reacting to input events.
See toggle_input().

Definition at line 1421 of file gui_manager.cpp.

bool gui::manager::is_loading_ui (  )  const

Checks if the UI is currently being loaded.

Returns:
'true' if the UI is currently being loaded

Definition at line 972 of file gui_manager.cpp.

bool gui::manager::is_moving ( uiobject pObj  )  const

Checks if the given object is allowed to move.

Parameters:
pObj The object to check
Returns:
'true' if the given object is allowed to move

Definition at line 1255 of file gui_manager.cpp.

bool gui::manager::is_sizing ( uiobject pObj  )  const

Checks if the given object is allowed to be resized.

Parameters:
pObj The object to check
Returns:
'true' if the given object is allowed to be resized

Definition at line 1345 of file gui_manager.cpp.

void gui::manager::load_ui (  ) 

Loads the UI.

Note:
Calls create_lua() then read_files().

Definition at line 757 of file gui_manager.cpp.

void gui::manager::notify_object_has_parent ( uiobject pObj  ) 

Tells this manager that the provided object now has a parent.

Parameters:
pObj The object that has recently been given a parent
Note:
When the GUI closes, the manager deletes all objects that have no parents first, which then delete all their children. This function is just here to prevent double deleting of widgets that once were orphans.

Definition at line 406 of file gui_manager.cpp.

void gui::manager::notify_object_moved (  ) 

Tells this manager an object has moved.

Definition at line 1360 of file gui_manager.cpp.

void gui::manager::on_event ( const event mEvent  )  [virtual]

Called whenever an Event occurs.

Parameters:
mEvent The Event which has occured

Implements gui::event_receiver.

Definition at line 1578 of file gui_manager.cpp.

manager& gui::manager::operator= ( const manager mMgr  ) 

This class is non copiable.

std::string gui::manager::parse_file_name ( const std::string &  sFileName  )  const

Reads a file address and completes it to make a working address.

Parameters:
sFileName The raw file name
Returns:
The modified file name
Note:
All file names are relative to the Engine's executable path, but sometimes you'd like to use a path that is relative to your addon directory for example. To do so, you need to append "|" in front of your file name.

Definition at line 1565 of file gui_manager.cpp.

void gui::manager::print_statistics (  ) 

Prints in the log several performance statistics.

Definition at line 1657 of file gui_manager.cpp.

std::string gui::manager::print_ui (  )  const

Prints debug informations in the log file.

Note:
Calls uiobject::serialize().

Definition at line 1670 of file gui_manager.cpp.

void gui::manager::read_files (  ) 

Reads GUI files in the directory list.

Note:
See add_addon_directory().
See load_ui().
See create_lua().

Definition at line 725 of file gui_manager.cpp.

template<class T >
void gui::manager::register_frame_type ( const std::string &  sClassName  )  [inline]

Registers a new frame type.

Parameters:
sClassName The name of the new type (as see in XML files)
Note:
Use as template argument the C++ type of this frame.

Definition at line 649 of file gui_manager.hpp.

template<class T >
void gui::manager::register_region_type ( const std::string &  sClassName  )  [inline]

Registers a new layered_region type.

Parameters:
sClassName The name of the new type (as see in XML files)
Note:
Use as template argument the C++ type of this layered_region.

Definition at line 660 of file gui_manager.hpp.

void gui::manager::reload_ui (  ) 

Closes the current UI and load it again.

Note:
Calls close_ui() then load_ui().

Definition at line 840 of file gui_manager.cpp.

void gui::manager::remove_key_binding ( uint  uiKey,
uint  uiModifier1,
uint  uiModifier2 
)

Unbinds a key.

Parameters:
uiKey The key to unbind
uiModifier1 The first modifier key (shift, ctrl, ...)
uiModifier2 The second modifier key (shift, ctrl, ...)

Definition at line 1516 of file gui_manager.cpp.

void gui::manager::remove_key_binding ( uint  uiKey,
uint  uiModifier 
)

Unbinds a key.

Parameters:
uiKey The key to unbind
uiModifier The modifier key (shift, ctrl, ...)

Definition at line 1493 of file gui_manager.cpp.

void gui::manager::remove_key_binding ( uint  uiKey  ) 

Unbinds a key.

Parameters:
uiKey The key to unbind

Definition at line 1470 of file gui_manager.cpp.

void gui::manager::remove_uiobject ( uiobject pObj  ) 

Removes an uiobject from this manager.

Parameters:
pObj The object to remove
Note:
Only call this function if you have to delete an object manually (instead of waiting for the UI to close).

Definition at line 365 of file gui_manager.cpp.

void gui::manager::render_quad ( const quad mQuad  )  const

Renders a quad.

Parameters:
mQuad The quad to render on the current render target
Note:
This function is meant to be called between begin() and end() only.

Definition at line 887 of file gui_manager.cpp.

void gui::manager::render_quads ( const quad mQuad,
const std::vector< std::array< vertex, 4 >> &  lQuadList 
) const

Renders a set of quads.

Parameters:
mQuad The base quad to use for rendering (material, blending, ...)
lQuadList The list of the quads you want to render
Note:
This function is meant to be called between begin() and end() only. It is always more efficient to call this method than calling render_quad repeatedly, as it allows to batch count reduction.

Definition at line 892 of file gui_manager.cpp.

void gui::manager::render_ui (  )  const

Renders the UI into the current render target.

Definition at line 849 of file gui_manager.cpp.

void gui::manager::request_focus ( focus_frame pFocusFrame  ) 

Asks this manager for focus.

Parameters:
pFocusFrame The focus_frame requesting focus

Definition at line 1436 of file gui_manager.cpp.

void gui::manager::set_current_addon ( addon pAddOn  ) 

Sets the current addon.

Parameters:
pAddOn The current addon
Note:
The current addon is used when parsing file names. See parse_file_name() for more information. For uiobjects that are created manually after the loading stage, one needs to specify the addon that is actually creating the widget, and that is the purpose of this method. It is called by frame automatically, before each call to handler functions.

Definition at line 1560 of file gui_manager.cpp.

void gui::manager::set_key_binding ( uint  uiKey,
uint  uiModifier1,
uint  uiModifier2,
const std::string &  sLuaString 
)

Binds some Lua code to a key.

Parameters:
uiKey The key to bind
uiModifier1 The first modifier key (shift, ctrl, ...)
uiModifier2 The second modifier key (shift, ctrl, ...)
sLuaString The Lua code that will be executed

Definition at line 1465 of file gui_manager.cpp.

void gui::manager::set_key_binding ( uint  uiKey,
uint  uiModifier,
const std::string &  sLuaString 
)

Binds some Lua code to a key.

Parameters:
uiKey The key to bind
uiModifier The modifier key (shift, ctrl, ...)
sLuaString The Lua code that will be executed

Definition at line 1460 of file gui_manager.cpp.

void gui::manager::set_key_binding ( uint  uiKey,
const std::string &  sLuaString 
)

Binds some Lua code to a key.

Parameters:
uiKey The key to bind
sLuaString The Lua code that will be executed

Definition at line 1455 of file gui_manager.cpp.

void gui::manager::start_moving ( uiobject pObj,
anchor pAnchor = nullptr,
constraint  mConstraint = CONSTRAINT_NONE,
std::function< void()>  pApplyConstraintFunc = nullptr 
)

Ask this manager for movement management.

Parameters:
pObj The object to move
pAnchor The reference anchor
mConstraint The constraint axis if any
Note:
Movement is handled by the manager itself, you don't need to do anything.

Definition at line 1213 of file gui_manager.cpp.

void gui::manager::start_sizing ( uiobject pObj,
anchor_point  mPoint 
)

Starts resizing a widget.

Parameters:
pObj The object to resize
mPoint The sizing point
Note:
Resizing is handled by the manager itself, you don't need to do anything.

Definition at line 1260 of file gui_manager.cpp.

void gui::manager::stop_moving ( uiobject pObj  ) 

Stops movement for the given object.

Parameters:
pObj The object to stop moving

Definition at line 1246 of file gui_manager.cpp.

void gui::manager::stop_sizing ( uiobject pObj  ) 

Stops sizing for the given object.

Parameters:
pObj The object to stop sizing

Definition at line 1339 of file gui_manager.cpp.

void gui::manager::toggle_caching (  ) 

Toggles render caching.

Note:
Enabled by default.
Enabling this will most likely improve performances.

Definition at line 1372 of file gui_manager.cpp.

void gui::manager::toggle_input (  ) 

Toggles input response for all widgets.

Note:
Enabled by default.
See is_input_enabled().

Definition at line 1401 of file gui_manager.cpp.

void gui::manager::update ( float  fDelta  ) 

updates this manager and its widgets.

Parameters:
fDelta The time elapsed since the last call

Definition at line 982 of file gui_manager.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Tue Jan 1 21:58:12 2013 for gui by  doxygen 1.6.1