gui::frame Class Reference

GUI container. More...

#include <gui_frame.hpp>

Inheritance diagram for gui::frame:
gui::event_receiver gui::region gui::uiobject gui::button gui::focus_frame gui::scroll_frame gui::slider gui::status_bar gui::check_button gui::edit_box

List of all members.

Classes

struct  script_info

Public Types

typedef std::function< void(frame
*, event *) 
handler )

Public Member Functions

 frame (manager *pManager)
 Constructor.
virtual ~frame ()
 Destructor.
virtual void render ()
 Renders this widget on the current render target.
virtual void update (float fDelta)
 updates this widget's logic.
virtual std::string serialize (const std::string &sTab) const
 Prints all relevant information about this widget in a string.
virtual bool can_use_script (const std::string &sScriptName) const
 Returns 'true' if this frame can use a script.
void check_position () const
 Checks if this frame's position is valid.
virtual void copy_from (uiobject *pObj)
 Copies an uiobject's parameters into this frame (inheritance).
void create_title_region ()
 Creates a new title region for this frame.
void disable_draw_layer (layer_type mLayerID)
 Disables a layer.
void enable_draw_layer (layer_type mLayerID)
 Enables a layer.
virtual void enable_keyboard (bool bIsKeyboardEnabled)
 Sets if this frame can receive keyboard input.
virtual void enable_mouse (bool bIsMouseEnabled, bool bAllowWorldInput=false)
 Sets if this frame can receive mouse input.
virtual void enable_mouse_wheel (bool bIsMouseWheelEnabled)
 Sets if this frame can receive mouse wheel input.
bool has_script (const std::string &sScriptName) const
 Checks if this frame has a script defined.
void add_region (layered_region *pRegion)
 Adds a layered_region to this frame's children.
void remove_region (layered_region *pRegion)
 Removes a layered_region from this frame's children.
layered_regioncreate_region (layer_type mLayer, const std::string &sClassName, const std::string &sName, const std::string &sInheritance="")
 Creates a new region as child of this frame.
framecreate_child (const std::string &sClassName, const std::string &sName, const std::string &sInheritance="")
 Creates a new frame as child of this frame.
void add_child (frame *pChild)
 Adds a frame to this frame's children.
void remove_child (frame *pChild)
 Removes a frame from this frame's children.
const std::map< uint, frame * > & get_children () const
 Returns the child list.
frameget_child (const std::string &sName) const
 Returns one of this frame's children.
layered_regionget_region (const std::string &sName) const
 Returns one of this frame's region.
float get_effective_alpha () const
 Calculates effective alpha.
float get_effective_scale () const
 Calculates effective scale.
int get_frame_level () const
 Returns this frame's level.
frame_strata get_frame_strata () const
 Returns this frame's strata.
utils::wptr< backdropget_backdrop () const
 Returns this frame's backdrop.
const std::string & get_frame_type () const
 Returns this frame's type.
const std::array< int, 4 > & get_abs_hit_rect_insets () const
 Returns this frame's absolute hit rect insets.
const std::array< float, 4 > & get_rel_hit_rect_insets () const
 Returns this frame's relative hit rect insets.
std::array< uint, 2 > get_max_resize () const
 Returns this frame's max dimensions.
std::array< uint, 2 > get_min_resize () const
 Returns this frame's min dimensions.
uint get_num_children () const
 Returns the number of children of this frame.
uint get_num_regions () const
 Returns the number of region of this frame.
float get_scale () const
 Returns this frame's scale.
regionget_title_region () const
 Returns this frame's title region.
bool is_clamped_to_screen () const
 Checks if this frame is clamped to screen.
virtual bool is_in_frame (int iX, int iY) const
 Checks if the provided coordinates are in the frame.
bool is_keyboard_enabled () const
 Checks if this frame can receive keyboard input.
bool is_mouse_enabled () const
 Checks if this frame can receive mouse input.
bool is_world_input_allowed () const
 Checks if this frame allows world input.
bool is_mouse_wheel_enabled () const
 Checks if this frame can receive mouse wheel input.
bool is_movable () const
 Checks if this frame can be moved.
bool is_resizable () const
 Checks if this frame can be resized.
bool is_top_level () const
 Checks if this frame is at top level.
bool is_user_placed () const
 Checks if this frame has been moved by the user.
void define_script (const std::string &sScriptName, const std::string &sContent, const std::string &sFile, uint uiLineNbr)
 Registers a handler script to this frame.
void define_script (const std::string &sScriptName, handler mHandler)
 Registers a handler script to this frame.
void notify_script_defined (const std::string &sScriptName, bool bDefined)
 Tells this frame that a script has been defined.
virtual void on (const std::string &sScriptName, event *pEvent=nullptr)
 Calls a script.
virtual void on_event (const event &mEvent)
 Calls the on_event script.
void register_all_events ()
 Tells this frame to react to every event in the game.
void register_event (const std::string &sEventName)
 Tells this frame to react to a certain event.
void register_for_drag (const std::vector< std::string > &lButtonList)
 Tells this frame to react to mouse drag.
void set_clamped_to_screen (bool bIsClampedToScreen)
 Sets if this frame is clamped to screen.
void set_frame_strata (frame_strata mStrata)
 Sets this frame's strata.
void set_frame_strata (const std::string &sStrata)
 Sets this frame's strata.
void set_backdrop (utils::refptr< backdrop > pBackdrop)
 Sets this frames' backdrop.
void set_abs_hit_rect_insets (int iLeft, int iRight, int iTop, int iBottom)
 Sets this frame's absolute hit rect insets.
void set_rel_hit_rect_insets (float fLeft, float fRight, float fTop, float fBottom)
 Sets this frame's relative hit rect insets.
void set_level (int iLevel)
 Sets this frame's level.
void set_max_resize (uint uiMaxWidth, uint uiMaxHeight)
 set_ this frame's maximum size.
void set_min_resize (uint uiMinWidth, uint uiMinHeight)
 set_ this frame's minimum size.
void set_max_height (uint uiMaxHeight)
 set_ this frame's maximum height.
void set_max_width (uint uiMaxWidth)
 set_ this frame's maximum width.
void set_min_height (uint uiMinHeight)
 set_ this frame's minimum height.
void set_min_width (uint uiMinWidth)
 set_ this frame's minimum width.
void set_movable (bool bIsMovable)
 Sets if this frame can be moved by the user.
void set_parent (uiobject *pParent)
 Changes this widget's parent.
void set_resizable (bool bIsResizable)
 Sets if this frame can be resized by the user.
void set_scale (float fScale)
 Sets this frame's scale.
void set_top_level (bool bIsTopLevel)
 Sets if this frame is at top level.
void raise ()
 Increases this frame's level so it's the highest of the strata.
void set_user_placed (bool bIsUserPlaced)
 Sets if this frame has been moved by the user.
void start_moving ()
 Starts moving this frame with the mouse.
void stop_moving ()
 ends moving this frame.
void start_sizing (const anchor_point &mPoint)
 Starts resizing this frame with the mouse.
void stop_sizing ()
 ends resizing this frame.
virtual void show ()
 shows this widget.
virtual void hide ()
 hides this widget.
virtual void set_shown (bool bIsShown)
 shows/hides this widget.
virtual void set_manually_rendered (bool bManuallyRendered, uiobject *pRenderer=nullptr)
 Flags this object as "manually rendered".
virtual void set_abs_width (uint uiAbsWidth)
 Changes this widget's absolute width (in pixels).
virtual void set_abs_height (uint uiAbsHeight)
 Changes this widget's absolute height (in pixels).
virtual void notify_mouse_in_frame (bool bMouseInFrame, int iX, int iY)
 Tells this frame it is being overed by the mouse.
virtual void notify_child_strata_changed (frame *pChild)
 Tells this frame that at least one of its children has modified its strata or level.
virtual void notify_renderer_need_redraw () const
 Notifies the renderer of this widget that it needs to be redrawn.
virtual void notify_loaded ()
 Notifies this widget that it has been fully loaded.
void fire_build_layer_list ()
 Tells this frame to rebuilt the layer list.
void unregister_all_events ()
 Tells the frame not to react to all events.
void unregister_event (const std::string &sEventName)
 Tells the frame not to react to a certain event.
void set_addon (addon *pAddOn)
 Sets the addon this frame belongs to.
addonget_addon () const
 Returns this frame's addon.
virtual std::vector< uiobject * > clear_links ()
 Removes all anchors that point to this widget and all other kind of links.
virtual void create_glue ()
 Creates the associated Lua glue.
virtual void parse_block (xml::block *pBlock)
 Parses data from an xml::block.

Protected Member Functions

virtual void parse_attributes_ (xml::block *pBlock)
virtual void parse_resize_bounds_block_ (xml::block *pBlock)
virtual void parse_title_region_block_ (xml::block *pBlock)
virtual void parse_backdrop_block_ (xml::block *pBlock)
virtual void parse_hit_rect_insets_block_ (xml::block *pBlock)
virtual void parse_layers_block_ (xml::block *pBlock)
virtual void parse_frames_block_ (xml::block *pBlock)
virtual void parse_scripts_block_ (xml::block *pBlock)
virtual void notify_visible_ (bool bTriggerEvents=true)
virtual void notify_invisible_ (bool bTriggerEvents=true)
virtual void notify_strata_changed_ ()
virtual void notify_top_level_parent_ (bool bTopLevel, frame *pParent)
void add_level_ (int iAmount)
virtual void update_borders_ () const

Protected Attributes

std::map< uint, frame * > lChildList_
std::map< uint, layered_region * > lRegionList_
std::map< layer_type, layerlLayerList_
std::map< std::string,
std::string > 
lDefinedScriptList_
std::map< std::string,
script_info
lXMLScriptInfoList_
std::vector< std::string > lQueuedEventList_
std::set< std::string > lRegEventList_
std::set< std::string > lRegDragList_
std::map< std::string, handlerlDefinedHandlerList_
addonpAddOn_
int iLevel_
frame_strata mStrata_
bool bIsTopLevel_
framepTopLevelParent_
utils::refptr< backdroppBackdrop_
bool bHasAllEventsRegistred_
bool bIsKeyboardEnabled_
bool bIsMouseEnabled_
bool bAllowWorldInput_
bool bIsMouseWheelEnabled_
bool bIsMovable_
bool bIsClampedToScreen_
bool bIsResizable_
bool bIsUserPlaced_
bool bBuildLayerList_
std::array< int, 4 > lAbsHitRectInsetList_
std::array< float, 4 > lRelHitRectInsetList_
uint uiMinWidth_
uint uiMaxWidth_
uint uiMinHeight_
uint uiMaxHeight_
float fScale_
bool bMouseInFrame_
bool bMouseInTitleRegion_
int iMousePosX_
int iMousePosY_
regionpTitleRegion_
framepParentFrame_
std::vector< std::string > lMouseButtonList_
bool bMouseDragged_

Detailed Description

GUI container.

Can contain other frames, or layered_regions (text, images, ...).

Definition at line 27 of file gui_frame.hpp.


Member Typedef Documentation

typedef std::function<void(frame*, event*) gui::frame::handler)

Definition at line 297 of file gui_frame.hpp.


Constructor & Destructor Documentation

gui::frame::frame ( manager pManager  )  [explicit]

Constructor.

Definition at line 23 of file gui_frame.cpp.

gui::frame::~frame (  )  [virtual]

Destructor.

Definition at line 37 of file gui_frame.cpp.


Member Function Documentation

void gui::frame::add_child ( frame pChild  ) 

Adds a frame to this frame's children.

Parameters:
pChild The frame to add

Definition at line 747 of file gui_frame.cpp.

void gui::frame::add_level_ ( int  iAmount  )  [protected]

Definition at line 1577 of file gui_frame.cpp.

void gui::frame::add_region ( layered_region pRegion  ) 

Adds a layered_region to this frame's children.

Parameters:
pRegion The layered_region to add

Definition at line 632 of file gui_frame.cpp.

bool gui::frame::can_use_script ( const std::string &  sScriptName  )  const [virtual]

Returns 'true' if this frame can use a script.

Parameters:
sScriptName The name of the script
Note:
This method can be overriden if needed.

Reimplemented in gui::button, gui::edit_box, gui::scroll_frame, gui::slider, and gui::status_bar.

Definition at line 213 of file gui_frame.cpp.

void gui::frame::check_position (  )  const

Checks if this frame's position is valid.

Definition at line 452 of file gui_frame.cpp.

std::vector< uiobject * > gui::frame::clear_links (  )  [virtual]

Removes all anchors that point to this widget and all other kind of links.

Returns:
The list of all widgets that have been cleared
Note:
Also clears children objects (see frame::clear_links()).
Must be called before deleting the widget, except when closing the whole UI.

Reimplemented from gui::uiobject.

Definition at line 1870 of file gui_frame.cpp.

void gui::frame::copy_from ( uiobject pObj  )  [virtual]

Copies an uiobject's parameters into this frame (inheritance).

Parameters:
pObj The uiobject to copy

Reimplemented in gui::button, gui::check_button, gui::edit_box, gui::focus_frame, gui::scroll_frame, gui::slider, and gui::status_bar.

Definition at line 236 of file gui_frame.cpp.

frame * gui::frame::create_child ( const std::string &  sClassName,
const std::string &  sName,
const std::string &  sInheritance = "" 
)

Creates a new frame as child of this frame.

Parameters:
sClassName The name of the frame class ("Button", ...)
sName The name of the frame
sInheritance The name of the frame to inherit from (empty if none)
Returns:
The created frame.
Note:
You don't have the reponsability to delete this frame. It will be done automatically when its parent is deleted.
This function takes care of the basic initializing : you can directly use the created frame.

Definition at line 742 of file gui_frame.cpp.

void gui::frame::create_glue (  )  [virtual]

Creates the associated Lua glue.

Reimplemented from gui::region.

Reimplemented in gui::button, gui::check_button, gui::edit_box, gui::focus_frame, gui::scroll_frame, gui::slider, and gui::status_bar.

Definition at line 76 of file gui_frame.cpp.

layered_region * gui::frame::create_region ( layer_type  mLayer,
const std::string &  sClassName,
const std::string &  sName,
const std::string &  sInheritance = "" 
)

Creates a new region as child of this frame.

Parameters:
mLayer The layer on which to create the region
sClassName The name of the region class ("FontString", ...)
sName The name of the region
sInheritance The name of the region to inherit from (empty if none)
Returns:
The created region.
Note:
You don't have the reponsability to delete this region. It will be done automatically when its parent is deleted.
This function takes care of the basic initializing : you can directly use the created region.

Definition at line 685 of file gui_frame.cpp.

void gui::frame::create_title_region (  ) 

Creates a new title region for this frame.

Note:
You can get it by calling get_title_region().

Definition at line 384 of file gui_frame.cpp.

void gui::frame::define_script ( const std::string &  sScriptName,
handler  mHandler 
)

Registers a handler script to this frame.

Parameters:
sScriptName The name of the script
mHandler The handler ot the script

Definition at line 1027 of file gui_frame.cpp.

void gui::frame::define_script ( const std::string &  sScriptName,
const std::string &  sContent,
const std::string &  sFile,
uint  uiLineNbr 
)

Registers a handler script to this frame.

Parameters:
sScriptName The name of the script
sContent The content ot the script
sFile The file in which this script has been found
uiLineNbr The line number at which this script is located in the file
Note:
The last two informations are required for error messages.

Definition at line 952 of file gui_frame.cpp.

void gui::frame::disable_draw_layer ( layer_type  mLayerID  ) 

Disables a layer.

Parameters:
mLayerID The id of the layer to disable

Definition at line 537 of file gui_frame.cpp.

void gui::frame::enable_draw_layer ( layer_type  mLayerID  ) 

Enables a layer.

Parameters:
mLayerID The id of the layer to enable

Definition at line 547 of file gui_frame.cpp.

void gui::frame::enable_keyboard ( bool  bIsKeyboardEnabled  )  [virtual]

Sets if this frame can receive keyboard input.

Parameters:
bIsKeyboardEnabled 'true' to enable

Reimplemented in gui::edit_box.

Definition at line 557 of file gui_frame.cpp.

void gui::frame::enable_mouse ( bool  bIsMouseEnabled,
bool  bAllowWorldInput = false 
) [virtual]

Sets if this frame can receive mouse input.

Parameters:
bIsMouseEnabled 'true' to enable
bAllowWorldInput 'true' to allow world input

Definition at line 576 of file gui_frame.cpp.

void gui::frame::enable_mouse_wheel ( bool  bIsMouseWheelEnabled  )  [virtual]

Sets if this frame can receive mouse wheel input.

Parameters:
bIsMouseWheelEnabled 'true' to enable

Definition at line 600 of file gui_frame.cpp.

void gui::frame::fire_build_layer_list (  ) 

Tells this frame to rebuilt the layer list.

Note:
Automatically called by add_region(), remove_region(), and layered_region::set_draw_layer().

Definition at line 621 of file gui_frame.cpp.

const std::array< int, 4 > & gui::frame::get_abs_hit_rect_insets (  )  const

Returns this frame's absolute hit rect insets.

Returns:
This frame's absolute hit rect insets

Definition at line 851 of file gui_frame.cpp.

addon * gui::frame::get_addon (  )  const

Returns this frame's addon.

Returns:
This frame's addon
Note:
Returns "nullptr" if the frame has been created by Lua code and wasn't assigned a parent.

Definition at line 1752 of file gui_frame.cpp.

utils::wptr< backdrop > gui::frame::get_backdrop (  )  const

Returns this frame's backdrop.

Returns:
This frame's backdrop

Definition at line 841 of file gui_frame.cpp.

frame * gui::frame::get_child ( const std::string &  sName  )  const

Returns one of this frame's children.

Parameters:
sName The name of the child
Returns:
One of this frame's children

Definition at line 414 of file gui_frame.cpp.

const std::map< uint, frame * > & gui::frame::get_children (  )  const

Returns the child list.

Returns:
The child list

Definition at line 810 of file gui_frame.cpp.

float gui::frame::get_effective_alpha (  )  const

Calculates effective alpha.

Returns:
Effective alpha (alpha*parent->alpha)

Definition at line 815 of file gui_frame.cpp.

float gui::frame::get_effective_scale (  )  const

Calculates effective scale.

Returns:
Effective scale (scale*parent->scale)

Definition at line 823 of file gui_frame.cpp.

int gui::frame::get_frame_level (  )  const

Returns this frame's level.

Returns:
This frame's level

Definition at line 831 of file gui_frame.cpp.

frame_strata gui::frame::get_frame_strata (  )  const

Returns this frame's strata.

Returns:
This frame's strata

Definition at line 836 of file gui_frame.cpp.

const std::string & gui::frame::get_frame_type (  )  const

Returns this frame's type.

Returns:
This frame's type (Frame, Slider, ...)

Definition at line 846 of file gui_frame.cpp.

std::array< uint, 2 > gui::frame::get_max_resize (  )  const

Returns this frame's max dimensions.

Returns:
This frame's max dimensions

Definition at line 861 of file gui_frame.cpp.

std::array< uint, 2 > gui::frame::get_min_resize (  )  const

Returns this frame's min dimensions.

Returns:
This frame's min dimensions

Definition at line 866 of file gui_frame.cpp.

uint gui::frame::get_num_children (  )  const

Returns the number of children of this frame.

Returns:
The number of children of this frame

Definition at line 871 of file gui_frame.cpp.

uint gui::frame::get_num_regions (  )  const

Returns the number of region of this frame.

Returns:
The number of region of this frame

Definition at line 876 of file gui_frame.cpp.

layered_region * gui::frame::get_region ( const std::string &  sName  )  const

Returns one of this frame's region.

Parameters:
sName The name of the region
Returns:
One of this frame's region

Definition at line 428 of file gui_frame.cpp.

const std::array< float, 4 > & gui::frame::get_rel_hit_rect_insets (  )  const

Returns this frame's relative hit rect insets.

Returns:
This frame's relative hit rect insets

Definition at line 856 of file gui_frame.cpp.

float gui::frame::get_scale (  )  const

Returns this frame's scale.

Returns:
This frame's scale
Note:
If you want it's true scale on the screen, use get_effective_scale().

Definition at line 881 of file gui_frame.cpp.

region * gui::frame::get_title_region (  )  const

Returns this frame's title region.

Definition at line 886 of file gui_frame.cpp.

bool gui::frame::has_script ( const std::string &  sScriptName  )  const

Checks if this frame has a script defined.

Parameters:
sScriptName The name of the script to check
Returns:
'true' if this script is defined

Definition at line 626 of file gui_frame.cpp.

void gui::frame::hide (  )  [virtual]

hides this widget.

Note:
All its children won't be visible on the screen anymore, even if they are still marked as shown.

Reimplemented from gui::uiobject.

Definition at line 1711 of file gui_frame.cpp.

bool gui::frame::is_clamped_to_screen (  )  const

Checks if this frame is clamped to screen.

Returns:
'true' if this frame is clamed to screen

Definition at line 891 of file gui_frame.cpp.

bool gui::frame::is_in_frame ( int  iX,
int  iY 
) const [virtual]

Checks if the provided coordinates are in the frame.

Parameters:
iX The horizontal coordinate
iY The vertical coordinate
Returns:
'true' if the provided coordinates are in the frame

Reimplemented in gui::scroll_frame, and gui::slider.

Definition at line 896 of file gui_frame.cpp.

bool gui::frame::is_keyboard_enabled (  )  const

Checks if this frame can receive keyboard input.

Returns:
'true' if this frame can receive keyboard input

Definition at line 912 of file gui_frame.cpp.

bool gui::frame::is_mouse_enabled (  )  const

Checks if this frame can receive mouse input.

Returns:
'true' if this frame can receive mouse input

Definition at line 917 of file gui_frame.cpp.

bool gui::frame::is_mouse_wheel_enabled (  )  const

Checks if this frame can receive mouse wheel input.

Returns:
'true' if this frame can receive mouse wheel input

Definition at line 927 of file gui_frame.cpp.

bool gui::frame::is_movable (  )  const

Checks if this frame can be moved.

Returns:
'true' if this frame can be moved

Definition at line 932 of file gui_frame.cpp.

bool gui::frame::is_resizable (  )  const

Checks if this frame can be resized.

Returns:
'true' if this frame can be resized

Definition at line 937 of file gui_frame.cpp.

bool gui::frame::is_top_level (  )  const

Checks if this frame is at top level.

Returns:
'true' if this frame is at top level

Definition at line 942 of file gui_frame.cpp.

bool gui::frame::is_user_placed (  )  const

Checks if this frame has been moved by the user.

Returns:
'true' if this frame has been moved by the user

Definition at line 947 of file gui_frame.cpp.

bool gui::frame::is_world_input_allowed (  )  const

Checks if this frame allows world input.

Returns:
'true' if this frame allows world input

Definition at line 922 of file gui_frame.cpp.

void gui::frame::notify_child_strata_changed ( frame pChild  )  [virtual]

Tells this frame that at least one of its children has modified its strata or level.

Parameters:
pChild The child that has changed its strata (can also be a child of this child)
Note:
If this frame has no parent, it calls manager::fire_build_strata_list(). Else it notifies its parent.

Definition at line 1627 of file gui_frame.cpp.

void gui::frame::notify_invisible_ ( bool  bTriggerEvents = true  )  [protected, virtual]

Reimplemented in gui::edit_box.

Definition at line 1660 of file gui_frame.cpp.

void gui::frame::notify_loaded (  )  [virtual]

Notifies this widget that it has been fully loaded.

Note:
Calls the "OnLoad" script.

Reimplemented from gui::uiobject.

Definition at line 613 of file gui_frame.cpp.

void gui::frame::notify_mouse_in_frame ( bool  bMouseInFrame,
int  iX,
int  iY 
) [virtual]

Tells this frame it is being overed by the mouse.

Parameters:
bMouseInFrame 'true' if the mouse is above this frame
iX The horizontal mouse coordinate
iY The vertical mouse coordinate
Note:
Always use the mouse position set by this function and not the one returned by the InputManager, because there can be an offset to apply (for example with ScrollFrame).

Reimplemented in gui::scroll_frame, and gui::slider.

Definition at line 1757 of file gui_frame.cpp.

void gui::frame::notify_renderer_need_redraw (  )  const [virtual]

Notifies the renderer of this widget that it needs to be redrawn.

Note:
Automatically called by any shape changing function.

Reimplemented from gui::uiobject.

Definition at line 1689 of file gui_frame.cpp.

void gui::frame::notify_script_defined ( const std::string &  sScriptName,
bool  bDefined 
)

Tells this frame that a script has been defined.

Parameters:
sScriptName The name of the script
bDefined 'true' if the script is defined

Definition at line 1039 of file gui_frame.cpp.

void gui::frame::notify_strata_changed_ (  )  [protected, virtual]

Definition at line 1635 of file gui_frame.cpp.

void gui::frame::notify_top_level_parent_ ( bool  bTopLevel,
frame pParent 
) [protected, virtual]

Definition at line 1677 of file gui_frame.cpp.

void gui::frame::notify_visible_ ( bool  bTriggerEvents = true  )  [protected, virtual]

Definition at line 1643 of file gui_frame.cpp.

void gui::frame::on ( const std::string &  sScriptName,
event pEvent = nullptr 
) [virtual]

Calls a script.

Parameters:
sScriptName The name of the script
pEvent Stores scripts arguments

Reimplemented in gui::button, gui::edit_box, and gui::scroll_frame.

Definition at line 1225 of file gui_frame.cpp.

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

Calls the on_event script.

Parameters:
mEvent The Event that occured

Implements gui::event_receiver.

Reimplemented in gui::button, gui::edit_box, and gui::slider.

Definition at line 1059 of file gui_frame.cpp.

void gui::frame::parse_attributes_ ( xml::block *  pBlock  )  [protected, virtual]

Reimplemented from gui::region.

Definition at line 27 of file gui_frame_parser.cpp.

void gui::frame::parse_backdrop_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 246 of file gui_frame_parser.cpp.

void gui::frame::parse_block ( xml::block *  pBlock  )  [virtual]

Parses data from an xml::block.

Parameters:
pBlock The frame's xml::block

Reimplemented from gui::region.

Reimplemented in gui::button, gui::check_button, gui::edit_box, gui::focus_frame, gui::scroll_frame, gui::slider, and gui::status_bar.

Definition at line 11 of file gui_frame_parser.cpp.

void gui::frame::parse_frames_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 420 of file gui_frame_parser.cpp.

void gui::frame::parse_hit_rect_insets_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 356 of file gui_frame_parser.cpp.

void gui::frame::parse_layers_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 383 of file gui_frame_parser.cpp.

void gui::frame::parse_resize_bounds_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 191 of file gui_frame_parser.cpp.

void gui::frame::parse_scripts_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 453 of file gui_frame_parser.cpp.

void gui::frame::parse_title_region_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 234 of file gui_frame_parser.cpp.

void gui::frame::raise (  ) 

Increases this frame's level so it's the highest of the strata.

Note:
All its children are raised of the same ammount.
Only works for top level frames.

Definition at line 1555 of file gui_frame.cpp.

void gui::frame::register_all_events (  ) 

Tells this frame to react to every event in the game.

Definition at line 1347 of file gui_frame.cpp.

void gui::frame::register_event ( const std::string &  sEventName  )  [virtual]

Tells this frame to react to a certain event.

Parameters:
sEventName The name of the event

Reimplemented from gui::event_receiver.

Definition at line 1353 of file gui_frame.cpp.

void gui::frame::register_for_drag ( const std::vector< std::string > &  lButtonList  ) 

Tells this frame to react to mouse drag.

Parameters:
lButtonList The list of mouse button allowed

Definition at line 1359 of file gui_frame.cpp.

void gui::frame::remove_child ( frame pChild  ) 

Removes a frame from this frame's children.

Parameters:
pChild The frame to remove

Definition at line 791 of file gui_frame.cpp.

void gui::frame::remove_region ( layered_region pRegion  ) 

Removes a layered_region from this frame's children.

Parameters:
pRegion The layered_region to remove

Definition at line 665 of file gui_frame.cpp.

void gui::frame::render (  )  [virtual]

Renders this widget on the current render target.

Reimplemented from gui::region.

Definition at line 50 of file gui_frame.cpp.

std::string gui::frame::serialize ( const std::string &  sTab  )  const [virtual]

Prints all relevant information about this widget in a string.

Parameters:
sTab The offset to give to all lines
Returns:
All relevant information about this widget

Reimplemented from gui::uiobject.

Reimplemented in gui::button, gui::check_button, gui::slider, and gui::status_bar.

Definition at line 96 of file gui_frame.cpp.

void gui::frame::set_abs_height ( uint  uiAbsHeight  )  [virtual]

Changes this widget's absolute height (in pixels).

Parameters:
uiAbsHeight The new height

Reimplemented from gui::uiobject.

Definition at line 447 of file gui_frame.cpp.

void gui::frame::set_abs_hit_rect_insets ( int  iLeft,
int  iRight,
int  iTop,
int  iBottom 
)

Sets this frame's absolute hit rect insets.

Parameters:
iLeft Offset from the left border
iRight Offset from the right border
iTop Offset from the top border
iBottom Offset from the bottom border
Note:
This is the zone on which you can click.

Definition at line 1438 of file gui_frame.cpp.

void gui::frame::set_abs_width ( uint  uiAbsWidth  )  [virtual]

Changes this widget's absolute width (in pixels).

Parameters:
uiAbsWidth The new width

Reimplemented from gui::uiobject.

Definition at line 442 of file gui_frame.cpp.

void gui::frame::set_addon ( addon pAddOn  ) 

Sets the addon this frame belongs to.

Parameters:
pAddOn The addon this frame belongs to

Definition at line 1744 of file gui_frame.cpp.

void gui::frame::set_backdrop ( utils::refptr< backdrop pBackdrop  ) 

Sets this frames' backdrop.

Parameters:
pBackdrop The new backdrop

Definition at line 1432 of file gui_frame.cpp.

void gui::frame::set_clamped_to_screen ( bool  bIsClampedToScreen  ) 

Sets if this frame is clamped to screen.

Parameters:
bIsClampedToScreen 'true' if this frame is clamped to screen
Note:
If 'true', the frame can't go out of the screen.

Definition at line 1367 of file gui_frame.cpp.

void gui::frame::set_frame_strata ( const std::string &  sStrata  ) 

Sets this frame's strata.

Parameters:
sStrata The new strata

Definition at line 1391 of file gui_frame.cpp.

void gui::frame::set_frame_strata ( frame_strata  mStrata  ) 

Sets this frame's strata.

Parameters:
mStrata The new strata

Definition at line 1372 of file gui_frame.cpp.

void gui::frame::set_level ( int  iLevel  ) 

Sets this frame's level.

Parameters:
iLevel The new level

Definition at line 1448 of file gui_frame.cpp.

void gui::frame::set_manually_rendered ( bool  bManuallyRendered,
uiobject pRenderer = nullptr 
) [virtual]

Flags this object as "manually rendered".

Parameters:
bManuallyRendered 'true' to flag it as manually rendered
pRenderer The uiobject that will take care of rendering this widget
Note:
Manually rendered objects are not automatically rendered by their parent (for layered_regions) or the manager (for frames). They also don't receive automatic input.
This function propagates the manually rendered flag to this frame's children.

Definition at line 1615 of file gui_frame.cpp.

void gui::frame::set_max_height ( uint  uiMaxHeight  ) 

set_ this frame's maximum height.

Parameters:
uiMaxHeight The maximum height this frame can have

Definition at line 1471 of file gui_frame.cpp.

void gui::frame::set_max_resize ( uint  uiMaxWidth,
uint  uiMaxHeight 
)

set_ this frame's maximum size.

Parameters:
uiMaxWidth The maximum width this frame can have
uiMaxHeight The maximum height this frame can have

Definition at line 1459 of file gui_frame.cpp.

void gui::frame::set_max_width ( uint  uiMaxWidth  ) 

set_ this frame's maximum width.

Parameters:
uiMaxWidth The maximum width this frame can have

Definition at line 1480 of file gui_frame.cpp.

void gui::frame::set_min_height ( uint  uiMinHeight  ) 

set_ this frame's minimum height.

Parameters:
uiMinHeight The minimum height this frame can have

Definition at line 1489 of file gui_frame.cpp.

void gui::frame::set_min_resize ( uint  uiMinWidth,
uint  uiMinHeight 
)

set_ this frame's minimum size.

Parameters:
uiMinWidth The minimum width this frame can have
uiMinHeight The minimum height this frame can have

Definition at line 1465 of file gui_frame.cpp.

void gui::frame::set_min_width ( uint  uiMinWidth  ) 

set_ this frame's minimum width.

Parameters:
uiMinWidth The minimum width this frame can have

Definition at line 1498 of file gui_frame.cpp.

void gui::frame::set_movable ( bool  bIsMovable  ) 

Sets if this frame can be moved by the user.

Parameters:
bIsMovable 'true' to allow the user to move this frame

Definition at line 1507 of file gui_frame.cpp.

void gui::frame::set_parent ( uiobject pParent  ) 

Changes this widget's parent.

Parameters:
pParent The new parent
Note:
Default is nullptr.
Overrides uiobject's implementation.

Definition at line 1512 of file gui_frame.cpp.

void gui::frame::set_rel_hit_rect_insets ( float  fLeft,
float  fRight,
float  fTop,
float  fBottom 
)

Sets this frame's relative hit rect insets.

Parameters:
fLeft Offset from the left border
fRight Offset from the right border
fTop Offset from the top border
fBottom Offset from the bottom border
Note:
This is the zone on which you can click.

Definition at line 1443 of file gui_frame.cpp.

void gui::frame::set_resizable ( bool  bIsResizable  ) 

Sets if this frame can be resized by the user.

Parameters:
bIsResizable 'true' to allow the user to resize this frame

Definition at line 1531 of file gui_frame.cpp.

void gui::frame::set_scale ( float  fScale  ) 

Sets this frame's scale.

Parameters:
fScale The new scale

Definition at line 1536 of file gui_frame.cpp.

void gui::frame::set_shown ( bool  bIsShown  )  [virtual]

shows/hides this widget.

Parameters:
bIsShown 'true' if you want to show this widget
Note:
See show() and hide() for more infos.
Contrary to show() and hide(), this function doesn't trigger any event ("OnShow" or "OnHide"). It should only be used to set the initial state of the widget.

Reimplemented from gui::uiobject.

Definition at line 1722 of file gui_frame.cpp.

void gui::frame::set_top_level ( bool  bIsTopLevel  ) 

Sets if this frame is at top level.

Parameters:
bIsTopLevel 'true' to put the frame at top level

Definition at line 1543 of file gui_frame.cpp.

void gui::frame::set_user_placed ( bool  bIsUserPlaced  ) 

Sets if this frame has been moved by the user.

Parameters:
bIsUserPlaced 'true' if this frame has been moved by the user

Definition at line 1588 of file gui_frame.cpp.

void gui::frame::show (  )  [virtual]

shows this widget.

Note:
Its parent must be shown for it to appear on the screen.

Reimplemented from gui::uiobject.

Definition at line 1700 of file gui_frame.cpp.

void gui::frame::start_moving (  ) 

Starts moving this frame with the mouse.

Definition at line 1593 of file gui_frame.cpp.

void gui::frame::start_sizing ( const anchor_point mPoint  ) 

Starts resizing this frame with the mouse.

Parameters:
mPoint The corner to move

Definition at line 1604 of file gui_frame.cpp.

void gui::frame::stop_moving (  ) 

ends moving this frame.

Definition at line 1599 of file gui_frame.cpp.

void gui::frame::stop_sizing (  ) 

ends resizing this frame.

Definition at line 1610 of file gui_frame.cpp.

void gui::frame::unregister_all_events (  ) 

Tells the frame not to react to all events.

Definition at line 1733 of file gui_frame.cpp.

void gui::frame::unregister_event ( const std::string &  sEventName  )  [virtual]

Tells the frame not to react to a certain event.

Parameters:
sEventName The name of the event

Reimplemented from gui::event_receiver.

Definition at line 1739 of file gui_frame.cpp.

void gui::frame::update ( float  fDelta  )  [virtual]

updates this widget's logic.

Reimplemented from gui::uiobject.

Reimplemented in gui::edit_box, gui::scroll_frame, gui::slider, and gui::status_bar.

Definition at line 1790 of file gui_frame.cpp.

void gui::frame::update_borders_ (  )  const [protected, virtual]

Reimplemented from gui::uiobject.

Definition at line 1781 of file gui_frame.cpp.


Member Data Documentation

Definition at line 627 of file gui_frame.hpp.

bool gui::frame::bBuildLayerList_ [protected]

Definition at line 634 of file gui_frame.hpp.

Definition at line 623 of file gui_frame.hpp.

Definition at line 630 of file gui_frame.hpp.

Definition at line 625 of file gui_frame.hpp.

bool gui::frame::bIsMouseEnabled_ [protected]

Definition at line 626 of file gui_frame.hpp.

Definition at line 628 of file gui_frame.hpp.

bool gui::frame::bIsMovable_ [protected]

Definition at line 629 of file gui_frame.hpp.

bool gui::frame::bIsResizable_ [protected]

Definition at line 631 of file gui_frame.hpp.

bool gui::frame::bIsTopLevel_ [protected]

Definition at line 618 of file gui_frame.hpp.

bool gui::frame::bIsUserPlaced_ [protected]

Definition at line 632 of file gui_frame.hpp.

bool gui::frame::bMouseDragged_ [protected]

Definition at line 655 of file gui_frame.hpp.

bool gui::frame::bMouseInFrame_ [protected]

Definition at line 646 of file gui_frame.hpp.

Definition at line 647 of file gui_frame.hpp.

float gui::frame::fScale_ [protected]

Definition at line 644 of file gui_frame.hpp.

int gui::frame::iLevel_ [protected]

Definition at line 615 of file gui_frame.hpp.

int gui::frame::iMousePosX_ [protected]

Definition at line 648 of file gui_frame.hpp.

int gui::frame::iMousePosY_ [protected]

Definition at line 648 of file gui_frame.hpp.

std::array<int, 4> gui::frame::lAbsHitRectInsetList_ [protected]

Definition at line 636 of file gui_frame.hpp.

std::map<uint, frame*> gui::frame::lChildList_ [protected]

Definition at line 602 of file gui_frame.hpp.

std::map<std::string, handler> gui::frame::lDefinedHandlerList_ [protected]

Definition at line 611 of file gui_frame.hpp.

std::map<std::string, std::string> gui::frame::lDefinedScriptList_ [protected]

Definition at line 605 of file gui_frame.hpp.

std::map<layer_type, layer> gui::frame::lLayerList_ [protected]

Definition at line 604 of file gui_frame.hpp.

std::vector<std::string> gui::frame::lMouseButtonList_ [protected]

Definition at line 654 of file gui_frame.hpp.

std::vector<std::string> gui::frame::lQueuedEventList_ [protected]

Definition at line 607 of file gui_frame.hpp.

std::set<std::string> gui::frame::lRegDragList_ [protected]

Definition at line 609 of file gui_frame.hpp.

std::set<std::string> gui::frame::lRegEventList_ [protected]

Definition at line 608 of file gui_frame.hpp.

std::map<uint, layered_region*> gui::frame::lRegionList_ [protected]

Definition at line 603 of file gui_frame.hpp.

std::array<float,4> gui::frame::lRelHitRectInsetList_ [protected]

Definition at line 637 of file gui_frame.hpp.

std::map<std::string, script_info> gui::frame::lXMLScriptInfoList_ [protected]

Definition at line 606 of file gui_frame.hpp.

Definition at line 617 of file gui_frame.hpp.

addon* gui::frame::pAddOn_ [protected]

Definition at line 613 of file gui_frame.hpp.

utils::refptr<backdrop> gui::frame::pBackdrop_ [protected]

Definition at line 621 of file gui_frame.hpp.

Definition at line 652 of file gui_frame.hpp.

Definition at line 650 of file gui_frame.hpp.

Definition at line 619 of file gui_frame.hpp.

uint gui::frame::uiMaxHeight_ [protected]

Definition at line 642 of file gui_frame.hpp.

uint gui::frame::uiMaxWidth_ [protected]

Definition at line 640 of file gui_frame.hpp.

uint gui::frame::uiMinHeight_ [protected]

Definition at line 641 of file gui_frame.hpp.

uint gui::frame::uiMinWidth_ [protected]

Definition at line 639 of file gui_frame.hpp.


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