SelectionStore is used to store the selected items in the virtual controls, i.e. it is well suited for storing even when the control contains a huge (practically infinite) number of items.
Of course, internally it still has to store the selected items somehow (as an array currently) but the advantage is that it can handle the selection of all items (common operation) efficiently and that it could be made even smarter in the future (e.g. store the selections as an array of ranges + individual items) without changing its API.
__init__ | Default class constructor. |
Clear | Clears the number of selected items. |
GetSelectedCount | Return the total number of selected items. |
IsSelected | Returns True if the given item is selected. |
OnItemDelete | Must be called when an item is deleted. |
SelectItem | Selects the given item. |
SelectRange | Selects a range of items. |
SetItemCount | Sets the total number of items we handle. |
SelectionStore is used to store the selected items in the virtual controls, i.e. it is well suited for storing even when the control contains a huge (practically infinite) number of items.
Of course, internally it still has to store the selected items somehow (as an array currently) but the advantage is that it can handle the selection of all items (common operation) efficiently and that it could be made even smarter in the future (e.g. store the selections as an array of ranges + individual items) without changing its API.
Returns True if the given item is selected.
Parameters: | item – the item to check for selection state. |
---|
Must be called when an item is deleted.
Parameters: | item – the item that is being deleted. |
---|
Selects the given item.
Parameters: |
|
---|---|
Returns: | True if the items selection really changed. |
Selects a range of items.
Parameters: |
|
---|---|
Returns: | True and fill the itemsChanged array with the indices of items which have changed state if “few” of them did, otherwise return False (meaning that too many items changed state to bother counting them individually). |