List views

EsListViewCreate

EsListView *EsListViewCreate(EsElement *parent, EsListViewFlags flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, EsStyleID itemStyle = 0, EsStyleID headerItemStyle = 0, EsStyleID footerItemStyle = 0);

Creates a list view, a scrollable list or table of items. The item styles control the appearance of the items and their headers.

EsListViewGetIndexFromItem

EsListViewIndex EsListViewGetIndexFromItem(EsElement *element, EsListViewIndex *group = ES_NULL);

Returns the index of a list view item element within its group. If group is not null, the group index is written to it.

EsListViewEnumerateVisibleItems

EsListViewEnumeratedVisibleItem *EsListViewEnumerateVisibleItems(EsListView *view, size_t *count);

Returns an array describing the currently visible items. Free the result with EsHeapFree.

EsListViewRegisterColumn

void EsListViewRegisterColumn(EsListView *view, uint32_t id, STRING title = BLANK_STRING, EsListViewColumnFlags flags = ES_FLAGS_DEFAULT, double initialWidth = 0);

Registers a column with the given id and title. The title is copied. The column must be added to the header with EsListViewAddAllColumns.

EsListViewAddAllColumns

void EsListViewAddAllColumns(EsListView *view);

Call after registering the columns to add them to the header. Call again after EsListViewChangeStyles, as needed.

EsListViewSetEmptyMessage

void EsListViewSetEmptyMessage(EsListView *view, STRING message = BLANK_STRING);

Sets the message shown when the list has no items.

EsListViewSetMaximumItemsPerBand

void EsListViewSetMaximumItemsPerBand(EsListView *view, int maximumItemsPerBand);

Sets the maximum number of items in one band of a tiled list view.

EsListViewSelectNone

void EsListViewSelectNone(EsListView *view);

Clears the selection in the list view.

EsListViewSelect

void EsListViewSelect(EsListView *view, EsListViewIndex group, EsListViewIndex index, bool addToExistingSelection = false);

Selects the item at the given group and index. If addToExistingSelection is true, the item is added to the existing selection; otherwise the previous selection is cleared.

EsListViewFocusItem

void EsListViewFocusItem(EsListView *view, EsListViewIndex group, EsListViewIndex index);

Moves the keyboard focus to the item at the given group and index, and scrolls the item into view.

EsListViewGetFocusedItem

bool EsListViewGetFocusedItem(EsListView *view, EsListViewIndex *group, EsListViewIndex *index);

Returns false if not item was focused.

EsListViewInvalidateContent

void EsListViewInvalidateContent(EsListView *view, EsListViewIndex group, EsListViewIndex index);

Repaints the content of the item at the given group and index, if it is visible.

EsListViewInvalidateAll

void EsListViewInvalidateAll(EsListView *view);

Repaints the whole list view.

EsListViewContentChanged

void EsListViewContentChanged(EsListView *view);

Tells the list view that its content has changed. Clears the search buffer and scrolls back to the top.

EsListViewChangeStyles

void EsListViewChangeStyles(EsListView *view, EsStyleID style, EsStyleID itemStyle, EsStyleID headerItemStyle, EsStyleID footerItemStyle, uint32_t addFlags, uint32_t removeFlags);

Changes the styles and flags of the list view. The visible items are rebuilt with the new styles.

EsListViewScrollToEnd

void EsListViewScrollToEnd(EsListView *view);

Scrolls the list view to the last item.

EsListViewGetAnnouncementPointForSelection

EsPoint EsListViewGetAnnouncementPointForSelection(EsListView *view);

Returns the center point of the bounding box of the selected items, in window coordinates.

EsListViewCreateInlineTextbox

EsTextbox *EsListViewCreateInlineTextbox(EsListView *view, EsListViewIndex group, EsListViewIndex index, EsListViewInlineTextboxFlags flags = ES_FLAGS_DEFAULT);

Creates an edit-based textbox that overlays the item at the given group and index for in-place editing. Returns the new textbox.

EsListViewInsertGroup

void EsListViewInsertGroup(EsListView *view, EsListViewIndex group, EsListViewGroupFlags flags = ES_FLAGS_DEFAULT);

Inserts a new group at the given index. The flags control whether the group has a header and a footer.

EsListViewInsert

void EsListViewInsert(EsListView *view, EsListViewIndex group, EsListViewIndex firstIndex, EsListViewIndex count);

Inserts count items into the group at the given index.

EsListViewRemove

void EsListViewRemove(EsListView *view, EsListViewIndex group, EsListViewIndex firstIndex, EsListViewIndex count);

Removes count items from the group, starting at the given index.

EsListViewRemoveAll

void EsListViewRemoveAll(EsListView *view, EsListViewIndex group);

Removes all items from the given group.

EsListViewFixedItemInsert

EsListViewIndex EsListViewFixedItemInsert(EsListView *view, EsGeneric data = ES_NULL, EsListViewIndex index = -1, uint32_t iconID = 0);

Inserts a new fixed item with the given data and icon, and returns its index. If index is -1, the item is appended. The first group and first column are created automatically.

EsListViewFixedItemRemove

bool EsListViewFixedItemRemove(EsListView *view, EsGeneric data);

Returns false if the item was not found.

EsListViewFixedItemSetString

void EsListViewFixedItemSetString(EsListView *view, EsListViewIndex index, uint32_t columnID, STRING string = BLANK_STRING);

Sets the string of the item at the given index in the given column. The string is copied.

EsListViewFixedItemSetDouble

void EsListViewFixedItemSetDouble(EsListView *view, EsListViewIndex index, uint32_t columnID, double number);

Sets the double value of the item at the given index in the given column.

EsListViewFixedItemSetInteger

void EsListViewFixedItemSetInteger(EsListView *view, EsListViewIndex index, uint32_t columnID, int64_t number);

Sets the integer value of the item at the given index in the given column.

EsListViewFixedItemSelect

bool EsListViewFixedItemSelect(EsListView *view, EsGeneric data);

Returns false if the item was not found.

EsListViewFixedItemGetSelected

bool EsListViewFixedItemGetSelected(EsListView *view, EsGeneric *data);

Returns false if no item was selected.

EsListViewFixedItemSetEnumStringsForColumn

void EsListViewFixedItemSetEnumStringsForColumn(EsListView *view, uint32_t columnID, const EsListViewEnumString *strings, size_t stringCount);

Sets the enumeration strings for the given column. Integer values in that column are displayed as the matching enum string.

EsListViewFixedItemSortAll

void EsListViewFixedItemSortAll(EsListView *view);

Re-sort the list after inserting new items or modifying existing items. TODO EsListViewFixedItemSortSingleItem.