Base container class. More...
#include <grid.hpp>


Classes | |
| class | iterator |
| Iterator for the tchild items. More... | |
| class | tchild |
| Child item of the grid. More... | |
Public Member Functions | |
| tgrid (const unsigned rows=0, const unsigned cols=0) | |
| virtual | ~tgrid () |
| unsigned | add_row (const unsigned count=1) |
| Addes a row to end of the grid. | |
| void | set_row_grow_factor (const unsigned row, const unsigned factor) |
| Sets the grow factor for a row. | |
| void | set_column_grow_factor (const unsigned column, const unsigned factor) |
| Sets the grow factor for a column. | |
| void | set_child (twidget *widget, const unsigned row, const unsigned col, const unsigned flags, const unsigned border_size) |
| Sets a child in the grid. | |
| twidget * | swap_child (const std::string &id, twidget *widget, const bool recurse, twidget *new_parent=NULL) |
| Exchangs a child in the grid. | |
| void | remove_child (const unsigned row, const unsigned col) |
| Removes and frees a widget in a cell. | |
| void | remove_child (const std::string &id, const bool find_all=false) |
| Removes and frees a widget in a cell by it's id. | |
| void | set_active (const bool active) |
| Activates all children. | |
| const twidget * | widget (const unsigned row, const unsigned col) const |
| Returns the widget in the selected cell. | |
| twidget * | widget (const unsigned row, const unsigned col) |
| Returns the widget in the selected cell. | |
| void | layout_init (const bool full_initialization) |
| Inherited from twidget. | |
| 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 twidget. | |
| 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. | |
| tpoint | recalculate_best_size () |
| Recalculates the best size. | |
| bool | can_wrap () const |
| Inherited from twidget. | |
| void | place (const tpoint &origin, const tpoint &size) |
| Inherited from twidget. | |
| void | set_origin (const tpoint &origin) |
| Inherited from twidget. | |
| void | set_visible_area (const SDL_Rect &area) |
| Inherited from twidget. | |
| void | layout_children () |
| Inherited from twidget. | |
| void | child_populate_dirty_list (twindow &caller, const std::vector< twidget * > &call_stack) |
| Inherited from twidget. | |
| twidget * | find_at (const tpoint &coordinate, const bool must_be_active) |
| Inherited from twidget. | |
| const twidget * | find_at (const tpoint &coordinate, const bool must_be_active) const |
| Inherited from twidget. | |
| twidget * | find (const std::string &id, const bool must_be_active) |
| Inherited from twidget. | |
| const twidget * | find (const std::string &id, const bool must_be_active) const |
| Inherited from twidget. | |
| bool | has_widget (const twidget *widget) const |
| Inherited from twidget. | |
| bool | disable_click_dismiss () const |
| Inherited from tcontrol. | |
| virtual iterator::twalker_ * | create_walker () |
| Inherited from twidget. | |
| 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) |
| Wrapper to set_rows and set_cols. | |
| iterator | begin () |
| iterator | end () |
Static Public Attributes | |
| static const unsigned | VERTICAL_SHIFT = 0 |
| static const unsigned | VERTICAL_GROW_SEND_TO_CLIENT = 1 << VERTICAL_SHIFT |
| static const unsigned | VERTICAL_ALIGN_TOP = 2 << VERTICAL_SHIFT |
| static const unsigned | VERTICAL_ALIGN_CENTER = 3 << VERTICAL_SHIFT |
| static const unsigned | VERTICAL_ALIGN_BOTTOM = 4 << VERTICAL_SHIFT |
| static const unsigned | VERTICAL_MASK = 7 << VERTICAL_SHIFT |
| static const unsigned | HORIZONTAL_SHIFT = 3 |
| static const unsigned | HORIZONTAL_GROW_SEND_TO_CLIENT = 1 << HORIZONTAL_SHIFT |
| static const unsigned | HORIZONTAL_ALIGN_LEFT = 2 << HORIZONTAL_SHIFT |
| static const unsigned | HORIZONTAL_ALIGN_CENTER = 3 << HORIZONTAL_SHIFT |
| static const unsigned | HORIZONTAL_ALIGN_RIGHT = 4 << HORIZONTAL_SHIFT |
| static const unsigned | HORIZONTAL_MASK = 7 << HORIZONTAL_SHIFT |
| static const unsigned | BORDER_TOP = 1 << 6 |
| static const unsigned | BORDER_BOTTOM = 1 << 7 |
| static const unsigned | BORDER_LEFT = 1 << 8 |
| static const unsigned | BORDER_RIGHT = 1 << 9 |
| static const unsigned | BORDER_ALL |
Private Member Functions | |
| tpoint | calculate_best_size () const |
| Inherited from twidget. | |
| const tchild & | child (const unsigned row, const unsigned col) const |
| tchild & | child (const unsigned row, const unsigned col) |
| void | layout (const tpoint &origin) |
| Layouts the children in the grid. | |
| void | impl_draw_children (surface &frame_buffer) |
| Inherited from twidget. | |
| void | impl_draw_children (surface &frame_buffer, int x_offset, int y_offset) |
Private Attributes | |
| unsigned | rows_ |
| The number of grid rows. | |
| unsigned | cols_ |
| The number of grid columns. | |
| std::vector< unsigned > | row_height_ |
| The row heights in the grid. | |
| std::vector< unsigned > | col_width_ |
| The column widths in the grid. | |
| std::vector< unsigned > | row_grow_factor_ |
| The grow factor for all rows. | |
| std::vector< unsigned > | col_grow_factor_ |
| The grow factor for all columns. | |
| std::vector< tchild > | children_ |
| The child items. | |
Friends | |
| class | tdebug_layout_graph |
| struct | tgrid_implementation |
Base container class.
This class holds a number of widgets and their wanted layout parameters. It also layouts the items in the grid and hanldes their drawing.
Definition at line 29 of file grid.hpp.
| gui2::tgrid::tgrid | ( | const unsigned | rows = 0, |
|
| const unsigned | cols = 0 | |||
| ) | [explicit] |
Definition at line 37 of file grid.cpp.
Referenced by create_walker().

| gui2::tgrid::~tgrid | ( | ) | [virtual] |
Definition at line 48 of file grid.cpp.
References child(), children_, and gui2::tgrid::tchild::widget().

| unsigned gui2::tgrid::add_row | ( | const unsigned | count = 1 |
) |
Addes a row to end of the grid.
| count | Number of rows to add, should be > 0. |
Definition at line 57 of file grid.cpp.
References cols_, rows_, and set_rows_cols().
Referenced by gui2::tcontainer_::add_row().


| iterator gui2::tgrid::begin | ( | ) | [inline] |
Definition at line 389 of file grid.hpp.
References children_.
Referenced by gui2::tcontainer_::begin().

| tpoint gui2::tgrid::calculate_best_size | ( | ) | const [private, virtual] |
Inherited from twidget.
Implements gui2::twidget.
Definition at line 379 of file grid.cpp.
References child(), col_width_, cols_, DBG_GUI_L, gui2::tgrid::tchild::get_best_size(), gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, row_height_, rows_, gui2::tpoint::x, and gui2::tpoint::y.
Referenced by place(), recalculate_best_size(), request_reduce_height(), and request_reduce_width().


| bool gui2::tgrid::can_wrap | ( | ) | const [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 428 of file grid.cpp.
References gui2::tgrid::tchild::can_wrap(), child(), and children_.
Referenced by gui2::tscrollbar_container::can_wrap(), and gui2::tcontainer_::can_wrap().


| const tchild& gui2::tgrid::child | ( | const unsigned | row, | |
| const unsigned | col | |||
| ) | const [inline, private] |
Definition at line 420 of file grid.hpp.
References children_, and rows_.
Referenced by calculate_best_size(), can_wrap(), child_populate_dirty_list(), gui2::tgrid_implementation::column_request_reduce_width(), disable_click_dismiss(), has_widget(), impl_draw_children(), layout(), layout_children(), layout_init(), remove_child(), gui2::tgrid_implementation::row_request_reduce_height(), set_active(), set_child(), set_origin(), set_visible_area(), swap_child(), widget(), and ~tgrid().

| tchild& gui2::tgrid::child | ( | const unsigned | row, | |
| const unsigned | col | |||
| ) | [inline, private] |
| void gui2::tgrid::child_populate_dirty_list | ( | twindow & | caller, | |
| const std::vector< twidget * > & | call_stack | |||
| ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 588 of file grid.cpp.
References child(), children_, gui2::twidget::populate_dirty_list(), and gui2::tgrid::tchild::widget().

| iterator::twalker_ * gui2::tgrid::create_walker | ( | ) | [virtual] |
Inherited from twidget.
Implements gui2::twidget.
Definition at line 660 of file grid.cpp.
References tgrid().
Referenced by test_grid().


| void gui2::tgrid::demand_reduce_height | ( | const unsigned | maximum_height | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 367 of file grid.cpp.
Referenced by gui2::tcontainer_::demand_reduce_height().

| void gui2::tgrid::demand_reduce_width | ( | const unsigned | maximum_width | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 270 of file grid.cpp.
Referenced by gui2::tcontainer_::demand_reduce_width().

| bool gui2::tgrid::disable_click_dismiss | ( | ) | const [virtual] |
Inherited from tcontrol.
Implements gui2::twidget.
Definition at line 643 of file grid.cpp.
References child(), children_, gui2::twidget::disable_click_dismiss(), gui2::twidget::get_visible(), gui2::twidget::VISIBLE, gui2::tgrid::tchild::widget(), and widget().
Referenced by gui2::tscrollbar_container::disable_click_dismiss(), gui2::tgenerator< minimum_selection, maximum_selection, placement, select_action >::disable_click_dismiss(), and gui2::tcontainer_::disable_click_dismiss().


| iterator gui2::tgrid::end | ( | ) | [inline] |
Definition at line 390 of file grid.hpp.
References children_.
Referenced by gui2::tcontainer_::end().

| const twidget * gui2::tgrid::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | const [virtual] |
| twidget * gui2::tgrid::find | ( | const std::string & | id, | |
| const bool | must_be_active | |||
| ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 616 of file grid.cpp.
Referenced by gui2::tscroll_label::finalize_subclass(), gui2::ttree_view_node::find(), and gui2::tcontainer_::find().

Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 602 of file grid.cpp.
Referenced by gui2::tcontainer_::find_at().

| unsigned int gui2::tgrid::get_cols | ( | ) | const [inline] |
Definition at line 281 of file grid.hpp.
References cols_.
Referenced by gui2::tcontainer_::get_cols(), gui2::ttree_view_node::init_grid(), and gui2::twindow::~twindow().

| unsigned int gui2::tgrid::get_rows | ( | ) | const [inline] |
Definition at line 278 of file grid.hpp.
References rows_.
Referenced by gui2::tcontainer_::get_rows(), gui2::ttree_view_node::init_grid(), and gui2::twindow::~twindow().

| bool gui2::tgrid::has_widget | ( | const twidget * | widget | ) | const [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 629 of file grid.cpp.
References child(), children_, gui2::twidget::has_widget(), and gui2::tgrid::tchild::widget().
Referenced by gui2::tcontainer_::has_widget(), gui2::tlistbox::list_item_clicked(), and gui2::tpane::signal_handler_request_placement().


| void gui2::tgrid::impl_draw_children | ( | surface & | frame_buffer | ) | [private, virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 928 of file grid.cpp.
References child(), children_, gui2::twidget::draw_background(), gui2::twidget::draw_children(), gui2::twidget::draw_foreground(), gui2::twidget::get_drawing_action(), gui2::twidget::get_visible(), gui2::twidget::set_dirty(), gui2::twidget::VISIBLE, gui2::tgrid::tchild::widget(), and widget().

| void gui2::tgrid::impl_draw_children | ( | surface & | frame_buffer, | |
| int | x_offset, | |||
| int | y_offset | |||
| ) | [private, virtual] |
Reimplemented from gui2::twidget.
Definition at line 964 of file grid.cpp.
References child(), children_, gui2::twidget::draw_background(), gui2::twidget::draw_children(), gui2::twidget::draw_foreground(), gui2::twidget::get_drawing_action(), gui2::twidget::get_visible(), gui2::twidget::set_dirty(), gui2::twidget::VISIBLE, gui2::tgrid::tchild::widget(), and widget().

| void gui2::tgrid::layout | ( | const tpoint & | origin | ) | [private] |
Layouts the children in the grid.
Definition at line 904 of file grid.cpp.
References child(), col_width_, cols_, DBG_GUI_L, LOG_HEADER, gui2::tgrid::tchild::place(), row_height_, rows_, widget(), gui2::tpoint::x, and gui2::tpoint::y.
Referenced by place().


| void gui2::tgrid::layout_children | ( | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 580 of file grid.cpp.
References child(), children_, gui2::twidget::layout_children(), and gui2::tgrid::tchild::widget().
Referenced by gui2::tscrollbar_container::layout_children(), gui2::tcontainer_::layout_children(), and gui2::tstacked_widget::layout_children().


| void gui2::tgrid::layout_init | ( | const bool | full_initialization | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 184 of file grid.cpp.
References child(), children_, and gui2::tgrid::tchild::layout_init().
Referenced by gui2::tscrollbar_container::layout_init(), gui2::tpane::layout_init(), gui2::tgenerator< minimum_selection, maximum_selection, placement, select_action >::layout_init(), gui2::tcontainer_::layout_init(), and gui2::tpane::signal_handler_request_placement().


Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 440 of file grid.cpp.
References calculate_best_size(), col_grow_factor_, col_width_, cols_, DBG_GUI_L, h, layout(), gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, row_grow_factor_, row_height_, rows_, w, gui2::tpoint::x, and gui2::tpoint::y.
Referenced by gui2::tlistbox::layout_children(), gui2::ttree_view_node::place(), gui2::tcontainer_::place(), gui2::tpane::place_children(), gui2::tpane::place_or_set_origin_children(), gui2::tscrollbar_container::set_content_size(), gui2::tlistbox::set_content_size(), and gui2::tpane::signal_handler_request_placement().


| tpoint gui2::tgrid::recalculate_best_size | ( | ) |
Recalculates the best size.
This is used for scrollbar containers when they try to update their contents size before falling back to the 'global' invalidate_layout.
Definition at line 372 of file grid.cpp.
References calculate_best_size(), and gui2::twidget::set_layout_size().
Referenced by gui2::tscrollbar_container::content_resize_request().


| void gui2::tgrid::reduce_height | ( | const unsigned | maximum_height | ) |
Tries to reduce the height of a container.
| maximum_height | The wanted maximum height. |
Definition at line 275 of file grid.cpp.
References DBG_GUI_L, gui2::twidget::get_best_size(), gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, request_reduce_height(), and gui2::tpoint::y.
Referenced by gui2::tcontainer_::reduce_height().


| void gui2::tgrid::reduce_width | ( | const unsigned | maximum_width | ) |
Tries to reduce the width of a container.
| maximum_width | The wanted maximum width. |
Definition at line 197 of file grid.cpp.
References DBG_GUI_L, gui2::twidget::get_best_size(), gui2::log_gui_layout, LOG_HEADER, log_scope2, LOG_SCOPE_HEADER, request_reduce_width(), and gui2::tpoint::x.
Referenced by gui2::tcontainer_::reduce_width().


| void gui2::tgrid::remove_child | ( | const unsigned | row, | |
| const unsigned | col | |||
| ) |
Removes and frees a widget in a cell.
| row | The row of the cell. | |
| col | The columnof the cell. |
Definition at line 135 of file grid.cpp.
References child(), cols_, rows_, gui2::tgrid::tchild::set_widget(), and gui2::tgrid::tchild::widget().
Referenced by gui2::twindow::~twindow().


| void gui2::tgrid::remove_child | ( | const std::string & | id, | |
| const bool | find_all = false | |||
| ) |
Removes and frees a widget in a cell by it's id.
| id | The id of the widget to free. | |
| find_all | If true if removes all items with the id, otherwise it stops after removing the first item (or once all children have been tested). |
Definition at line 147 of file grid.cpp.
References child(), children_, gui2::tgrid::tchild::id(), gui2::tgrid::tchild::set_widget(), and gui2::tgrid::tchild::widget().

| void gui2::tgrid::request_reduce_height | ( | const unsigned | maximum_height | ) | [virtual] |
Inherited from twidget.
Now we try every item to be reduced, maybe items need a flag whether or not to try to reduce and also eveluate whether the force reduction is still needed.
Reimplemented from gui2::twidget.
Definition at line 308 of file grid.cpp.
References calculate_best_size(), DBG_GUI_L, gui2::twidget::get_best_size(), LOG_HEADER, row_height_, gui2::tgrid_implementation::row_request_reduce_height(), rows_, gui2::twidget::set_layout_size(), and gui2::tpoint::y.
Referenced by reduce_height(), gui2::tscrollbar_container::request_reduce_height(), and gui2::tcontainer_::request_reduce_height().


| void gui2::tgrid::request_reduce_width | ( | const unsigned | maximum_width | ) | [virtual] |
Inherited from twidget.
Implements gui2::twidget.
Definition at line 230 of file grid.cpp.
References calculate_best_size(), col_width_, cols_, gui2::tgrid_implementation::column_request_reduce_width(), DBG_GUI_L, gui2::twidget::get_best_size(), LOG_HEADER, gui2::twidget::set_layout_size(), and gui2::tpoint::x.
Referenced by reduce_width(), gui2::tscrollbar_container::request_reduce_width(), and gui2::tcontainer_::request_reduce_width().


| void gui2::tgrid::set_active | ( | const bool | active | ) |
Activates all children.
If a child inherits from tcontrol or is a tgrid it will call set_active() for the child otherwise it ignores the widget.
| active | Parameter for set_active. |
Definition at line 162 of file grid.cpp.
References child(), children_, preferences::grid(), gui2::tcontrol::set_active(), set_active(), gui2::tgrid::tchild::widget(), and widget().
Referenced by set_active(), gui2::tcontainer_::set_active(), and gui2::tlistbox::set_row_active().


| void gui2::tgrid::set_child | ( | twidget * | widget, | |
| const unsigned | row, | |||
| const unsigned | col, | |||
| const unsigned | flags, | |||
| const unsigned | border_size | |||
| ) |
Sets a child in the grid.
When the child is added to the grid the grid 'owns' the widget. The widget is put in a cell, and every cell can only contain 1 widget if the wanted cell already contains a widget, that widget is freed and removed.
| widget | The widget to put in the grid. | |
| row | The row of the cell. | |
| col | The columnof the cell. | |
| flags | The flags for the widget in the cell. | |
| border_size | The size of the border for the cell, how the border is applied depends on the flags. |
Definition at line 68 of file grid.cpp.
References child(), cols_, HORIZONTAL_MASK, gui2::tgrid::tchild::id(), LOG_HEADER, rows_, gui2::tgrid::tchild::set_border_size(), gui2::tgrid::tchild::set_flags(), gui2::twidget::set_parent(), gui2::tgrid::tchild::set_widget(), VERTICAL_MASK, gui2::tgrid::tchild::widget(), and WRN_GUI_G.
Referenced by add_widget(), gui2::tbuilder_grid::build(), gui2::ttree_view::finalize_setup(), and gui2::tcontainer_::set_child().


| void gui2::tgrid::set_cols | ( | const unsigned | cols | ) |
Definition at line 674 of file grid.cpp.
References cols_, rows_, and set_rows_cols().
Referenced by gui2::tcontainer_::set_cols().


| void gui2::tgrid::set_column_grow_factor | ( | const unsigned | column, | |
| const unsigned | factor | |||
| ) | [inline] |
Sets the grow factor for a column.
| column | The column to modify. | |
| factor | The grow factor. |
Definition at line 96 of file grid.hpp.
References col_grow_factor_, and gui2::twidget::set_dirty().
Referenced by gui2::tbuilder_grid::build(), and gui2::tcontainer_::set_column_grow_factor().


| void gui2::tgrid::set_origin | ( | const tpoint & | origin | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 546 of file grid.cpp.
References child(), children_, gui2::twidget::get_x(), gui2::twidget::get_y(), gui2::twidget::set_origin(), gui2::tgrid::tchild::widget(), widget(), gui2::tpoint::x, and gui2::tpoint::y.
Referenced by gui2::tpane::place_or_set_origin_children(), gui2::tscrollbar_container::scrollbar_moved(), gui2::tscrollbar_container::set_origin(), gui2::tcontainer_::set_origin(), and gui2::tpane::set_origin_children().


| void gui2::tgrid::set_row_grow_factor | ( | const unsigned | row, | |
| const unsigned | factor | |||
| ) | [inline] |
Sets the grow factor for a row.
| row | The row to modify. | |
| factor | The grow factor. |
Definition at line 81 of file grid.hpp.
References row_grow_factor_, and gui2::twidget::set_dirty().
Referenced by gui2::tbuilder_grid::build(), and gui2::tcontainer_::set_row_grow_factor().


| void gui2::tgrid::set_rows | ( | const unsigned | rows | ) |
Definition at line 665 of file grid.cpp.
References cols_, rows_, and set_rows_cols().
Referenced by gui2::tcontainer_::set_rows().


| void gui2::tgrid::set_rows_cols | ( | const unsigned | rows, | |
| const unsigned | cols | |||
| ) |
Wrapper to set_rows and set_cols.
| rows | Parameter to call set_rows with. | |
| cols | Parameter to call set_cols with. |
Definition at line 683 of file grid.cpp.
References children_, col_grow_factor_, cols_, LOG_HEADER, row_grow_factor_, rows_, and WRN_GUI_G.
Referenced by add_row(), gui2::tbuilder_grid::build(), gui2::ttree_view::finalize_setup(), set_cols(), set_rows(), and gui2::tcontainer_::set_rows_cols().

| void gui2::tgrid::set_visible_area | ( | const SDL_Rect & | area | ) | [virtual] |
Inherited from twidget.
Reimplemented from gui2::twidget.
Definition at line 566 of file grid.cpp.
References child(), children_, gui2::twidget::set_visible_area(), gui2::tgrid::tchild::widget(), and widget().
Referenced by gui2::tlistbox::layout_children(), gui2::tscrollbar_container::place(), gui2::tscrollbar_container::scrollbar_moved(), gui2::tscrollbar_container::set_origin(), gui2::tlistbox::set_row_shown(), gui2::ttree_view_node::set_visible_area(), gui2::tscrollbar_container::set_visible_area(), gui2::tcontainer_::set_visible_area(), and gui2::tlistbox::update_content_size().


| twidget * gui2::tgrid::swap_child | ( | const std::string & | id, | |
| twidget * | widget, | |||
| const bool | recurse, | |||
| twidget * | new_parent = NULL | |||
| ) |
Exchangs a child in the grid.
It replaced the child with a certain id with the new widget but doesn't touch the other settings of the child.
| id | The id of the widget to free. | |
| widget | The widget to put in the grid. | |
| recurse | Do we want to decent into the child grids. | |
| new_parent | The new parent for the swapped out widget. |
returns The widget which got removed (the parent of the widget is cleared). If no widget found and thus not replace NULL will returned.
Definition at line 97 of file grid.cpp.
References child(), children_, preferences::grid(), gui2::tgrid::tchild::id(), gui2::twidget::set_parent(), gui2::tgrid::tchild::set_widget(), swap_child(), and gui2::tgrid::tchild::widget().
Referenced by gui2::tscrollbar_container::finalize_setup(), and swap_child().


| const twidget* gui2::tgrid::widget | ( | const unsigned | row, | |
| const unsigned | col | |||
| ) | const [inline] |
Returns the widget in the selected cell.
Definition at line 172 of file grid.hpp.
References child(), and gui2::tgrid::tchild::widget().
Referenced by disable_click_dismiss(), impl_draw_children(), gui2::ttree_view_node::init_grid(), layout(), gui2::policy::select_action::tselect::select(), set_active(), set_origin(), and set_visible_area().


| twidget* gui2::tgrid::widget | ( | const unsigned | row, | |
| const unsigned | col | |||
| ) | [inline] |
Returns the widget in the selected cell.
Definition at line 176 of file grid.hpp.
References child(), and gui2::tgrid::tchild::widget().

friend class tdebug_layout_graph [friend] |
Reimplemented from gui2::twidget.
friend struct tgrid_implementation [friend] |
const unsigned gui2::tgrid::BORDER_ALL [static] |
const unsigned gui2::tgrid::BORDER_BOTTOM = 1 << 7 [static] |
Definition at line 56 of file grid.hpp.
Referenced by gui2::tgrid::tchild::border_space(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::BORDER_LEFT = 1 << 8 [static] |
Definition at line 57 of file grid.hpp.
Referenced by gui2::tgrid::tchild::border_space(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::BORDER_RIGHT = 1 << 9 [static] |
Definition at line 58 of file grid.hpp.
Referenced by gui2::tgrid::tchild::border_space(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::BORDER_TOP = 1 << 6 [static] |
Definition at line 55 of file grid.hpp.
Referenced by gui2::tgrid::tchild::border_space(), and gui2::tgrid::tchild::place().
std::vector<tchild> gui2::tgrid::children_ [private] |
The child items.
All children are stored in a 1D vector and the formula to access a cell is: rows_ * col + row. All other vectors use the same access formula.
Definition at line 419 of file grid.hpp.
Referenced by begin(), can_wrap(), child(), child_populate_dirty_list(), disable_click_dismiss(), end(), has_widget(), impl_draw_children(), layout_children(), layout_init(), remove_child(), set_active(), set_origin(), set_rows_cols(), set_visible_area(), swap_child(), and ~tgrid().
std::vector<unsigned> gui2::tgrid::col_grow_factor_ [private] |
The grow factor for all columns.
Definition at line 411 of file grid.hpp.
Referenced by place(), set_column_grow_factor(), and set_rows_cols().
std::vector<unsigned> gui2::tgrid::col_width_ [mutable, private] |
The column widths in the grid.
Definition at line 405 of file grid.hpp.
Referenced by calculate_best_size(), layout(), place(), and request_reduce_width().
unsigned gui2::tgrid::cols_ [private] |
The number of grid columns.
Definition at line 397 of file grid.hpp.
Referenced by add_row(), calculate_best_size(), get_cols(), layout(), place(), remove_child(), request_reduce_width(), gui2::tgrid_implementation::row_request_reduce_height(), set_child(), set_cols(), set_rows(), and set_rows_cols().
const unsigned gui2::tgrid::HORIZONTAL_ALIGN_CENTER = 3 << HORIZONTAL_SHIFT [static] |
Definition at line 51 of file grid.hpp.
Referenced by gui2::twindow::layout(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::HORIZONTAL_ALIGN_LEFT = 2 << HORIZONTAL_SHIFT [static] |
Definition at line 50 of file grid.hpp.
Referenced by gui2::twindow::layout(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::HORIZONTAL_ALIGN_RIGHT = 4 << HORIZONTAL_SHIFT [static] |
Definition at line 52 of file grid.hpp.
Referenced by gui2::twindow::layout(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::HORIZONTAL_GROW_SEND_TO_CLIENT = 1 << HORIZONTAL_SHIFT [static] |
Definition at line 49 of file grid.hpp.
Referenced by add_widget(), gui2::ttree_view::finalize_setup(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::HORIZONTAL_MASK = 7 << HORIZONTAL_SHIFT [static] |
Definition at line 53 of file grid.hpp.
Referenced by gui2::tgrid::tchild::place(), and set_child().
const unsigned gui2::tgrid::HORIZONTAL_SHIFT = 3 [static] |
std::vector<unsigned> gui2::tgrid::row_grow_factor_ [private] |
The grow factor for all rows.
Definition at line 408 of file grid.hpp.
Referenced by place(), set_row_grow_factor(), and set_rows_cols().
std::vector<unsigned> gui2::tgrid::row_height_ [mutable, private] |
The row heights in the grid.
Definition at line 402 of file grid.hpp.
Referenced by calculate_best_size(), layout(), place(), and request_reduce_height().
unsigned gui2::tgrid::rows_ [private] |
The number of grid rows.
Definition at line 394 of file grid.hpp.
Referenced by add_row(), calculate_best_size(), child(), gui2::tgrid_implementation::column_request_reduce_width(), get_rows(), layout(), place(), remove_child(), request_reduce_height(), set_child(), set_cols(), set_rows(), and set_rows_cols().
const unsigned gui2::tgrid::VERTICAL_ALIGN_BOTTOM = 4 << VERTICAL_SHIFT [static] |
Definition at line 45 of file grid.hpp.
Referenced by gui2::twindow::layout(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::VERTICAL_ALIGN_CENTER = 3 << VERTICAL_SHIFT [static] |
Definition at line 44 of file grid.hpp.
Referenced by gui2::twindow::layout(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::VERTICAL_ALIGN_TOP = 2 << VERTICAL_SHIFT [static] |
Definition at line 43 of file grid.hpp.
Referenced by gui2::twindow::layout(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::VERTICAL_GROW_SEND_TO_CLIENT = 1 << VERTICAL_SHIFT [static] |
Definition at line 42 of file grid.hpp.
Referenced by add_widget(), gui2::ttree_view::finalize_setup(), and gui2::tgrid::tchild::place().
const unsigned gui2::tgrid::VERTICAL_MASK = 7 << VERTICAL_SHIFT [static] |
Definition at line 46 of file grid.hpp.
Referenced by gui2::tgrid::tchild::place(), and set_child().
const unsigned gui2::tgrid::VERTICAL_SHIFT = 0 [static] |
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:54 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |