libui
libui copied to clipboard
Add new API functions for table header clicks and sort indicators.
Proposal for introducing an enum sort type uiSort:
uiSortNone
uiSortAscending
uiSortDescending
Two functions for setting table header sort indicators (only visual, no sorting is performed):
uiSort uiTableHeaderSortIndicator(uiTable *t, int column);
void uiTableHeaderSetSortIndicator(uiTable *t, int column, uiSort order);
And a setter for a header on clicked callback function:
void uiTableHeaderOnClicked(uiTable *t, void (*f)(uiTable *table, int column, void *data), void *data);
Implementations are provided for darwin, unix, and windows.
Notes: The column is the index of the column when it was added to the table. It might be nice to be able to set a numeric identifier, similar to how table columns are handled on darwin. Or possibly even introducing a uiTableColumn type and cleaning up the uiTableAppendColumn API. This would however break the existing API, so I left it out for the time being.