Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new API functions for table header clicks and sort indicators. #513

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

szanni
Copy link

@szanni szanni commented Sep 18, 2020

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.

To be able to identify table columns individually use the order
that columns have been added to the table as the ID.
First added column: 0, second: 1, ...
uiSort:
uiSortNone
uiSortAscending
uiSortDescending
Add functions to get/set table header sort indicators:
uiTableHeaderSortIndicator
uiTableHeaderSetSortIndicator

Add callback setter for table header clicks:
uiTableHeaderOnClicked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant