libui-ng
A portable GUI library for C
Tables

Types and methods for organizing and displaying tabular data. More...

Classes

struct  uiTableValue
 Container to store values used in container related methods. More...
 
struct  uiTableModel
 Table model delegate to retrieve data and inform about model changes. More...
 
struct  uiTableModelHandler
 Developer defined methods for data retrieval and setting. More...
 
struct  uiTableTextColumnOptionalParams
 Optional parameters to control the appearance of text columns. More...
 
struct  uiTableParams
 Table parameters passed to uiNewTable(). More...
 
struct  uiTable
 A control to display data in a tabular fashion. More...
 
struct  uiTableSelection
 Holds an array of selected row indices for a table. More...
 

Enumerations

enum  uiSortIndicator { uiSortIndicatorNone , uiSortIndicatorAscending , uiSortIndicatorDescending }
 Sort indicators. More...
 
enum  uiTableSelectionMode { uiTableSelectionModeNone , uiTableSelectionModeZeroOrOne , uiTableSelectionModeOne , uiTableSelectionModeZeroOrMany }
 Table selection modes. More...
 

Detailed Description

Types and methods for organizing and displaying tabular data.

Tables follow the concept of separation of concerns, similar to common patterns like model-view-controller or model-view-adapter.

They consist of three main components:

To get started:

  1. Implement all of the methods defined in uiTableModelHandler. This involves defining columns, their data types as well as getters and setters for each table cell.
  2. Wrap the uiTableModelHandler from step 1 in a uiTableModel object.
  3. Create a new uiTable using the model created in step 2. Start adding columns to your table. Each table column is backed by one or more model columns.

You can create multiple differing views (uiTable) using the same uiTableModel.

Enumeration Type Documentation

◆ uiSortIndicator

Sort indicators.

Generic sort indicators to display sorting direction.

Enumerator
uiSortIndicatorNone 
uiSortIndicatorAscending 
uiSortIndicatorDescending 

◆ uiTableSelectionMode

Table selection modes.

Table selection that enforce how a user can interact with a table.

Warning
An empty table selection is a valid state for any selection mode. This is in fact the default upon table creation and can otherwise triggered through operations such as row deletion.
Enumerator
uiTableSelectionModeNone 

Allow no row selection.

Warning
This mode disables all editing of text columns. Buttons and checkboxes keep working though.
uiTableSelectionModeZeroOrOne 

Allow zero or one row to be selected.

uiTableSelectionModeOne 

Allow for exactly one row to be selected.

uiTableSelectionModeZeroOrMany 

Allow zero or many (multiple) rows to be selected.