gui::scroll_frame Class Reference

A frame with scrollable content. More...

#include <gui_scrollframe.hpp>

Inheritance diagram for gui::scroll_frame:
gui::frame gui::event_receiver gui::region gui::uiobject

List of all members.

Public Member Functions

 scroll_frame (manager *pManager)
 Constructor.
virtual ~scroll_frame ()
 Destructor.
virtual void update (float fDelta)
 updates this widget's logic.
virtual void copy_from (uiobject *pObj)
 Copies an uiobject's parameters into this scroll_frame (inheritance).
virtual bool can_use_script (const std::string &sScriptName) const
 Returns 'true' if this scroll_frame can use a script.
virtual void on (const std::string &sScriptName, event *pEvent=nullptr)
 Calls a script.
void set_scroll_child (frame *pFrame)
 Sets this scroll_frame's scroll child.
frameget_scroll_child ()
 Returns this scroll_frame's scroll child.
void set_horizontal_scroll (int iHorizontalScroll)
 Sets the horizontal offset of the scroll child.
int get_horizontal_scroll () const
 Returns the horizontal offset of the scroll child.
int get_horizontal_scroll_range () const
 Returns the maximum horizontal offset of the scroll child.
void set_vertical_scroll (int iVerticalScroll)
 Sets the vertical offset of the scroll child.
int get_vertical_scroll () const
 Returns the vertical offset of the scroll child.
int get_vertical_scroll_range () const
 Returns the maximum vertical offset of the scroll child.
virtual bool is_in_frame (int iX, int iY) const
 Checks if the provided coordinates are in the scroll_frame.
virtual void notify_mouse_in_frame (bool bMouseInFrame, int iX, int iY)
 Tells this scroll_frame it is being overed by the mouse.
virtual void fire_redraw () const
 Tells this widget that a manually rendered widget requires redraw.
virtual void notify_child_strata_changed (frame *pChild)
 Tells this scroll_frame that at least one of its children has modified its strata or level.
virtual void create_glue ()
 Returns this widget's Lua glue.
virtual void parse_block (xml::block *pBlock)
 Parses data from an xml::block.

Static Public Member Functions

static void register_glue (utils::wptr< lua::state > pLua)
 Registers this widget to the provided lua::state.

Protected Member Functions

virtual void parse_scroll_child_block_ (xml::block *pBlock)
virtual void notify_manually_rendered_object_ (uiobject *pObject, bool bManuallyRendered)
void add_to_scroll_child_list_ (frame *pChild)
void remove_from_scroll_child_list_ (frame *pChild)
void update_scroll_range_ ()
void update_scroll_child_input_ ()
void rebuild_scroll_render_target_ ()
void rebuild_scroll_strata_list_ ()
void render_scroll_strata_list_ ()

Protected Attributes

int iHorizontalScroll_
int iHorizontalScrollRange_
int iVerticalScroll_
int iVerticalScrollRange_
framepScrollChild_
bool bRebuildScrollRenderTarget_
bool bRedrawScrollRenderTarget_
bool bUpdateScrollRange_
utils::refptr< render_targetpScrollRenderTarget_
texturepScrollTexture_
bool bRebuildScrollStrataList_
std::map< uint, frame * > lScrollChildList_
std::map< frame_strata, stratalScrollStrataList_
bool bMouseInScrollTexture_
framepOveredScrollChild_

Detailed Description

A frame with scrollable content.

This widget has a special child frame, the scroll child. The scroll child is rendered on a render_target, which is then rendered on the screen.

Definition at line 16 of file gui_scrollframe.hpp.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 10 of file gui_scrollframe.cpp.

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

Destructor.

Definition at line 22 of file gui_scrollframe.cpp.


Member Function Documentation

void gui::scroll_frame::add_to_scroll_child_list_ ( frame pChild  )  [protected]

Definition at line 446 of file gui_scrollframe.cpp.

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

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

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

Reimplemented from gui::frame.

Definition at line 26 of file gui_scrollframe.cpp.

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

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

Parameters:
pObj The uiobject to copy

Reimplemented from gui::frame.

Definition at line 46 of file gui_scrollframe.cpp.

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

Returns this widget's Lua glue.

Reimplemented from gui::frame.

Definition at line 426 of file gui_scrollframe.cpp.

void gui::scroll_frame::fire_redraw (  )  const [virtual]

Tells this widget that a manually rendered widget requires redraw.

Reimplemented from gui::uiobject.

Definition at line 407 of file gui_scrollframe.cpp.

int gui::scroll_frame::get_horizontal_scroll (  )  const

Returns the horizontal offset of the scroll child.

Returns:
The horizontal offset of the scroll child

Definition at line 179 of file gui_scrollframe.cpp.

int gui::scroll_frame::get_horizontal_scroll_range (  )  const

Returns the maximum horizontal offset of the scroll child.

Returns:
The maximum horizontal offset of the scroll child

Definition at line 184 of file gui_scrollframe.cpp.

frame * gui::scroll_frame::get_scroll_child (  ) 

Returns this scroll_frame's scroll child.

Returns:
This scroll_frame's scroll child

Definition at line 162 of file gui_scrollframe.cpp.

int gui::scroll_frame::get_vertical_scroll (  )  const

Returns the vertical offset of the scroll child.

Returns:
The vertical offset of the scroll child

Definition at line 201 of file gui_scrollframe.cpp.

int gui::scroll_frame::get_vertical_scroll_range (  )  const

Returns the maximum vertical offset of the scroll child.

Returns:
The maximum vertical offset of the scroll child

Definition at line 206 of file gui_scrollframe.cpp.

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

Checks if the provided coordinates are in the scroll_frame.

Parameters:
iX The horizontal coordinate
iY The vertical coordinate
Returns:
'true' if the provided coordinates are in the scroll_frame
Note:
The scroll_frame version of this function also checks if the mouse is over the scroll texture (which means this function ignores positive hit rect insets).
For scroll children to receive input, the scroll_frame must be keyboard/mouse/wheel enabled.

Reimplemented from gui::frame.

Definition at line 393 of file gui_scrollframe.cpp.

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

Tells this scroll_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 pChild is the scroll child, it only rebuilds its internal strata list.
If this scroll_frame has no parent, it calls manager::fire_build_strata_list(). Else it notifies its parent.

Definition at line 413 of file gui_scrollframe.cpp.

void gui::scroll_frame::notify_manually_rendered_object_ ( uiobject pObject,
bool  bManuallyRendered 
) [protected, virtual]

Definition at line 462 of file gui_scrollframe.cpp.

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

Tells this scroll_frame it is being overed by the mouse.

Parameters:
bMouseInFrame 'true' if the mouse is above this scroll_frame
iX The horizontal mouse coordinate
iY The vertical mouse coordinate

Reimplemented from gui::frame.

Definition at line 401 of file gui_scrollframe.cpp.

void gui::scroll_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 from gui::frame.

Definition at line 38 of file gui_scrollframe.cpp.

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

Parses data from an xml::block.

Parameters:
pBlock The scroll_frame's xml::block

Reimplemented from gui::frame.

Definition at line 8 of file gui_scrollframe_parser.cpp.

void gui::scroll_frame::parse_scroll_child_block_ ( xml::block *  pBlock  )  [protected, virtual]

Definition at line 15 of file gui_scrollframe_parser.cpp.

void gui::scroll_frame::rebuild_scroll_render_target_ (  )  [protected]

Definition at line 327 of file gui_scrollframe.cpp.

void gui::scroll_frame::rebuild_scroll_strata_list_ (  )  [protected]

Definition at line 351 of file gui_scrollframe.cpp.

void gui::scroll_frame::register_glue ( utils::wptr< lua::state >  pLua  )  [static]

Registers this widget to the provided lua::state.

Definition at line 9 of file gui_scrollframe_glues.cpp.

void gui::scroll_frame::remove_from_scroll_child_list_ ( frame pChild  )  [protected]

Definition at line 454 of file gui_scrollframe.cpp.

void gui::scroll_frame::render_scroll_strata_list_ (  )  [protected]

Definition at line 365 of file gui_scrollframe.cpp.

void gui::scroll_frame::set_horizontal_scroll ( int  iHorizontalScroll  ) 

Sets the horizontal offset of the scroll child.

Parameters:
iHorizontalScroll The horizontal offset

Definition at line 167 of file gui_scrollframe.cpp.

void gui::scroll_frame::set_scroll_child ( frame pFrame  ) 

Sets this scroll_frame's scroll child.

Parameters:
pFrame The scroll child
Note:
Creates the render_target and the associated sprite.

Definition at line 87 of file gui_scrollframe.cpp.

void gui::scroll_frame::set_vertical_scroll ( int  iVerticalScroll  ) 

Sets the vertical offset of the scroll child.

Parameters:
iVerticalScroll The vertical offset

Definition at line 189 of file gui_scrollframe.cpp.

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

updates this widget's logic.

Reimplemented from gui::frame.

Definition at line 211 of file gui_scrollframe.cpp.

void gui::scroll_frame::update_scroll_child_input_ (  )  [protected]

Definition at line 275 of file gui_scrollframe.cpp.

void gui::scroll_frame::update_scroll_range_ (  )  [protected]

Definition at line 264 of file gui_scrollframe.cpp.


Member Data Documentation

Definition at line 161 of file gui_scrollframe.hpp.

Definition at line 150 of file gui_scrollframe.hpp.

Definition at line 157 of file gui_scrollframe.hpp.

Definition at line 151 of file gui_scrollframe.hpp.

bool gui::scroll_frame::bUpdateScrollRange_ [mutable, protected]

Definition at line 152 of file gui_scrollframe.hpp.

Definition at line 143 of file gui_scrollframe.hpp.

Definition at line 144 of file gui_scrollframe.hpp.

Definition at line 145 of file gui_scrollframe.hpp.

Definition at line 146 of file gui_scrollframe.hpp.

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

Definition at line 158 of file gui_scrollframe.hpp.

Definition at line 159 of file gui_scrollframe.hpp.

Definition at line 162 of file gui_scrollframe.hpp.

Definition at line 148 of file gui_scrollframe.hpp.

Definition at line 153 of file gui_scrollframe.hpp.

Definition at line 155 of file gui_scrollframe.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