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

Sortable ListCtrl. More...

Public Member Functions

def __init__
 Constructor, that initialise the wx.ListCtrl only.
def enableColumnSorter
 Enables the column sorter.
def DeleteAllItems
 Delete all items and clean currentItem too.
def disableColumnSorter
 Disables the column sorter.
def GetListCtrl
 Returns the list to be sorted.
def GetColumnSorter
 Returns a column sorter, that support unicode.
def GetSortImages
 Returns a tuple of images that shows the sorting order in the column header.
def ReSort
 Sort the ListCtrl again using the current settings.
def unicodeColumnSorter
 Simple sort of two keys.

Public Attributes

 columnSorterEnabled
 Flag to control the state of column sorter.
 currentItem
 Index of the currently selected item.
 itemDataMap
 Mapping between the index and the row values.
 img_list
 List of images used by this list control.
 upArrow
 Small image with an arrow point up.
 downArrow
 Small image with an arrow point down.

Private Member Functions

def _OnColClick
 Event handler of clicks at the column headers.
def _OnItemSelected
 Store the index of the selected item in currentItem.
def _updateImages
 Updates the sort images in the column headers.

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 copiied in.

Constructor & Destructor Documentation

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

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:

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

Store the index of the selected item in currentItem.

References gui.controls.SortedListCtrl.currentItem.

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:

def gui.controls.SortedListCtrl.DeleteAllItems (   self)
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:

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:

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:

def gui.controls.SortedListCtrl.GetListCtrl (   self)

Returns the list to be sorted.

This function is needed by the ColumnSorterMixin

def gui.controls.SortedListCtrl.GetSortImages (   self)

Returns a tuple of images that shows the sorting order in the column header.

References gui.controls.SortedListCtrl.downArrow, and gui.controls.SortedListCtrl.upArrow.

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

Here is the caller graph for this function:

def gui.controls.SortedListCtrl.ReSort (   self)

Sort the ListCtrl again using the current settings.

References gui.controls.SortedListCtrl._col.

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

gui.controls.SortedListCtrl._col
private
gui.controls.SortedListCtrl.columnSorterEnabled
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().

gui.controls.SortedListCtrl.downArrow

Small image with an arrow point down.

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

gui.controls.SortedListCtrl.img_list

List of images used by this list control.

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().

gui.controls.SortedListCtrl.upArrow

Small image with an arrow point up.

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


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