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
(object)¶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__
(self)¶Default class constructor.
Clear
(self)¶Clears the number of selected items.
GetSelectedCount
(self)¶Return the total number of selected items.
IsSelected
(self, item)¶Returns True
if the given item is selected.
Parameters: | item – the item to check for selection state. |
---|
OnItemDelete
(self, item)¶Must be called when an item is deleted.
Parameters: | item – the item that is being deleted. |
---|
SelectItem
(self, item, select=True)¶Selects the given item.
Parameters: |
|
---|---|
Returns: |
|
SelectRange
(self, itemFrom, itemTo, select=True)¶Selects a range of items.
Parameters: |
|
---|---|
Returns: |
|
SetItemCount
(self, count)¶Sets the total number of items we handle.
Parameters: | count – the total number of items we handle. |
---|