A frame with scrollable content. More...
#include <gui_scrollframe.hpp>
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. | |
frame * | get_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_ |
frame * | pScrollChild_ |
bool | bRebuildScrollRenderTarget_ |
bool | bRedrawScrollRenderTarget_ |
bool | bUpdateScrollRange_ |
utils::refptr< render_target > | pScrollRenderTarget_ |
texture * | pScrollTexture_ |
bool | bRebuildScrollStrataList_ |
std::map< uint, frame * > | lScrollChildList_ |
std::map< frame_strata, strata > | lScrollStrataList_ |
bool | bMouseInScrollTexture_ |
frame * | pOveredScrollChild_ |
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.
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.
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.
sScriptName | The name of the script |
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).
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.
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.
Definition at line 184 of file gui_scrollframe.cpp.
frame * gui::scroll_frame::get_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.
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.
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.
iX | The horizontal coordinate | |
iY | The vertical coordinate |
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.
pChild | The child that has changed its strata (can also be a child of this child) |
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.
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.
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.
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.
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.
pFrame | The scroll child |
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.
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.
bool gui::scroll_frame::bMouseInScrollTexture_ [protected] |
Definition at line 161 of file gui_scrollframe.hpp.
bool gui::scroll_frame::bRebuildScrollRenderTarget_ [mutable, protected] |
Definition at line 150 of file gui_scrollframe.hpp.
bool gui::scroll_frame::bRebuildScrollStrataList_ [mutable, protected] |
Definition at line 157 of file gui_scrollframe.hpp.
bool gui::scroll_frame::bRedrawScrollRenderTarget_ [mutable, protected] |
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.
int gui::scroll_frame::iHorizontalScroll_ [protected] |
Definition at line 143 of file gui_scrollframe.hpp.
int gui::scroll_frame::iHorizontalScrollRange_ [protected] |
Definition at line 144 of file gui_scrollframe.hpp.
int gui::scroll_frame::iVerticalScroll_ [protected] |
Definition at line 145 of file gui_scrollframe.hpp.
int gui::scroll_frame::iVerticalScrollRange_ [protected] |
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.
std::map<frame_strata, strata> gui::scroll_frame::lScrollStrataList_ [protected] |
Definition at line 159 of file gui_scrollframe.hpp.
frame* gui::scroll_frame::pOveredScrollChild_ [protected] |
Definition at line 162 of file gui_scrollframe.hpp.
frame* gui::scroll_frame::pScrollChild_ [protected] |
Definition at line 148 of file gui_scrollframe.hpp.
utils::refptr<render_target> gui::scroll_frame::pScrollRenderTarget_ [protected] |
Definition at line 153 of file gui_scrollframe.hpp.
texture* gui::scroll_frame::pScrollTexture_ [protected] |
Definition at line 155 of file gui_scrollframe.hpp.