Base class for creating containers with one or two scrollbar(s). More...
#include <scrollbar_container.hpp>


Public Types | |
| enum | tscrollbar_mode { always_visible, always_invisible, auto_visible, auto_visible_first_run } |
The way to handle the showing or hiding of the scrollbar. More... | |
Public Member Functions | |
| tscrollbar_container (const unsigned canvas_count) | |
| ~tscrollbar_container () | |
| void | layout_init (const bool full_initialization) |
| Inherited from tcontainer_. | |
| void | request_reduce_height (const unsigned maximum_height) |
| Inherited from twidget. | |
| void | request_reduce_width (const unsigned maximum_width) |
| Inherited from tcontrol. | |
| bool | can_wrap () const |
| Inherited from tcontainer_. | |
| void | place (const tpoint &origin, const tpoint &size) |
| Inherited from tcontainer_. | |
| void | set_origin (const tpoint &origin) |
| Inherited from tcontainer_. | |
| void | set_visible_area (const SDL_Rect &area) |
| Inherited from tcontainer_. | |
| bool | get_active () const |
| Inherited from tcontainer_. | |
| unsigned | get_state () const |
| Inherited from tcontainer_. | |
| twidget * | find_at (const tpoint &coordinate, const bool must_be_active) |
| Inherited from tcontainer_. | |
| const twidget * | find_at (const tpoint &coordinate, const bool must_be_active) const |
| Inherited from tcontainer_. | |
| twidget * | find (const std::string &id, const bool must_be_active) |
| Inherited from tcontainer_. | |
| const twidget * | find (const std::string &id, const bool must_be_active) const |
| Inherited from tcontrol. | |
| bool | disable_click_dismiss () const |
| Inherited from tcontainer_. | |
| void | set_vertical_scrollbar_mode (const tscrollbar_mode scrollbar_mode) |
| tscrollbar_mode | get_vertical_scrollbar_mode () const |
| void | set_horizontal_scrollbar_mode (const tscrollbar_mode scrollbar_mode) |
| tscrollbar_mode | get_horizontal_scrollbar_mode () const |
| tgrid * | content_grid () |
| const tgrid * | content_grid () const |
| const SDL_Rect & | content_visible_area () const |
| void | scroll_vertical_scrollbar (const tscrollbar_::tscroll scroll) |
| Scrolls the vertical scrollbar. | |
| void | scroll_horizontal_scrollbar (const tscrollbar_::tscroll scroll) |
| Scrolls the horizontal scrollbar. | |
| void | vertical_scrollbar_moved () |
| Callback when the scrollbar moves (NOTE maybe only one callback needed). | |
| void | horizontal_scrollbar_moved () |
Protected Member Functions | |
| void | show_content_rect (const SDL_Rect &rect) |
| Shows a certain part of the content. | |
| void | set_scrollbar_button_status () |
| Sets the status of the scrollbar buttons. | |
| bool | content_resize_request (const bool force_sizing=false) |
| Notification if the content of a child needs a resize. | |
| bool | content_resize_request (const int width_modification, const int height_modification) |
| Request from the content to modify the size of the container. | |
| virtual void | handle_key_home (SDLMod modifier, bool &handled) |
| Home key pressed. | |
| virtual void | handle_key_end (SDLMod modifier, bool &handled) |
| End key pressed. | |
| virtual void | handle_key_page_up (SDLMod modifier, bool &handled) |
| Page up key pressed. | |
| virtual void | handle_key_page_down (SDLMod modifier, bool &handled) |
| Page down key pressed. | |
| virtual void | handle_key_up_arrow (SDLMod modifier, bool &handled) |
| Up arrow key pressed. | |
| virtual void | handle_key_down_arrow (SDLMod modifier, bool &handled) |
| Down arrow key pressed. | |
| virtual void | handle_key_left_arrow (SDLMod modifier, bool &handled) |
| Left arrow key pressed. | |
| virtual void | handle_key_right_arrow (SDLMod modifier, bool &handled) |
| Right arrow key pressed. | |
Private Types | |
| enum | tstate { ENABLED, DISABLED, COUNT } |
Possible states of the widget. More... | |
Private Member Functions | |
| tpoint | calculate_best_size () const |
| Inherited from tcontainer_. | |
| bool | content_resize_width (const int width_modification) |
| Helper for content_resize_request. | |
| bool | content_resize_height (const int height_modification) |
| Helper for content_resize_request. | |
| void | finalize_setup () |
| The builder needs to call us so we do our setup. | |
| virtual void | finalize_subclass () |
| Function for the subclasses to do their setup. | |
| void | layout_children () |
| Inherited from tcontainer_. | |
| void | impl_draw_children (surface &frame_buffer) |
| Inherited from tcontainer_. | |
| void | impl_draw_children (surface &frame_buffer, int x_offset, int y_offset) |
| void | child_populate_dirty_list (twindow &caller, const std::vector< twidget * > &call_stack) |
| Inherited from tcontainer_. | |
| virtual void | set_content_size (const tpoint &origin, const tpoint &size) |
| Sets the size of the content grid. | |
| void | scrollbar_moved () |
| Helper function which needs to be called after the scollbar moved. | |
| const std::string & | get_control_type () const |
| Inherited from tcontrol. | |
| void | signal_handler_sdl_key_down (const event::tevent event, bool &handled, const SDLKey key, SDLMod modifier) |
| void | signal_handler_sdl_wheel_up (const event::tevent event, bool &handled) |
| void | signal_handler_sdl_wheel_down (const event::tevent event, bool &handled) |
| void | signal_handler_sdl_wheel_left (const event::tevent event, bool &handled) |
| void | signal_handler_sdl_wheel_right (const event::tevent event, bool &handled) |
Private Attributes | |
| tstate | state_ |
| Current state of the widget. | |
| tscrollbar_mode | vertical_scrollbar_mode_ |
| The mode of how to show the scrollbar. | |
| tscrollbar_mode | horizontal_scrollbar_mode_ |
| tgrid * | vertical_scrollbar_grid_ |
| These are valid after finalize_setup(). | |
| tgrid * | horizontal_scrollbar_grid_ |
| tscrollbar_ * | vertical_scrollbar_ |
| These are valid after finalize_setup(). | |
| tscrollbar_ * | horizontal_scrollbar_ |
| tgrid * | content_grid_ |
| The grid that holds the content. | |
| tspacer * | content_ |
| Dummy spacer to hold the contents location. | |
| SDL_Rect | content_visible_area_ |
| Cache for the visible area for the content. | |
Friends | |
| class | tdebug_layout_graph |
| struct | implementation::tbuilder_scroll_label |
| struct | implementation::tbuilder_scrollbar_panel |
| class | tlistbox |
| class | ttree_view |
| struct | tscrollbar_container_implementation |
Base class for creating containers with one or two scrollbar(s).
For now users can't instanciate this class directly and needs to use small wrapper classes. Maybe in the future users can use the class directly.
Definition at line 40 of file scrollbar_container.hpp.
The way to handle the showing or hiding of the scrollbar.
Definition at line 60 of file scrollbar_container.hpp.
enum gui2::tscrollbar_container::tstate [private] |
Possible states of the widget.
Note the order of the states must be the same as defined in settings.hpp.
Reimplemented in gui2::tscroll_label.
Definition at line 400 of file scrollbar_container.hpp.
| gui2::tscrollbar_container::tscrollbar_container | ( | const unsigned | canvas_count | ) | [explicit] |
Definition at line 66 of file scrollbar_container.cpp.
References signal_handler_sdl_key_down(), signal_handler_sdl_wheel_down(), signal_handler_sdl_wheel_left(), signal_handler_sdl_wheel_right(), and signal_handler_sdl_wheel_up().

| gui2::tscrollbar_container::~tscrollbar_container | ( | ) | [inline] |
Definition at line 57 of file scrollbar_container.hpp.
References content_grid_.
| tpoint gui2::tscrollbar_container::calculate_best_size | ( | ) | const [private, virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 292 of file scrollbar_container.cpp.
References content_grid_, DBG_GUI_L, gui2::twidget::get_best_size(), gui2::twidget::get_visible(), horizontal_scrollbar_grid_, gui2::twidget::INVISIBLE, gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, vertical_scrollbar_grid_, gui2::tpoint::x, and gui2::tpoint::y.

| bool gui2::tscrollbar_container::can_wrap | ( | ) | const [inline, virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 98 of file scrollbar_container.hpp.
References gui2::tgrid::can_wrap(), and content_grid_.

| void gui2::tscrollbar_container::child_populate_dirty_list | ( | twindow & | caller, | |
| const std::vector< twidget * > & | call_stack | |||
| ) | [private, virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Reimplemented in gui2::tlistbox, and gui2::ttree_view.
Definition at line 784 of file scrollbar_container.cpp.
References content_grid_, and gui2::twidget::populate_dirty_list().

| const tgrid* gui2::tscrollbar_container::content_grid | ( | ) | const [inline] |
Definition at line 157 of file scrollbar_container.hpp.
References content_grid_.
| tgrid* gui2::tscrollbar_container::content_grid | ( | ) | [inline] |
Definition at line 156 of file scrollbar_container.hpp.
References content_grid_.
Referenced by gui2::ttree_view_node::add_child(), gui2::tlistbox::finalize(), gui2::ttree_view::finalize_setup(), gui2::tscroll_label::finalize_subclass(), gui2::ttree_view::layout_children(), gui2::tlistbox::layout_children(), gui2::ttree_view::resize_content(), gui2::tlistbox::resize_content(), gui2::tlistbox::set_content_size(), gui2::tscroll_label::set_label(), and gui2::tscroll_label::set_use_markup().

| bool gui2::tscrollbar_container::content_resize_height | ( | const int | height_modification | ) | [private] |
Helper for content_resize_request.
Handle the height modification.
Definition at line 618 of file scrollbar_container.cpp.
References always_invisible, auto_visible_first_run, content_, content_grid_, DBG_GUI_L, gui2::twidget::get_height(), gui2::twidget::get_visible(), gui2::twidget::get_window(), gui2::twindow::invalidate_layout(), LOG_HEADER, gui2::set_scrollbar_mode(), vertical_scrollbar_, vertical_scrollbar_grid_, and vertical_scrollbar_mode_.
Referenced by content_resize_request().


| bool gui2::tscrollbar_container::content_resize_request | ( | const bool | force_sizing = false |
) | [protected] |
Notification if the content of a child needs a resize.
When a resize is required the container first can try to handle it itself. If it can't honour the request the function will call twindow::invalidate_layout().
| force_sizing | If the contents fit do we want to force a resize? This is needed in the MP lobby since items might not be properly placed yet. (The listboxes with the player info need it.) |
Handling it here makes the code a bit more complex but allows to not reserve space for scrollbars, which will look nicer in the MP lobby. But the extra complexity is no 1.8 material.
Definition at line 454 of file scrollbar_container.cpp.
References always_invisible, auto_visible_first_run, content_, content_grid_, DBG_GUI_L, gui2::twidget::get_origin(), gui2::twidget::get_size(), gui2::twidget::get_visible(), gui2::twidget::get_window(), horizontal_scrollbar_grid_, horizontal_scrollbar_mode_, gui2::twindow::invalidate_layout(), LOG_HEADER, place(), gui2::tgrid::recalculate_best_size(), vertical_scrollbar_grid_, vertical_scrollbar_mode_, gui2::tpoint::x, and gui2::tpoint::y.
Referenced by gui2::ttree_view::resize_content(), gui2::tlistbox::resize_content(), gui2::tscroll_label::set_label(), gui2::tlistbox::set_row_shown(), and gui2::tlistbox::update_content_size().


| bool gui2::tscrollbar_container::content_resize_request | ( | const int | width_modification, | |
| const int | height_modification | |||
| ) | [protected] |
Request from the content to modify the size of the container.
When the wanted resize fails the function will call twindow::invalidate_layout().
| width_modification | The wanted modification to the width: * negative values reduce width. * zero leave width as is. * positive values increase width. | |
| height_modification | The wanted modification to the height: * negative values reduce height. * zero leave height as is. * positive values increase height. |
Definition at line 532 of file scrollbar_container.cpp.
References content_, content_grid_, content_resize_height(), content_resize_width(), DBG_GUI_L, gui2::twindow::get_need_layout(), gui2::twidget::get_size(), gui2::twidget::get_window(), LOG_HEADER, and set_scrollbar_button_status().

| bool gui2::tscrollbar_container::content_resize_width | ( | const int | width_modification | ) | [private] |
Helper for content_resize_request.
Handle the width modification.
Definition at line 572 of file scrollbar_container.cpp.
References always_invisible, auto_visible_first_run, content_, content_grid_, DBG_GUI_L, gui2::twidget::get_visible(), gui2::twidget::get_width(), gui2::twidget::get_window(), horizontal_scrollbar_, horizontal_scrollbar_grid_, horizontal_scrollbar_mode_, gui2::twindow::invalidate_layout(), LOG_HEADER, and gui2::set_scrollbar_mode().
Referenced by content_resize_request().


| const SDL_Rect& gui2::tscrollbar_container::content_visible_area | ( | ) | const [inline] |
Definition at line 159 of file scrollbar_container.hpp.
References content_visible_area_.
Referenced by gui2::tlistbox::handle_key_down_arrow(), gui2::tlistbox::handle_key_left_arrow(), gui2::tlistbox::handle_key_right_arrow(), gui2::tlistbox::handle_key_up_arrow(), gui2::tlistbox::place(), gui2::tlistbox::set_row_shown(), and gui2::tlistbox::update_content_size().

| bool gui2::tscrollbar_container::disable_click_dismiss | ( | ) | const [virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 447 of file scrollbar_container.cpp.
References content_grid_, and gui2::tgrid::disable_click_dismiss().

| void gui2::tscrollbar_container::finalize_setup | ( | ) | [private] |
The builder needs to call us so we do our setup.
Reimplemented in gui2::ttree_view.
Definition at line 666 of file scrollbar_container.cpp.
References gui2::tclickable_::connect_click_handler(), gui2::event::connect_signal_notify_modified(), content_, content_grid_, finalize_subclass(), gui2::tcontainer_::grid(), horizontal_scrollbar_, horizontal_scrollbar_grid_, horizontal_scrollbar_moved(), scroll_horizontal_scrollbar(), scroll_vertical_scrollbar(), gui2::tcontrol::set_definition(), gui2::twidget::set_parent(), gui2::tgrid::swap_child(), vertical_scrollbar_, vertical_scrollbar_grid_, and vertical_scrollbar_moved().
Referenced by gui2::tlistbox::finalize().


| virtual void gui2::tscrollbar_container::finalize_subclass | ( | ) | [inline, private, virtual] |
Function for the subclasses to do their setup.
This function is called at the end of finalize_setup().
Reimplemented in gui2::tscroll_label.
Definition at line 451 of file scrollbar_container.hpp.
Referenced by finalize_setup().

| twidget * gui2::tscrollbar_container::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | [virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 433 of file scrollbar_container.cpp.
| const twidget * gui2::tscrollbar_container::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | const [virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontainer_.
Definition at line 440 of file scrollbar_container.cpp.
| twidget * gui2::tscrollbar_container::find_at | ( | const tpoint & | coordinate, | |
| const bool | must_be_active | |||
| ) | [virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 419 of file scrollbar_container.cpp.
| const twidget * gui2::tscrollbar_container::find_at | ( | const tpoint & | coordinate, | |
| const bool | must_be_active | |||
| ) | const [virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 426 of file scrollbar_container.cpp.
| bool gui2::tscrollbar_container::get_active | ( | ) | const [inline, virtual] |
Inherited from tcontainer_.
Implements gui2::tcontrol.
Reimplemented in gui2::tscroll_label, and gui2::tscrollbar_panel.
Definition at line 123 of file scrollbar_container.hpp.
References state_.
| const std::string & gui2::tscrollbar_container::get_control_type | ( | ) | const [private, virtual] |
Inherited from tcontrol.
Implements gui2::tcontrol.
Reimplemented in gui2::tlistbox, gui2::tscroll_label, gui2::tscrollbar_panel, and gui2::ttree_view.
Definition at line 1041 of file scrollbar_container.cpp.
References type.
| tscrollbar_mode gui2::tscrollbar_container::get_horizontal_scrollbar_mode | ( | ) | const [inline] |
Definition at line 153 of file scrollbar_container.hpp.
References horizontal_scrollbar_mode_.
| unsigned gui2::tscrollbar_container::get_state | ( | ) | const [inline, virtual] |
Inherited from tcontainer_.
Implements gui2::tcontrol.
Reimplemented in gui2::tscroll_label, and gui2::tscrollbar_panel.
Definition at line 126 of file scrollbar_container.hpp.
References state_.
| tscrollbar_mode gui2::tscrollbar_container::get_vertical_scrollbar_mode | ( | ) | const [inline] |
Definition at line 148 of file scrollbar_container.hpp.
References vertical_scrollbar_mode_.
| void gui2::tscrollbar_container::handle_key_down_arrow | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
Down arrow key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Reimplemented in gui2::tlistbox.
Definition at line 980 of file scrollbar_container.cpp.
References gui2::tscrollbar_::ITEM_FORWARD, gui2::tscrollbar_::scroll(), scrollbar_moved(), and vertical_scrollbar_.
Referenced by signal_handler_sdl_key_down().


| void gui2::tscrollbar_container::handle_key_end | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
End key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Definition at line 935 of file scrollbar_container.cpp.
References gui2::tscrollbar_::END, gui2::tscrollbar_::scroll(), scrollbar_moved(), and vertical_scrollbar_.
Referenced by signal_handler_sdl_key_down().


| void gui2::tscrollbar_container::handle_key_home | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
Home key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Definition at line 924 of file scrollbar_container.cpp.
References gui2::tscrollbar_::BEGIN, horizontal_scrollbar_, gui2::tscrollbar_::scroll(), scrollbar_moved(), and vertical_scrollbar_.
Referenced by signal_handler_sdl_key_down().


| void gui2::tscrollbar_container::handle_key_left_arrow | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
Left arrow key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Reimplemented in gui2::tlistbox.
Definition at line 991 of file scrollbar_container.cpp.
References gui2::tscrollbar_::ITEM_BACKWARDS.
Referenced by signal_handler_sdl_key_down().

| void gui2::tscrollbar_container::handle_key_page_down | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
Page down key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Definition at line 957 of file scrollbar_container.cpp.
References gui2::tscrollbar_::JUMP_FORWARD, gui2::tscrollbar_::scroll(), scrollbar_moved(), and vertical_scrollbar_.
Referenced by signal_handler_sdl_key_down().


| void gui2::tscrollbar_container::handle_key_page_up | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
Page up key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Definition at line 946 of file scrollbar_container.cpp.
References gui2::tscrollbar_::JUMP_BACKWARDS, gui2::tscrollbar_::scroll(), scrollbar_moved(), and vertical_scrollbar_.
Referenced by signal_handler_sdl_key_down().


| void gui2::tscrollbar_container::handle_key_right_arrow | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
Right arrow key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Reimplemented in gui2::tlistbox.
Definition at line 1002 of file scrollbar_container.cpp.
References gui2::tscrollbar_::ITEM_FORWARD.
Referenced by signal_handler_sdl_key_down().

| void gui2::tscrollbar_container::handle_key_up_arrow | ( | SDLMod | modifier, | |
| bool & | handled | |||
| ) | [protected, virtual] |
Up arrow key pressed.
| modifier | The SDL keyboard modifier when the key was pressed. | |
| handled | If the function handles the key it should set handled to true else do not modify it. This is used in the keyboard event changing. |
Reimplemented in gui2::tlistbox.
Definition at line 969 of file scrollbar_container.cpp.
References gui2::tscrollbar_::ITEM_BACKWARDS, gui2::tscrollbar_::scroll(), scrollbar_moved(), and vertical_scrollbar_.
Referenced by signal_handler_sdl_key_down().


| void gui2::tscrollbar_container::horizontal_scrollbar_moved | ( | ) | [inline] |
Definition at line 185 of file scrollbar_container.hpp.
References scrollbar_moved().
Referenced by finalize_setup().


| void gui2::tscrollbar_container::impl_draw_children | ( | surface & | frame_buffer | ) | [private, virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 750 of file scrollbar_container.cpp.
References content_grid_, gui2::twidget::draw_children(), gui2::twidget::get_visible(), and gui2::twidget::VISIBLE.
Referenced by impl_draw_children().


| void gui2::tscrollbar_container::impl_draw_children | ( | surface & | frame_buffer, | |
| int | x_offset, | |||
| int | y_offset | |||
| ) | [private, virtual] |
Reimplemented from gui2::tcontainer_.
Definition at line 761 of file scrollbar_container.cpp.
References content_grid_, gui2::twidget::draw_children(), gui2::twidget::get_visible(), impl_draw_children(), and gui2::twidget::VISIBLE.

| void gui2::tscrollbar_container::layout_children | ( | ) | [private, virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Reimplemented in gui2::tlistbox, and gui2::ttree_view.
Definition at line 775 of file scrollbar_container.cpp.
References content_grid_, and gui2::tgrid::layout_children().

| void gui2::tscrollbar_container::layout_init | ( | const bool | full_initialization | ) | [virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 117 of file scrollbar_container.cpp.
References always_visible, auto_visible, content_grid_, gui2::twidget::HIDDEN, horizontal_scrollbar_grid_, horizontal_scrollbar_mode_, gui2::twidget::INVISIBLE, gui2::tgrid::layout_init(), gui2::twidget::set_visible(), vertical_scrollbar_grid_, vertical_scrollbar_mode_, and gui2::twidget::VISIBLE.

Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Reimplemented in gui2::tlistbox.
Definition at line 353 of file scrollbar_container.cpp.
References content_, content_grid_, content_visible_area_, gui2::twidget::get_best_size(), gui2::twidget::get_height(), gui2::twidget::get_origin(), gui2::twidget::get_rect(), gui2::twidget::get_width(), horizontal_scrollbar_, horizontal_scrollbar_grid_, horizontal_scrollbar_mode_, set_content_size(), set_scrollbar_button_status(), gui2::set_scrollbar_mode(), gui2::tgrid::set_visible_area(), vertical_scrollbar_, vertical_scrollbar_grid_, vertical_scrollbar_mode_, gui2::tpoint::x, and gui2::tpoint::y.
Referenced by content_resize_request().


| void gui2::tscrollbar_container::request_reduce_height | ( | const unsigned | maximum_height | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::tcontainer_.
Definition at line 157 of file scrollbar_container.cpp.
References always_invisible, content_grid_, DBG_GUI_L, gui2::twidget::get_best_size(), gui2::twidget::get_visible(), horizontal_scrollbar_grid_, gui2::twidget::INVISIBLE, LOG_HEADER, gui2::tgrid::request_reduce_height(), gui2::twidget::set_layout_size(), gui2::twidget::set_visible(), vertical_scrollbar_grid_, vertical_scrollbar_mode_, gui2::twidget::VISIBLE, and gui2::tpoint::y.

| void gui2::tscrollbar_container::request_reduce_width | ( | const unsigned | maximum_width | ) | [virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontainer_.
Definition at line 229 of file scrollbar_container.cpp.
References always_invisible, auto_visible_first_run, content_grid_, DBG_GUI_L, gui2::twidget::get_best_size(), gui2::twidget::get_visible(), horizontal_scrollbar_grid_, horizontal_scrollbar_mode_, gui2::twidget::INVISIBLE, LOG_HEADER, gui2::tgrid::request_reduce_width(), gui2::twidget::set_layout_size(), gui2::twidget::set_visible(), vertical_scrollbar_grid_, gui2::twidget::VISIBLE, and gui2::tpoint::x.

| void gui2::tscrollbar_container::scroll_horizontal_scrollbar | ( | const tscrollbar_::tscroll | scroll | ) |
Scrolls the horizontal scrollbar.
| scroll | The position to scroll to. |
Definition at line 915 of file scrollbar_container.cpp.
References horizontal_scrollbar_, gui2::tscrollbar_::scroll(), and scrollbar_moved().
Referenced by finalize_setup().


| void gui2::tscrollbar_container::scroll_vertical_scrollbar | ( | const tscrollbar_::tscroll | scroll | ) |
Scrolls the vertical scrollbar.
| scroll | The position to scroll to. |
Definition at line 906 of file scrollbar_container.cpp.
References gui2::tscrollbar_::scroll(), scrollbar_moved(), and vertical_scrollbar_.
Referenced by gui2::tlobby_main::append_to_chatbox(), and finalize_setup().


| void gui2::tscrollbar_container::scrollbar_moved | ( | ) | [private] |
Helper function which needs to be called after the scollbar moved.
Definition at line 1012 of file scrollbar_container.cpp.
References always_invisible, content_, content_grid_, content_visible_area_, gui2::tscrollbar_::get_item_position(), gui2::tscrollbar_::get_step_size(), gui2::twidget::get_x(), gui2::twidget::get_y(), horizontal_scrollbar_, horizontal_scrollbar_mode_, gui2::twidget::set_dirty(), gui2::tgrid::set_origin(), set_scrollbar_button_status(), gui2::tgrid::set_visible_area(), vertical_scrollbar_, and vertical_scrollbar_mode_.
Referenced by handle_key_down_arrow(), handle_key_end(), handle_key_home(), handle_key_page_down(), handle_key_page_up(), handle_key_up_arrow(), horizontal_scrollbar_moved(), scroll_horizontal_scrollbar(), scroll_vertical_scrollbar(), show_content_rect(), signal_handler_sdl_wheel_down(), signal_handler_sdl_wheel_left(), signal_handler_sdl_wheel_right(), signal_handler_sdl_wheel_up(), and vertical_scrollbar_moved().


| void gui2::tscrollbar_container::set_content_size | ( | const tpoint & | origin, | |
| const tpoint & | size | |||
| ) | [private, virtual] |
Sets the size of the content grid.
This function normally just updates the content grid but can be overridden by a subclass.
| origin | The origin for the content. | |
| size | The size of the content. |
Reimplemented in gui2::tlistbox.
Definition at line 795 of file scrollbar_container.cpp.
References content_grid_, and gui2::tgrid::place().
Referenced by place().


| void gui2::tscrollbar_container::set_horizontal_scrollbar_mode | ( | const tscrollbar_mode | scrollbar_mode | ) |
Definition at line 743 of file scrollbar_container.cpp.
References horizontal_scrollbar_mode_.
| void gui2::tscrollbar_container::set_origin | ( | const tpoint & | origin | ) | [virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 392 of file scrollbar_container.cpp.
References content_, content_grid_, content_visible_area_, gui2::twidget::get_origin(), gui2::tgrid::set_origin(), and gui2::tgrid::set_visible_area().

| void gui2::tscrollbar_container::set_scrollbar_button_status | ( | ) | [protected] |
Sets the status of the scrollbar buttons.
This is needed after the scrollbar moves so the status of the buttons will be active or inactive as needed.
Definition at line 851 of file scrollbar_container.cpp.
References gui2::tscrollbar_::all_items_visible(), gui2::tscrollbar_::at_begin(), gui2::tscrollbar_::at_end(), horizontal_scrollbar_, horizontal_scrollbar_grid_, gui2::tscrollbar_::set_active(), gui2::tcontrol::set_active(), vertical_scrollbar_, and vertical_scrollbar_grid_.
Referenced by content_resize_request(), place(), and scrollbar_moved().


| void gui2::tscrollbar_container::set_vertical_scrollbar_mode | ( | const tscrollbar_mode | scrollbar_mode | ) |
Definition at line 735 of file scrollbar_container.cpp.
References vertical_scrollbar_mode_.
| void gui2::tscrollbar_container::set_visible_area | ( | const SDL_Rect & | area | ) | [virtual] |
Inherited from tcontainer_.
Reimplemented from gui2::tcontainer_.
Definition at line 408 of file scrollbar_container.cpp.
References content_, content_grid_, content_visible_area_, gui2::twidget::get_rect(), intersect_rects(), and gui2::tgrid::set_visible_area().

| void gui2::tscrollbar_container::show_content_rect | ( | const SDL_Rect & | rect | ) | [protected] |
Shows a certain part of the content.
When the part to be shown is bigger as the visible viewport the top left of the wanted rect will be the top left of the viewport.
| rect | The rect which should be visible. |
Definition at line 801 of file scrollbar_container.cpp.
References content_, gui2::distance(), gui2::twidget::get_height(), gui2::tscrollbar_::get_item_position(), gui2::twidget::get_width(), gui2::twidget::get_x(), gui2::twidget::get_y(), horizontal_scrollbar_, scrollbar_moved(), gui2::tscrollbar_::set_item_position(), and vertical_scrollbar_.
Referenced by gui2::tlistbox::handle_key_down_arrow(), gui2::tlistbox::handle_key_left_arrow(), gui2::tlistbox::handle_key_right_arrow(), gui2::tlistbox::handle_key_up_arrow(), and gui2::tlistbox::place().


| void gui2::tscrollbar_container::signal_handler_sdl_key_down | ( | const event::tevent | event, | |
| bool & | handled, | |||
| const SDLKey | key, | |||
| SDLMod | modifier | |||
| ) | [private] |
Definition at line 1047 of file scrollbar_container.cpp.
References DBG_GUI_E, handle_key_down_arrow(), handle_key_end(), handle_key_home(), handle_key_left_arrow(), handle_key_page_down(), handle_key_page_up(), handle_key_right_arrow(), handle_key_up_arrow(), and LOG_HEADER.
Referenced by tscrollbar_container().


| void gui2::tscrollbar_container::signal_handler_sdl_wheel_down | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 1110 of file scrollbar_container.cpp.
References DBG_GUI_E, gui2::twidget::get_visible(), gui2::tscrollbar_::HALF_JUMP_FORWARD, LOG_HEADER, gui2::tscrollbar_::scroll(), scrollbar_moved(), vertical_scrollbar_, and vertical_scrollbar_grid_.
Referenced by tscrollbar_container().


| void gui2::tscrollbar_container::signal_handler_sdl_wheel_left | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 1125 of file scrollbar_container.cpp.
References DBG_GUI_E, gui2::twidget::get_visible(), gui2::tscrollbar_::HALF_JUMP_BACKWARDS, horizontal_scrollbar_, horizontal_scrollbar_grid_, LOG_HEADER, gui2::tscrollbar_::scroll(), and scrollbar_moved().
Referenced by tscrollbar_container().


| void gui2::tscrollbar_container::signal_handler_sdl_wheel_right | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 1140 of file scrollbar_container.cpp.
References DBG_GUI_E, gui2::twidget::get_visible(), gui2::tscrollbar_::HALF_JUMP_FORWARD, horizontal_scrollbar_, horizontal_scrollbar_grid_, LOG_HEADER, gui2::tscrollbar_::scroll(), and scrollbar_moved().
Referenced by tscrollbar_container().


| void gui2::tscrollbar_container::signal_handler_sdl_wheel_up | ( | const event::tevent | event, | |
| bool & | handled | |||
| ) | [private] |
Definition at line 1095 of file scrollbar_container.cpp.
References DBG_GUI_E, gui2::twidget::get_visible(), gui2::tscrollbar_::HALF_JUMP_BACKWARDS, LOG_HEADER, gui2::tscrollbar_::scroll(), scrollbar_moved(), vertical_scrollbar_, and vertical_scrollbar_grid_.
Referenced by tscrollbar_container().


| void gui2::tscrollbar_container::vertical_scrollbar_moved | ( | ) | [inline] |
Callback when the scrollbar moves (NOTE maybe only one callback needed).
Maybe also make protected or private and add a friend.
Definition at line 182 of file scrollbar_container.hpp.
References scrollbar_moved().
Referenced by finalize_setup().


friend struct implementation::tbuilder_scroll_label [friend] |
Reimplemented in gui2::tscroll_label.
Definition at line 45 of file scrollbar_container.hpp.
friend struct implementation::tbuilder_scrollbar_panel [friend] |
Reimplemented in gui2::tscrollbar_panel.
Definition at line 46 of file scrollbar_container.hpp.
friend class tdebug_layout_graph [friend] |
Reimplemented from gui2::tcontainer_.
Reimplemented in gui2::tlistbox.
Definition at line 43 of file scrollbar_container.hpp.
friend class tlistbox [friend] |
Definition at line 48 of file scrollbar_container.hpp.
friend struct tscrollbar_container_implementation [friend] |
Definition at line 51 of file scrollbar_container.hpp.
friend class ttree_view [friend] |
Definition at line 50 of file scrollbar_container.hpp.
tspacer* gui2::tscrollbar_container::content_ [private] |
Dummy spacer to hold the contents location.
Definition at line 434 of file scrollbar_container.hpp.
Referenced by content_resize_height(), content_resize_request(), content_resize_width(), finalize_setup(), place(), scrollbar_moved(), set_origin(), set_visible_area(), and show_content_rect().
tgrid* gui2::tscrollbar_container::content_grid_ [private] |
The grid that holds the content.
Definition at line 431 of file scrollbar_container.hpp.
Referenced by calculate_best_size(), can_wrap(), child_populate_dirty_list(), content_grid(), content_resize_height(), content_resize_request(), content_resize_width(), disable_click_dismiss(), finalize_setup(), impl_draw_children(), layout_children(), layout_init(), place(), request_reduce_height(), request_reduce_width(), scrollbar_moved(), set_content_size(), set_origin(), gui2::tlistbox::set_row_shown(), set_visible_area(), gui2::tlistbox::update_content_size(), and ~tscrollbar_container().
SDL_Rect gui2::tscrollbar_container::content_visible_area_ [private] |
Cache for the visible area for the content.
The visible area for the content needs to be updated when scrolling.
Definition at line 441 of file scrollbar_container.hpp.
Referenced by content_visible_area(), gui2::ttree_view::layout_children(), gui2::tlistbox::layout_children(), place(), scrollbar_moved(), set_origin(), and set_visible_area().
Definition at line 427 of file scrollbar_container.hpp.
Referenced by content_resize_width(), finalize_setup(), handle_key_home(), place(), scroll_horizontal_scrollbar(), scrollbar_moved(), set_scrollbar_button_status(), show_content_rect(), signal_handler_sdl_wheel_left(), and signal_handler_sdl_wheel_right().
Definition at line 422 of file scrollbar_container.hpp.
Referenced by calculate_best_size(), content_resize_request(), content_resize_width(), finalize_setup(), layout_init(), place(), request_reduce_height(), request_reduce_width(), set_scrollbar_button_status(), signal_handler_sdl_wheel_left(), and signal_handler_sdl_wheel_right().
Definition at line 417 of file scrollbar_container.hpp.
Referenced by content_resize_request(), content_resize_width(), get_horizontal_scrollbar_mode(), layout_init(), place(), request_reduce_width(), scrollbar_moved(), and set_horizontal_scrollbar_mode().
tstate gui2::tscrollbar_container::state_ [private] |
Current state of the widget.
The state of the widget determines what to render and how the widget reacts to certain 'events'.
Reimplemented in gui2::tscroll_label.
Definition at line 408 of file scrollbar_container.hpp.
Referenced by get_active(), and get_state().
These are valid after finalize_setup().
Definition at line 427 of file scrollbar_container.hpp.
Referenced by content_resize_height(), finalize_setup(), handle_key_down_arrow(), handle_key_end(), handle_key_home(), handle_key_page_down(), handle_key_page_up(), handle_key_up_arrow(), place(), scroll_vertical_scrollbar(), scrollbar_moved(), set_scrollbar_button_status(), show_content_rect(), signal_handler_sdl_wheel_down(), and signal_handler_sdl_wheel_up().
These are valid after finalize_setup().
Definition at line 422 of file scrollbar_container.hpp.
Referenced by calculate_best_size(), content_resize_height(), content_resize_request(), finalize_setup(), layout_init(), place(), request_reduce_height(), request_reduce_width(), set_scrollbar_button_status(), signal_handler_sdl_wheel_down(), and signal_handler_sdl_wheel_up().
The mode of how to show the scrollbar.
This value should only be modified before showing, doing it while showing results in UB.
Definition at line 417 of file scrollbar_container.hpp.
Referenced by content_resize_height(), content_resize_request(), get_vertical_scrollbar_mode(), layout_init(), place(), request_reduce_height(), scrollbar_moved(), and set_vertical_scrollbar_mode().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:23:22 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |