Share and Money Management 0.18devel
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
gui.controls.SortedListCtrl Class Reference

Sortable ListCtrl. More...

Inheritance diagram for gui.controls.SortedListCtrl:

Public Member Functions

def __init__ (self, parent, *args, **kwargs)
 Constructor, that initialise the wx.ListCtrl only. More...
 
def enableColumnSorter (self)
 Enables the column sorter. More...
 
def DeleteAllItems (self)
 Delete all items and clean currentItem too. More...
 
def disableColumnSorter (self)
 Disables the column sorter. More...
 
def GetListCtrl (self)
 Returns the list to be sorted. More...
 
def GetColumnSorter (self)
 Returns a column sorter, that support unicode. More...
 
def GetSortImages (self)
 Return the index of the up and down arrow images in img_list that indicate the sort order in the column header. More...
 
def ReSort (self)
 Sort the ListCtrl again using the current settings. More...
 
def unicodeColumnSorter (self, key1, key2)
 Simple sort of two keys. More...
 

Public Attributes

 columnSorterEnabled
 Flag to control the state of column sorter. More...
 
 currentItem
 Index of the currently selected item. More...
 
 itemDataMap
 Mapping between the index and the row values. More...
 
 img_list
 List of images used by this list control. More...
 
 up_arrow_idx
 Position of the arrow point up image inside img_list. More...
 
 down_arrow_idx
 Position of the arrow point down image inside img_list. More...
 

Private Member Functions

def _OnColClick (self, evt)
 Event handler of clicks at the column headers. More...
 
def _OnItemSelected (self, event)
 Store the index of the selected item in currentItem. More...
 
def _updateImages (self, oldCol)
 Updates the sort images in the column headers. More...
 

Private Attributes

 _col
 

Detailed Description

Sortable ListCtrl.

Use this control only for combined lists (e.g. click to one list item causes an action of the other list) in a widget.

Please use SortedListPanel for single lists!

Note
This implementation uses code of the ColumnSorterMixin. Some pieces of code are copied in.

Constructor & Destructor Documentation

◆ __init__()

def gui.controls.SortedListCtrl.__init__ (   self,
  parent,
args,
**  kwargs 
)

Constructor, that initialise the wx.ListCtrl only.

We don't use the constructor of the class ColumnSorterMixin. The functionality is moved to enableColumnSorter().

Member Function Documentation

◆ _OnColClick()

def gui.controls.SortedListCtrl._OnColClick (   self,
  evt 
)
private

Event handler of clicks at the column headers.

References gui.controls.SortedListCtrl._col, gui.controls.SortedListCtrl._updateImages(), and gui.controls.SortedListCtrl.GetColumnSorter().

Referenced by gui.controls.SortedListCtrl.disableColumnSorter(), and gui.controls.SortedListCtrl.enableColumnSorter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _OnItemSelected()

def gui.controls.SortedListCtrl._OnItemSelected (   self,
  event 
)
private

Store the index of the selected item in currentItem.

References gui.controls.SortedListCtrl.currentItem.

◆ _updateImages()

def gui.controls.SortedListCtrl._updateImages (   self,
  oldCol 
)
private

Updates the sort images in the column headers.

References gui.controls.SortedListCtrl._col, and gui.controls.SortedListCtrl.GetSortImages().

Referenced by gui.controls.SortedListCtrl._OnColClick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteAllItems()

def gui.controls.SortedListCtrl.DeleteAllItems (   self)

◆ disableColumnSorter()

def gui.controls.SortedListCtrl.disableColumnSorter (   self)

Disables the column sorter.

Disconnects the event handler from the event only.

See also
enableColumnSorter() and columnSorterEnabled

References gui.controls.SortedListCtrl._col, gui.controls.SortedListCtrl._OnColClick(), and gui.controls.SortedListCtrl.columnSorterEnabled.

Here is the call graph for this function:

◆ enableColumnSorter()

def gui.controls.SortedListCtrl.enableColumnSorter (   self)

Enables the column sorter.

Calling this function is mandatory cause the ColumnSorterMixin will NOT be initialised during the constructor runs!

See also
disableColumnSorter() and columnSorterEnabled

References gui.controls.SortedListCtrl._OnColClick(), and gui.controls.SortedListCtrl.columnSorterEnabled.

Here is the call graph for this function:

◆ GetColumnSorter()

def gui.controls.SortedListCtrl.GetColumnSorter (   self)

Returns a column sorter, that support unicode.

See also
unicodeColumnSorter()

References gui.controls.SortedListCtrl.unicodeColumnSorter().

Referenced by gui.controls.SortedListCtrl._OnColClick().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetListCtrl()

def gui.controls.SortedListCtrl.GetListCtrl (   self)

Returns the list to be sorted.

This function is needed by the ColumnSorterMixin

◆ GetSortImages()

def gui.controls.SortedListCtrl.GetSortImages (   self)

Return the index of the up and down arrow images in img_list that indicate the sort order in the column header.

References gui.controls.SortedListCtrl.down_arrow_idx, and gui.controls.SortedListCtrl.up_arrow_idx.

Referenced by gui.controls.SortedListCtrl._updateImages().

Here is the caller graph for this function:

◆ ReSort()

def gui.controls.SortedListCtrl.ReSort (   self)

Sort the ListCtrl again using the current settings.

References gui.controls.SortedListCtrl._col.

◆ unicodeColumnSorter()

def gui.controls.SortedListCtrl.unicodeColumnSorter (   self,
  key1,
  key2 
)

Simple sort of two keys.

The sorter bases at the original code. The locale stuff has been removed only.

References gui.controls.SortedListCtrl._col, and gui.controls.SortedListCtrl.itemDataMap.

Referenced by gui.controls.SortedListCtrl.GetColumnSorter().

Here is the caller graph for this function:

Member Data Documentation

◆ _col

gui.controls.SortedListCtrl._col
private

◆ columnSorterEnabled

gui.controls.SortedListCtrl.columnSorterEnabled

◆ currentItem

gui.controls.SortedListCtrl.currentItem

Index of the currently selected item.

None means that no item has been selected

See also
_OnItemSelected()

Referenced by gui.controls.SortedListCtrl._OnItemSelected(), and gui.controls.SortedListCtrl.DeleteAllItems().

◆ down_arrow_idx

gui.controls.SortedListCtrl.down_arrow_idx

Position of the arrow point down image inside img_list.

Referenced by gui.controls.SortedListCtrl.GetSortImages().

◆ img_list

gui.controls.SortedListCtrl.img_list

List of images used by this list control.

◆ itemDataMap

gui.controls.SortedListCtrl.itemDataMap

Mapping between the index and the row values.

This structure is used to sort the columns

Referenced by gui.controls.SortedListCtrl.DeleteAllItems(), and gui.controls.SortedListCtrl.unicodeColumnSorter().

◆ up_arrow_idx

gui.controls.SortedListCtrl.up_arrow_idx

Position of the arrow point up image inside img_list.

Referenced by gui.controls.SortedListCtrl.GetSortImages().


The documentation for this class was generated from the following file: