ManaPlus
|
#include <tablemodel.h>
Public Member Functions | |
StaticTableModel (const int width, const int height) | |
~StaticTableModel () | |
void | set (const int row, const int column, Widget *const widget) |
void | fixColumnWidth (const int column, const int width) |
void | fixRowHeight (const int height) |
void | resize () |
int | getRows () const |
int | getColumns () const |
int | getRowHeight () const |
int | getWidth () const |
int | getHeight () const |
int | getColumnWidth (const int index) const |
Widget * | getElementAt (const int row, const int column) const |
Public Member Functions inherited from TableModel | |
virtual | ~TableModel () |
virtual void | installListener (TableModelListener *const listener) |
virtual void | removeListener (TableModelListener *const listener) |
Protected Attributes | |
int | mRows |
int | mColumns |
int | mHeight |
std::vector< Widget * > | mTableModel |
std::vector< int > | mWidths |
Additional Inherited Members | |
Protected Member Functions inherited from TableModel | |
TableModel () | |
virtual void | signalBeforeUpdate () |
virtual void | signalAfterUpdate () |
Definition at line 100 of file tablemodel.h.
StaticTableModel::StaticTableModel | ( | const int | width, |
const int | height | ||
) |
StaticTableModel::~StaticTableModel | ( | ) |
void StaticTableModel::fixColumnWidth | ( | const int | column, |
const int | width | ||
) |
Fixes the column width for a given column; this overrides dynamic width inference.
Semantics are undefined for width 0.
Definition at line 131 of file tablemodel.cpp.
References mColumns, and mWidths.
Referenced by Setup_Relations::Setup_Relations().
void StaticTableModel::fixRowHeight | ( | const int | height | ) |
Fixes the row height; this overrides dynamic height inference.
Semantics are undefined for width 0.
Definition at line 139 of file tablemodel.cpp.
References mHeight.
|
virtual |
Determines the number of columns in each row
Implements TableModel.
Definition at line 165 of file tablemodel.cpp.
References mColumns.
Referenced by resize().
|
virtual |
Determines the width of each individual column
Implements TableModel.
Definition at line 152 of file tablemodel.cpp.
|
virtual |
Retrieves the widget stored at the specified location within the table.
Implements TableModel.
Definition at line 125 of file tablemodel.cpp.
References mTableModel, and WIDGET_AT.
int StaticTableModel::getHeight | ( | ) | const |
|
virtual |
Determines the height for each row
Implements TableModel.
Definition at line 147 of file tablemodel.cpp.
References mHeight.
|
virtual |
Determines the number of rows (lines) in the table
Implements TableModel.
Definition at line 160 of file tablemodel.cpp.
References mRows.
Referenced by resize().
int StaticTableModel::getWidth | ( | ) | const |
Definition at line 170 of file tablemodel.cpp.
void StaticTableModel::resize | ( | ) |
Resizes the table model
Definition at line 87 of file tablemodel.cpp.
References getColumns(), getRows(), mColumns, mRows, and mTableModel.
void StaticTableModel::set | ( | const int | row, |
const int | column, | ||
Widget *const | widget | ||
) |
Inserts a widget into the table model. The model is resized to accomodate the widget's width and height, unless column width / row height have been fixed.
Definition at line 94 of file tablemodel.cpp.
References DYN_SIZE, Widget::getHeight(), Widget::getWidth(), mColumns, mHeight, mRows, mTableModel, mWidths, TableModel::signalAfterUpdate(), TableModel::signalBeforeUpdate(), and WIDGET_AT.
Referenced by Setup_Relations::Setup_Relations().
|
protected |
Definition at line 148 of file tablemodel.h.
Referenced by fixColumnWidth(), getColumns(), getColumnWidth(), getHeight(), resize(), and set().
|
protected |
Definition at line 149 of file tablemodel.h.
Referenced by fixRowHeight(), getHeight(), getRowHeight(), and set().
|
protected |
Definition at line 147 of file tablemodel.h.
|
protected |
Definition at line 150 of file tablemodel.h.
Referenced by getElementAt(), resize(), set(), StaticTableModel(), and ~StaticTableModel().
|
protected |
Definition at line 151 of file tablemodel.h.
Referenced by fixColumnWidth(), getColumnWidth(), getWidth(), set(), and StaticTableModel().