.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.ultimatelistctrl

.. highlight:: python



.. _wx.lib.agw.ultimatelistctrl.SelectionStore:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.ultimatelistctrl.SelectionStore**
==========================================================================================================================================

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.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>SelectionStore</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.ultimatelistctrl.SelectionStore_inheritance.png" alt="Inheritance diagram of SelectionStore" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.ultimatelistctrl.SelectionStore.html" title="wx.lib.agw.ultimatelistctrl.SelectionStore" alt="" coords="5,5,295,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.__init__`                     Default class constructor.
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.Clear`                        Clears the number of selected items.
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.GetSelectedCount`             Return the total number of selected items.
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.IsSelected`                   Returns ``True`` if the given item is selected.
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.OnItemDelete`                 Must be called when an item is deleted.
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.SelectItem`                   Selects the given item.
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.SelectRange`                  Selects a range of items.
:meth:`~wx.lib.agw.ultimatelistctrl.SelectionStore.SetItemCount`                 Sets the total number of items we handle.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: 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.

   .. method:: __init__(self)

      Default class constructor. 


   .. method:: Clear(self)

      Clears the number of selected items. 


   .. method:: GetSelectedCount(self)

      Return the total number of selected items. 


   .. method:: IsSelected(self, item)

      Returns ``True`` if the given item is selected.
      
      :param `item`: the item to check for selection state.


   .. method:: OnItemDelete(self, item)

      Must be called when an item is deleted.
      
      :param `item`: the item that is being deleted.


   .. method:: SelectItem(self, item, select=True)

      Selects the given item.
      
      :param `item`: the item to select;
      :param `select`: ``True`` to select the item, ``False`` otherwise.
      
      :return: ``True`` if the items selection really changed.


   .. method:: SelectRange(self, itemFrom, itemTo, select=True)

      Selects a range of items.
      
      :param `itemFrom`: the first index of the selection range;
      :param `itemTo`: the last index of the selection range;
      :param `select`: ``True`` to select the items, ``False`` otherwise.
      
      :return: ``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).


   .. method:: SetItemCount(self, count)

      Sets the total number of items we handle.
      
      :param `count`: the total number of items we handle.


