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

# table Class Template Reference

table is a class which represents a two-dimensional matrix . More...

List of all members.

## Public Types
typedef double | factor
typedef CellData | cell_data
typedef table< CellData > | self
typedef cell_proxy< self > | cell_type
typedef const cell_proxy< const self > | const_cell_type
## Public Member Functions
| table (const cell_data &def_cell_data)
| table (const cell_data &def_cell_data, unsigned cols, unsigned rows)
| table (const table &t)
const table & | operator= (const table &t)
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 | detail::cell_proxy_base<CellData>
class | cell_type

## Detailed Description

### template<class CellData>
class win32::gui::bg_wnd::table< CellData >

table is a class which represents a two-dimensional matrix .

table is a class which represents a two-dimensional matrix. The type of the data in this matrix is passed as template-parameter (CellData). You have to specify a default value; "empty" cells are filled with this default data.
table supports some neat features like inserting and removing rows and columns, merging cells, setting row and column width/height, ... You can easily access the data in the cells by t[col_idx][row_idx] which returns a cell_proxy-object (typedef'ed to table<CellData>::cell_type). The position, width and height of cells, rows and columns are logical. That means there is a factor and you have to provide a default width and height which you multiply with the factor.

## Constructor & Destructor Documentation

table | ( | const cell_data & | def_cell_data | ) | `[inline]`

  | Constructor which constructs an empty table. Parameters:
  | def_cell_data | Default cell data. When a new cell is created it is automatically filled with this value

table | ( | const cell_data & | def_cell_data,
|  | unsigned | cols,
|  | unsigned | rows
| ) | `[inline]`

  | Constructor which constructs a table with the dimensions cols * rows. Parameters:
  | def_cell_data | Default cell data. When a new cell is created it is automatically filled with this value
  | rows,cols | Dimensions of the table

## Member Function Documentation

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

| Returns the number of columns.

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

| 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]`

| 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]`

| Returns the default cell data.

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

| Changes the dimension of the table.

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

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

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

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

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

| Merges a range of cells together.

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

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

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

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

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

| Removes a column.

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

| Removes a row.

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

| Returns the number of rows.

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

| 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]`

| 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]`

| Swaps a table.

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

| Unmerges the cell at the passed coordinates.

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

| Unmerges cells in a range.

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