Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

# layout_painter Class Template Reference

Painter which draws other painters in a table. More...

Inheritance diagram for layout_painter:

List of all members.

## Public Types
typedef Key | key_type
typedef const key_type & | param0
typedef bg_wnd::general_exception< self, 0 > | key_already_used
typedef bg_wnd::general_exception< self, 1 > | key_invalid
typedef bg_wnd::general_exception< self, 2 > | invalid_painter_cast
typedef double | factor
typedef Key | cell_data
typedef cell_proxy< self > | cell_type
typedef const cell_proxy< const self > | const_cell_type
## Public Member Functions
| layout_painter (const key_type &empty_field)
layout_painter * | clone () const
void | margin (unsigned horz_margin, unsigned vert_margin, bool bOuterMargin=true)
POINT | margin () const
void | add_painter (const key_type &key, const painter_base &painter)
template<class Painter>
void | add_painter (const key_type &key)
template<class Painter>
void | add_painter (const key_type &key, typename Painter::param0 param)
template<class Painter>
void | add_painter (const key_type &key, typename Painter::param0 param0, typename Painter::param1 param1)
void | delete_all_painters ()
void | delete_painter (const key_type &key)
std::vector< key_type > | get_keys () const
template<class Painter>
Painter & | get_painter (const key_type &key) const
void | draw (HDC hDC, int cx, int cy)
virtual bool | is_opaque (int cx, int cy) const
const cell_data | default_cell_data () const
void | dimensions (unsigned cols, unsigned rows)
unsigned | row_count () const
unsigned | col_count () const
detail::forward_proxy< self > | operator[] (unsigned col)
const detail::forward_proxy< const self > | operator[] (unsigned col) const
void | row_height (unsigned row, factor height_factor)
factor | row_height (unsigned row) const
void | col_width (unsigned col, factor width_factor)
factor | col_width (unsigned col) const
void | insert_row (unsigned row)
void | insert_col (unsigned col)
void | remove_col (unsigned col)
void | remove_row (unsigned row)
void | merge_cells (const cell_range &range)
void | unmerge_cells (const cell_range &range)
void | unmerge_cells (COORDS coords)
void | swap (self &t)
## Friends
class | cell_type
class | detail::cell_proxy_base<CellData>

## Detailed Description

### template<class Key = int>
class win32::gui::layout_painter< Key >

Painter which draws other painters in a table.

See also:
  Description of layout_painter

  background_wnd

## Member Function Documentation

void add_painter | ( | const key_type & | key,
|  | typename Painter::param0 | param0,
|  | typename Painter::param1 | param1
| ) | `[inline]`

  | Adds a painter of type Painter which can be accessed through key. Parameters:
  | param0,param1 | Arguments which are passed to the c'tor of the painter
  Exceptions:
  | layout_painter<Key>::key_already_used | if the key is in use (keys must be unique!)

void add_painter | ( | const key_type & | key,
|  | typename Painter::param0 | param
| ) | `[inline]`

  | Adds a painter of type Painter which can be accessed through key. Parameters:
  | param | Argument which is passed to the c'tor of the painter
  Exceptions:
  | layout_painter<Key>::key_already_used | if the key is in use (keys must be unique!)

void add_painter | ( | const key_type & | key | ) | `[inline]`

  | Adds a painter which can be accessed through key Exceptions:
  | layout_painter<Key>::key_already_used | if the key is in use (keys must be unique!).

void add_painter | ( | const key_type & | key,
|  | const painter_base & | painter
| ) | `[inline]`

  | Adds a copy of painter which can be accessed through key Exceptions:
  | layout_painter<Key>::key_already_used | if the key is in use (keys must be unique!).

layout_painter* clone | ( |  | ) | const`[inline, virtual]`

| Clones a layout_painter. Implements painter_base.

unsigned col_count | ( |  | ) | const`[inline, inherited]`

| Returns the number of columns.

factor col_width | ( | unsigned | col | ) | const`[inline, inherited]`

| Sets the width of a column . The column is only a factor. You have to provide a default width which you will multiply by this factor

void col_width | ( | unsigned | col,
|  | factor | width_factor
| ) | `[inline, inherited]`

| Sets the width of a column . The column is only a factor. You have to provide a default width which you will multiply by this factor

const cell_data default_cell_data | ( |  | ) | const`[inline, inherited]`

| Returns the default cell data.

void delete_all_painters | ( |  | ) | `[inline]`

| Deletes all painters.

void delete_painter | ( | const key_type & | key | ) | `[inline]`

  | Deletes the painter with the passed key Exceptions:
  | layout_painter<Key>::key_invalid | if no painter with the passed key exists.

void dimensions | ( | unsigned | cols,
|  | unsigned | rows
| ) | `[inline, inherited]`

| Changes the dimension of the table.

std::vector<key_type> get_keys | ( |  | ) | const`[inline]`

| Returns the keys of all the painters.

Painter& get_painter | ( | const key_type & | key | ) | const`[inline]`

  | Returns the painter with the passed key . The painter will be automatically cast to the passed type Painter Exceptions:
  | layout_painter<Key>::invalid_painter_cast | if the painter can't be casted to Painter (means dynamic type is NOT a Painter)
  | layout_painter<Key>::key_invalid | if no painter with the passed key exists

void insert_col | ( | unsigned | col | ) | `[inline, inherited]`

| Inserts a column . The column will be inserted before the passed value

void insert_row | ( | unsigned | row | ) | `[inline, inherited]`

| Inserts a row . The row will be inserted before the passed value

POINT margin | ( |  | ) | const`[inline]`

| Returns the margins.

void margin | ( | unsigned | horz_margin,
|  | unsigned | vert_margin,
|  | bool | bOuterMargin = `true`
| ) | `[inline]`

  | Sets the margins. Parameters:
  | bOuterMargin | If true, the margin is also applied "around" the painter

void merge_cells | ( | const cell_range & | range | ) | `[inline, inherited]`

| Merges a range of cells together.

const detail::forward_proxy<const self> operator[] | ( | unsigned | col | ) | const`[inline, inherited]`

| Allows access to a cell_data by t[col_idx][row_idx].

detail::forward_proxy<self> operator[] | ( | unsigned | col | ) | `[inline, inherited]`

| Allows access to a cell_data by t[col_idx][row_idx].

void remove_col | ( | unsigned | col | ) | `[inline, inherited]`

| Removes a column.

void remove_row | ( | unsigned | row | ) | `[inline, inherited]`

| Removes a row.

unsigned row_count | ( |  | ) | const`[inline, inherited]`

| Returns the number of rows.

factor row_height | ( | unsigned | row | ) | const`[inline, inherited]`

| Returns the height of a row . The height is only a factor. You have to provide a default height which you will multiply by this factor

void row_height | ( | unsigned | row,
|  | factor | height_factor
| ) | `[inline, inherited]`

| Sets the height of a row . The height is only a factor. You have to provide a default height which you will multiply by this factor

void swap | ( | self & | t | ) | `[inline, inherited]`

| Swaps a table.

void unmerge_cells | ( | COORDS | coords | ) | `[inline, inherited]`

| Unmerges the cell at the passed coordinates.

void unmerge_cells | ( | const cell_range & | range | ) | `[inline, inherited]`

| Unmerges cells in a range.

| by Steven Weiss. You can contact me at steven11@gmx.de.