ImGuiSelectionBasicStorage

imguicpp.ImGuiSelectionBasicStorage (extern class)

Static Members

applyRequests(self: cpp.Star, msIo: cpp.Star): Void

Apply selection requests coming from BeginMultiSelect() and EndMultiSelect() functions. It uses 'items_count' passed to BeginMultiSelect()

Name Type
self cpp.Star
msIo cpp.Star

contains(self: cpp.Star, id: UInt): Bool

Query if an item id is in selection.

Name Type
self cpp.Star
id UInt
Returns
Bool

clear(self: cpp.Star): Void

Clear selection

Name Type
self cpp.Star

swap(self: cpp.Star, r: cpp.Star): Void

Swap two selections

Name Type
self cpp.Star
r cpp.Star

setItemSelected(self: cpp.Star, id: UInt, selected: Bool): Void

Add/remove an item from selection (generally done by ApplyRequests() function)

Name Type
self cpp.Star
id UInt
selected Bool

getNextSelectedItem(self: cpp.Star, opaqueIt: cpp.RawPointer<Void>, outId: cpp.Star): Bool

Iterate selection with 'void* it = NULL; ImGuiID id; while (selection.GetNextSelectedItem(&it, &id)) { ... }'

Name Type
self cpp.Star
opaqueIt cpp.RawPointer<Void>
outId cpp.Star
Returns
Bool

getStorageIdFromIndex(self: cpp.Star, idx: Int): UInt

Convert index to item id based on provided adapter.

Name Type
self cpp.Star
idx Int
Returns
UInt

Instance Members

size: Int

// Number of selected items, maintained by this helper.


preserveOrder: Bool

= false // GetNextSelectedItem() will return ordered selection (currently implemented by two additional sorts of selection. Could be improved)


= NULL // User data for use by adapter function // e.g. selection.UserData = (void*)my_items;


adapterIndexToStorageId: ImGuiOpaqueCallback

e.g. selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((MyItems**)self->UserData)[idx]->ID; };

Metadata

Name Parameters
:structAccess -
:include "linc_imgui.h"