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)
bool dirty () const
 Inherited from twidget.
twidgetfind_widget (const tpoint &coordinate, const bool must_be_active)
 Inherited from tcontrol.
const twidgetfind_widget (const tpoint &coordinate, const bool must_be_active) const
 Inherited from tcontrol.
twidgetfind_widget (const std::string &id, const bool must_be_active)
 Inherited from tcontrol.
const twidgetfind_widget (const std::string &id, const bool must_be_active) const
 Inherited from tcontrol.
bool has_widget (const twidget *widget) const
 Inherited from twidget.
bool has_vertical_scrollbar () const =0
 Inherited from twidget.
tpoint get_minimum_size () const
 Inherited from tcontrol.
tpoint get_best_size () const
 Inherited from tcontrol.
void set_size (const SDL_Rect &rect)
 Inherited from tcontrol.
void set_client_size (const SDL_Rect &rect)
 FIXME see whether needed to be exported.
void draw (surface &surface)
 Inherited from tcontrol.
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 add_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_col_grow_factor (const unsigned col, const unsigned factor)
virtual SDL_Rect get_client_rect () const

Protected Member Functions

const tgridgrid () const
tgridgrid ()

Private Member Functions

virtual tpoint border_space () const
 Returns the space used by the border.

Private Attributes

tgrid grid_


Detailed Description

A generic container base class.

A container is a class build with multiple items either acting as one widget.

Definition at line 30 of file container.hpp.


Constructor & Destructor Documentation

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

Definition at line 33 of file container.hpp.

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


Member Function Documentation

bool gui2::tcontainer_::dirty (  )  const [inline, virtual]

Inherited from twidget.

Reimplemented from gui2::twidget.

Definition at line 40 of file container.hpp.

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

Referenced by gui2::tpanel::draw(), and gui2::twindow::show().

twidget* gui2::tcontainer_::find_widget ( const tpoint coordinate,
const bool  must_be_active 
) [inline, virtual]

const twidget* gui2::tcontainer_::find_widget ( const tpoint coordinate,
const bool  must_be_active 
) const [inline, virtual]

Inherited from tcontrol.

Reimplemented from gui2::tcontrol.

Reimplemented in gui2::tlistbox, gui2::tpanel, and gui2::twindow.

Definition at line 47 of file container.hpp.

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

twidget* gui2::tcontainer_::find_widget ( const std::string &  id,
const bool  must_be_active 
) [inline, virtual]

Inherited from tcontrol.

Reimplemented from gui2::tcontrol.

Reimplemented in gui2::tpanel, and gui2::twindow.

Definition at line 52 of file container.hpp.

References gui2::tgrid::find_widget(), gui2::tcontrol::find_widget(), and grid_.

const twidget* gui2::tcontainer_::find_widget ( const std::string &  id,
const bool  must_be_active 
) const [inline, virtual]

Inherited from tcontrol.

Reimplemented from gui2::tcontrol.

Reimplemented in gui2::tpanel, and gui2::twindow.

Definition at line 59 of file container.hpp.

References gui2::tgrid::find_widget(), gui2::tcontrol::find_widget(), and grid_.

bool gui2::tcontainer_::has_widget ( const twidget widget  )  const [inline, virtual]

Inherited from twidget.

Reimplemented from gui2::twidget.

Definition at line 66 of file container.hpp.

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

Referenced by gui2::tlistbox::list_item_selected().

bool gui2::tcontainer_::has_vertical_scrollbar (  )  const [pure virtual]

Inherited from twidget.

Since we can't define a good default behaviour we force the inheriting classes to define this function. So inheriting classes act as one widget others as a collection of multiple objects.

Reimplemented from gui2::twidget.

Implemented in gui2::tlistbox, and gui2::tpanel.

tpoint gui2::tcontainer_::get_minimum_size (  )  const [virtual]

Inherited from tcontrol.

Reimplemented from gui2::tcontrol.

Definition at line 50 of file container.cpp.

References border_space(), gui2::tgrid::get_maximum_size(), grid_, size, gui2::tpoint::x, and gui2::tpoint::y.

tpoint gui2::tcontainer_::get_best_size (  )  const [virtual]

Inherited from tcontrol.

Reimplemented from gui2::tcontrol.

Reimplemented in gui2::tlistbox.

Definition at line 66 of file container.cpp.

References border_space(), gui2::tgrid::get_best_size(), grid_, size, gui2::tpoint::x, and gui2::tpoint::y.

Referenced by gui2::tlistbox::get_best_size(), and gui2::twindow::recalculate_size().

void gui2::tcontainer_::set_size ( const SDL_Rect &  rect  )  [inline, virtual]

Inherited from tcontrol.

Reimplemented from gui2::tcontrol.

Reimplemented in gui2::tlistbox.

Definition at line 85 of file container.hpp.

References get_client_rect(), set_client_size(), and gui2::tcontrol::set_size().

Referenced by gui2::twindow::recalculate_size(), gui2::tlistbox::set_size(), and gui2::twindow::twindow().

void gui2::tcontainer_::set_client_size ( const SDL_Rect &  rect  )  [inline]

FIXME see whether needed to be exported.

Definition at line 92 of file container.hpp.

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

Referenced by gui2::twindow::layout(), and set_size().

void gui2::tcontainer_::draw ( surface surface  )  [virtual]

Inherited from tcontrol.

Reimplemented from gui2::tcontrol.

Reimplemented in gui2::tlistbox, gui2::tpanel, and gui2::twindow.

Definition at line 42 of file container.cpp.

References gui2::tgrid::draw(), cursor::draw(), and grid_.

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

Definition at line 99 of file container.hpp.

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

Referenced by gui2::twindow::draw().

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

Definition at line 100 of file container.hpp.

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

Referenced by gui2::twindow::draw().

unsigned gui2::tcontainer_::add_row ( const unsigned  count = 1  )  [inline]

Definition at line 102 of file container.hpp.

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

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

Definition at line 105 of file container.hpp.

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

unsigned int gui2::tcontainer_::get_rows (  )  const [inline]

Definition at line 106 of file container.hpp.

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

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

Definition at line 108 of file container.hpp.

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

unsigned int gui2::tcontainer_::get_cols (  )  const [inline]

Definition at line 109 of file container.hpp.

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

void gui2::tcontainer_::set_rows_cols ( const unsigned  rows,
const unsigned  cols 
) [inline]

Definition at line 111 of file container.hpp.

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

Referenced by gui2::tbuilder_panel::build(), and gui2::build().

void gui2::tcontainer_::add_child ( twidget widget,
const unsigned  row,
const unsigned  col,
const unsigned  flags,
const unsigned  border_size 
) [inline]

Definition at line 114 of file container.hpp.

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

Referenced by gui2::tbuilder_panel::build(), and gui2::build().

void gui2::tcontainer_::set_row_grow_factor ( const unsigned  row,
const unsigned  factor 
) [inline]

Definition at line 118 of file container.hpp.

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

Referenced by gui2::tbuilder_panel::build(), and gui2::build().

void gui2::tcontainer_::set_col_grow_factor ( const unsigned  col,
const unsigned  factor 
) [inline]

Definition at line 121 of file container.hpp.

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

Referenced by gui2::tbuilder_panel::build(), and gui2::build().

virtual SDL_Rect gui2::tcontainer_::get_client_rect (  )  const [inline, virtual]

Reimplemented in gui2::tpanel, and gui2::twindow.

Definition at line 124 of file container.hpp.

References gui2::twidget::get_rect().

Referenced by set_size().

const tgrid& gui2::tcontainer_::grid (  )  const [inline, protected]

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

Definition at line 127 of file container.hpp.

References 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 134 of file container.hpp.

Referenced by get_best_size(), and get_minimum_size().


Member Data Documentation


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs