libui-ng
A portable GUI library for C
|
Table model delegate to retrieve data and inform about model changes. More...
#include <ui.h>
Public Member Functions | |
uiTableModel * | uiNewTableModel (uiTableModelHandler *mh) |
Creates a new table model. More... | |
void | uiFreeTableModel (uiTableModel *m) |
Frees the table model. More... | |
void | uiTableModelRowInserted (uiTableModel *m, int newIndex) |
Informs all associated uiTable views that a new row has been added. More... | |
void | uiTableModelRowChanged (uiTableModel *m, int index) |
Informs all associated uiTable views that a row has been changed. More... | |
void | uiTableModelRowDeleted (uiTableModel *m, int oldIndex) |
Informs all associated uiTable views that a row has been deleted. More... | |
Table model delegate to retrieve data and inform about model changes.
This is a wrapper around uiTableModelHandler where the actual data is held.
The main purpose it to provide methods to the developer to signal that underlying data has changed.
Row indexes match both the row indexes in uiTable and uiTableModelHandler.
A uiTableModel can be used as the backing store for multiple uiTable views.
Once created, the number of columns and their data types are not allowed to change.
void uiFreeTableModel | ( | uiTableModel * | m | ) |
Frees the table model.
m | Table model to free. |
uiTableModel * uiNewTableModel | ( | uiTableModelHandler * | mh | ) |
void uiTableModelRowChanged | ( | uiTableModel * | m, |
int | index | ||
) |
Informs all associated uiTable views that a row has been changed.
You do NOT need to call this in your SetCellValue() handlers, but NEED to call this if your data changes at any other point.
m | Table model that has changed. |
index | Index of the row that has changed. |
void uiTableModelRowDeleted | ( | uiTableModel * | m, |
int | oldIndex | ||
) |
Informs all associated uiTable views that a row has been deleted.
You must delete the row from your model before you call this function.
NumRows() must represent the new row count before you call this function.
m | Table model that has changed. |
oldIndex | Index of the row that has been deleted. |
void uiTableModelRowInserted | ( | uiTableModel * | m, |
int | newIndex | ||
) |
Informs all associated uiTable views that a new row has been added.
You must insert the row data in your model before calling this function.
NumRows() must represent the new row count before you call this function.
m | Table model that has changed. |
newIndex | Index of the row that has been added. |