A generic container base class. More...
#include <container.hpp>


Public Member Functions | |
| tcontainer_ (const unsigned canvas_count) | |
| virtual SDL_Rect | get_client_rect () const |
| Returns the size of the client area. | |
| void | layout_init (const bool full_initialization) |
| Inherited from tcontrol. | |
| void | reduce_width (const unsigned maximum_width) |
| Tries to reduce the width of a container. | |
| void | request_reduce_width (const unsigned maximum_width) |
| Inherited from tcontrol. | |
| void | demand_reduce_width (const unsigned maximum_width) |
| Inherited from twidget. | |
| void | reduce_height (const unsigned maximum_height) |
| Tries to reduce the height of a container. | |
| void | request_reduce_height (const unsigned maximum_height) |
| Inherited from twidget. | |
| void | demand_reduce_height (const unsigned maximum_height) |
| Inherited from twidget. | |
| bool | can_wrap () const |
| Inherited from twidget. | |
| void | place (const tpoint &origin, const tpoint &size) |
| Inherited from twidget. | |
| bool | has_widget (const twidget *widget) const |
| Inherited from twidget. | |
| void | set_origin (const tpoint &origin) |
| Inherited from twidget. | |
| void | set_visible_area (const SDL_Rect &area) |
| Inherited from twidget. | |
| void | impl_draw_children (surface &frame_buffer) |
| Inherited from twidget. | |
| void | impl_draw_children (surface &frame_buffer, int x_offset, int y_offset) |
| twidget * | find_at (const tpoint &coordinate, const bool must_be_active) |
| Inherited from tcontrol. | |
| const twidget * | find_at (const tpoint &coordinate, const bool must_be_active) const |
| Inherited from tcontrol. | |
| twidget * | find (const std::string &id, const bool must_be_active) |
| Inherited from tcontrol. | |
| const twidget * | find (const std::string &id, const bool must_be_active) const |
| Inherited from tcontrol. | |
| void | set_active (const bool active) |
| Inherited from tcontrol. | |
| bool | disable_click_dismiss () const |
| Inherited from tcontrol. | |
| virtual iterator::twalker_ * | create_walker () |
| Inherited from twidget. | |
| void | init_grid (const boost::intrusive_ptr< tbuilder_grid > &grid_builder) |
| Initializes and builds the grid. | |
| tgrid::iterator | begin () |
| tgrid::iterator | end () |
| unsigned | add_row (const unsigned count=1) |
| void | set_rows (const unsigned rows) |
| unsigned int | get_rows () const |
| void | set_cols (const unsigned cols) |
| unsigned int | get_cols () const |
| void | set_rows_cols (const unsigned rows, const unsigned cols) |
| void | set_child (twidget *widget, const unsigned row, const unsigned col, const unsigned flags, const unsigned border_size) |
| void | set_row_grow_factor (const unsigned row, const unsigned factor) |
| void | set_column_grow_factor (const unsigned column, const unsigned factor) |
| const tgrid & | grid () const |
| tgrid & | grid () |
Protected Member Functions | |
| void | layout_children () |
| Inherited from twidget. | |
| void | child_populate_dirty_list (twindow &caller, const std::vector< twidget * > &call_stack) |
| Inherited from twidget. | |
Private Member Functions | |
| tpoint | calculate_best_size () const |
| Inherited from twidget. | |
| virtual tgrid & | initial_grid () |
| Returns the grid to initialize while building. | |
| virtual tpoint | border_space () const |
| Returns the space used by the border. | |
| virtual void | set_self_active (const bool active)=0 |
| Helper for set_active. | |
Private Attributes | |
| tgrid | grid_ |
| The grid which holds the child objects. | |
Friends | |
| class | tdebug_layout_graph |
A generic container base class.
A container is a class build with multiple items either acting as one widget.
Definition at line 32 of file container.hpp.
| gui2::tcontainer_::tcontainer_ | ( | const unsigned | canvas_count | ) | [inline, explicit] |
Definition at line 36 of file container.hpp.
References grid_, and gui2::twidget::set_parent().

| unsigned gui2::tcontainer_::add_row | ( | const unsigned | count = 1 |
) | [inline] |
Definition at line 174 of file container.hpp.
References gui2::tgrid::add_row(), preferences::editor::TransitionUpdateMode::count, and grid_.

| tgrid::iterator gui2::tcontainer_::begin | ( | ) | [inline] |
Definition at line 171 of file container.hpp.
References gui2::tgrid::begin(), and grid_.

| virtual tpoint gui2::tcontainer_::border_space | ( | ) | const [inline, private, virtual] |
Returns the space used by the border.
Reimplemented in gui2::tpanel.
Definition at line 217 of file container.hpp.
Referenced by calculate_best_size(), demand_reduce_height(), demand_reduce_width(), reduce_height(), reduce_width(), request_reduce_height(), and request_reduce_width().

| tpoint gui2::tcontainer_::calculate_best_size | ( | ) | const [private, virtual] |
Inherited from twidget.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 76 of file container.cpp.
References border_space(), DBG_GUI_L, gui2::twidget::get_best_size(), grid_, gui2::log_gui_layout, LOG_HEADER, log_scope2, and LOG_SCOPE_HEADER.

| bool gui2::tcontainer_::can_wrap | ( | ) | const [inline, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tscrollbar_container.
Definition at line 91 of file container.hpp.
References gui2::tgrid::can_wrap(), and grid_.

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

| virtual iterator::twalker_* gui2::tcontainer_::create_walker | ( | ) | [inline, virtual] |
Inherited from twidget.
Reimplemented from gui2::tcontrol.
Definition at line 157 of file container.hpp.
| void gui2::tcontainer_::demand_reduce_height | ( | const unsigned | maximum_height | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 61 of file container.cpp.
References border_space(), gui2::tgrid::demand_reduce_height(), and grid_.

| void gui2::tcontainer_::demand_reduce_width | ( | const unsigned | maximum_width | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 46 of file container.cpp.
References border_space(), gui2::tgrid::demand_reduce_width(), and grid_.

| bool gui2::tcontainer_::disable_click_dismiss | ( | ) | const [virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 165 of file container.cpp.
References gui2::tgrid::disable_click_dismiss(), and grid_.
Referenced by gui2::twindow::does_click_dismiss(), and gui2::twindow::layout().


| tgrid::iterator gui2::tcontainer_::end | ( | ) | [inline] |
Definition at line 172 of file container.hpp.
References gui2::tgrid::end(), and grid_.

| twidget* gui2::tcontainer_::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | [inline, virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 133 of file container.hpp.
References gui2::tgrid::find(), and grid_.
Referenced by find(), and gui2::ttoggle_panel::set_child_members().


| const twidget* gui2::tcontainer_::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | const [inline, virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 140 of file container.hpp.
References gui2::tgrid::find(), find(), and grid_.

| twidget* gui2::tcontainer_::find_at | ( | const tpoint & | coordinate, | |
| const bool | must_be_active | |||
| ) | [inline, virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 124 of file container.hpp.
References gui2::tgrid::find_at(), and grid_.

| const twidget* gui2::tcontainer_::find_at | ( | const tpoint & | coordinate, | |
| const bool | must_be_active | |||
| ) | const [inline, virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 128 of file container.hpp.
References gui2::tgrid::find_at(), and grid_.

| virtual SDL_Rect gui2::tcontainer_::get_client_rect | ( | ) | const [inline, virtual] |
Returns the size of the client area.
The client area is the area available for widgets.
Reimplemented in gui2::tpanel.
Definition at line 48 of file container.hpp.
References gui2::twidget::get_rect().
Referenced by place(), and set_origin().


| unsigned int gui2::tcontainer_::get_cols | ( | ) | const [inline] |
Definition at line 181 of file container.hpp.
References gui2::tgrid::get_cols(), and grid_.
Referenced by init_grid().


| unsigned int gui2::tcontainer_::get_rows | ( | ) | const [inline] |
Definition at line 178 of file container.hpp.
References gui2::tgrid::get_rows(), and grid_.
Referenced by init_grid().


| tgrid& gui2::tcontainer_::grid | ( | ) | [inline] |
Definition at line 202 of file container.hpp.
References grid_.
| const tgrid& gui2::tcontainer_::grid | ( | ) | const [inline] |
Definition at line 201 of file container.hpp.
References grid_.
Referenced by gui2::twindow::finalize(), gui2::tstacked_widget::finalize(), gui2::tmulti_page::finalize(), gui2::tlistbox::finalize(), gui2::tscrollbar_container::finalize_setup(), and gui2::twindow::~twindow().

| bool gui2::tcontainer_::has_widget | ( | const twidget * | widget | ) | const [inline, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 99 of file container.hpp.
References grid_, and gui2::tgrid::has_widget().

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

| void gui2::tcontainer_::impl_draw_children | ( | surface & | frame_buffer | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tscrollbar_container.
Definition at line 119 of file container.cpp.
References gui2::twidget::draw_children(), gui2::twidget::get_visible(), grid_, and gui2::twidget::VISIBLE.

| void gui2::tcontainer_::init_grid | ( | const boost::intrusive_ptr< tbuilder_grid > & | grid_builder | ) |
Initializes and builds the grid.
This function should only be called upon an empty grid. This grid is returned by initial_grid();
| grid_builder | The builder for the grid. |
Definition at line 170 of file container.cpp.
References get_cols(), get_rows(), initial_grid(), gui2::log_gui_general, log_scope2, and LOG_SCOPE_HEADER.

| virtual tgrid& gui2::tcontainer_::initial_grid | ( | ) | [inline, private, virtual] |
Returns the grid to initialize while building.
Definition at line 214 of file container.hpp.
References grid_.
Referenced by init_grid().

| void gui2::tcontainer_::layout_children | ( | ) | [protected, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tlistbox, gui2::tscrollbar_container, gui2::tstacked_widget, and gui2::ttree_view.
Definition at line 138 of file container.cpp.
References grid_, and gui2::tgrid::layout_children().
Referenced by gui2::twindow::draw().


| void gui2::tcontainer_::layout_init | ( | const bool | full_initialization | ) | [virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 28 of file container.cpp.
References grid_, and gui2::tgrid::layout_init().
Referenced by gui2::twindow_implementation::layout(), and gui2::twindow::layout().


Inherited from twidget.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tlistbox, and gui2::tscrollbar_container.
Definition at line 66 of file container.cpp.
References get_client_rect(), grid_, and gui2::tgrid::place().
Referenced by gui2::twindow::layout().


| void gui2::tcontainer_::reduce_height | ( | const unsigned | maximum_height | ) |
Tries to reduce the height of a container.
| maximum_height | The wanted maximum height. |
Definition at line 51 of file container.cpp.
References border_space(), grid_, and gui2::tgrid::reduce_height().
Referenced by gui2::twindow_implementation::layout().


| void gui2::tcontainer_::reduce_width | ( | const unsigned | maximum_width | ) |
Tries to reduce the width of a container.
| maximum_width | The wanted maximum width. |
Definition at line 36 of file container.cpp.
References border_space(), grid_, and gui2::tgrid::reduce_width().
Referenced by gui2::twindow_implementation::layout().


| void gui2::tcontainer_::request_reduce_height | ( | const unsigned | maximum_height | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tscrollbar_container.
Definition at line 56 of file container.cpp.
References border_space(), grid_, and gui2::tgrid::request_reduce_height().

| void gui2::tcontainer_::request_reduce_width | ( | const unsigned | maximum_width | ) | [virtual] |
Inherited from tcontrol.
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tscrollbar_container.
Definition at line 41 of file container.cpp.
References border_space(), grid_, and gui2::tgrid::request_reduce_width().

| void gui2::tcontainer_::set_active | ( | const bool | active | ) | [virtual] |
Inherited from tcontrol.
Implements gui2::tcontrol.
Definition at line 150 of file container.cpp.
References gui2::tcontrol::get_active(), grid_, gui2::tgrid::set_active(), gui2::twidget::set_dirty(), and set_self_active().

| void gui2::tcontainer_::set_child | ( | twidget * | widget, | |
| const unsigned | row, | |||
| const unsigned | col, | |||
| const unsigned | flags, | |||
| const unsigned | border_size | |||
| ) | [inline] |
Definition at line 186 of file container.hpp.
References grid_, and gui2::tgrid::set_child().

| void gui2::tcontainer_::set_cols | ( | const unsigned | cols | ) | [inline] |
Definition at line 180 of file container.hpp.
References grid_, and gui2::tgrid::set_cols().

| void gui2::tcontainer_::set_column_grow_factor | ( | const unsigned | column, | |
| const unsigned | factor | |||
| ) | [inline] |
Definition at line 193 of file container.hpp.
References grid_, and gui2::tgrid::set_column_grow_factor().

| void gui2::tcontainer_::set_origin | ( | const tpoint & | origin | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tscrollbar_container.
Definition at line 101 of file container.cpp.
References get_client_rect(), grid_, and gui2::tgrid::set_origin().

| void gui2::tcontainer_::set_row_grow_factor | ( | const unsigned | row, | |
| const unsigned | factor | |||
| ) | [inline] |
Definition at line 190 of file container.hpp.
References grid_, and gui2::tgrid::set_row_grow_factor().

| void gui2::tcontainer_::set_rows | ( | const unsigned | rows | ) | [inline] |
Definition at line 177 of file container.hpp.
References grid_, and gui2::tgrid::set_rows().

| void gui2::tcontainer_::set_rows_cols | ( | const unsigned | rows, | |
| const unsigned | cols | |||
| ) | [inline] |
Definition at line 183 of file container.hpp.
References grid_, and gui2::tgrid::set_rows_cols().

| virtual void gui2::tcontainer_::set_self_active | ( | const bool | active | ) | [private, pure virtual] |
Helper for set_active.
This function should set the control itself active. It's called by set_active if the state needs to change. The widget is set to dirty() by set_active so we only need to change the state.
Implemented in gui2::tlistbox, gui2::tmulti_page, gui2::tpanel, gui2::tscroll_label, gui2::tscrollbar_panel, gui2::tstacked_widget, and gui2::ttree_view.
Referenced by set_active().

| void gui2::tcontainer_::set_visible_area | ( | const SDL_Rect & | area | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Reimplemented in gui2::tscrollbar_container.
Definition at line 111 of file container.cpp.
References grid_, and gui2::tgrid::set_visible_area().

friend class tdebug_layout_graph [friend] |
Reimplemented from gui2::tcontrol.
Reimplemented in gui2::tlistbox, gui2::tmulti_page, gui2::tscrollbar_container, and gui2::tstacked_widget.
Definition at line 34 of file container.hpp.
tgrid gui2::tcontainer_::grid_ [private] |
The grid which holds the child objects.
Definition at line 207 of file container.hpp.
Referenced by add_row(), begin(), calculate_best_size(), can_wrap(), child_populate_dirty_list(), demand_reduce_height(), demand_reduce_width(), disable_click_dismiss(), end(), find(), find_at(), get_cols(), get_rows(), grid(), has_widget(), impl_draw_children(), initial_grid(), layout_children(), layout_init(), place(), reduce_height(), reduce_width(), request_reduce_height(), request_reduce_width(), set_active(), set_child(), set_cols(), set_column_grow_factor(), set_origin(), set_row_grow_factor(), set_rows(), set_rows_cols(), set_visible_area(), and tcontainer_().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:42 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |