Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends

gui2::tcontainer_ Class Reference

A generic container base class. More...

#include <container.hpp>

Inheritance diagram for gui2::tcontainer_:
Inheritance graph
[legend]
Collaboration diagram for gui2::tcontainer_:
Collaboration graph
[legend]

List of all members.

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)
twidgetfind_at (const tpoint &coordinate, const bool must_be_active)
 Inherited from tcontrol.
const twidgetfind_at (const tpoint &coordinate, const bool must_be_active) const
 Inherited from tcontrol.
twidgetfind (const std::string &id, const bool must_be_active)
 Inherited from tcontrol.
const twidgetfind (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 tgridgrid () const
tgridgrid ()

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 tgridinitial_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

Detailed Description

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.


Constructor & Destructor Documentation

gui2::tcontainer_::tcontainer_ ( const unsigned  canvas_count  )  [inline, explicit]

Definition at line 36 of file container.hpp.

References grid_, and gui2::twidget::set_parent().

Here is the call graph for this function:


Member Function Documentation

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_.

Here is the call graph for this function:

tgrid::iterator gui2::tcontainer_::begin (  )  [inline]

Definition at line 171 of file container.hpp.

References gui2::tgrid::begin(), and grid_.

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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_.

Here is the call graph for this function:

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().

Here is the call graph for this function:

virtual iterator::twalker_* gui2::tcontainer_::create_walker (  )  [inline, virtual]

Inherited from twidget.

Todo:
Implement properly.

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_.

Here is the call graph for this function:

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_.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

tgrid::iterator gui2::tcontainer_::end (  )  [inline]

Definition at line 172 of file container.hpp.

References gui2::tgrid::end(), and grid_.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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_.

Here is the call graph for this function:

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_.

Here is the call graph for this function:

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_.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

tgrid& gui2::tcontainer_::grid (  )  [inline]

Definition at line 202 of file container.hpp.

References grid_.

const tgrid& gui2::tcontainer_::grid (  )  const [inline]
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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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();

Parameters:
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.

Here is the call graph for this function:

virtual tgrid& gui2::tcontainer_::initial_grid (  )  [inline, private, virtual]

Returns the grid to initialize while building.

Todo:
Evaluate whether this function is overridden if not remove.

Definition at line 214 of file container.hpp.

References grid_.

Referenced by init_grid().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::tcontainer_::place ( const tpoint origin,
const tpoint size 
) [virtual]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::tcontainer_::reduce_height ( const unsigned  maximum_height  ) 

Tries to reduce the height of a container.

See also:
layout_algorihm for more information.
Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void gui2::tcontainer_::reduce_width ( const unsigned  maximum_width  ) 

Tries to reduce the width of a container.

See also:
layout_algorihm for more information.
Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void gui2::tcontainer_::set_cols ( const unsigned  cols  )  [inline]

Definition at line 180 of file container.hpp.

References grid_, and gui2::tgrid::set_cols().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

void gui2::tcontainer_::set_rows ( const unsigned  rows  )  [inline]

Definition at line 177 of file container.hpp.

References grid_, and gui2::tgrid::set_rows().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:


Friends And Related Function Documentation

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.


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:22:42 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs