diffpy.pdfgui.gui.wxextensions package
Extensions to wxPython used in PDFgui.
Submodules
diffpy.pdfgui.gui.wxextensions.listctrls module
This module contains custom wxListCtrl subclasses. AutoWidthListCtrl - A wxListCtrl object that automatically adjusts the width of its columns. ColumnSortListCtrl - An AutoWidthListCtrl that sorts its entries when the column header is clicked. KeyEventsListCtrl - A ColumnSortListCtrl that selects and item as you type its name.
- class diffpy.pdfgui.gui.wxextensions.listctrls.AutoWidthListCtrl(parent, ID, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=0, *args, **kwargs)[source]
Bases:
ListCtrl
,ListCtrlAutoWidthMixin
WxListCtrl subclass that automatically adjusts its column width.
- class diffpy.pdfgui.gui.wxextensions.listctrls.ColumnSortListCtrl(parent, ID, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=0, *args, **kwargs)[source]
Bases:
AutoWidthListCtrl
,ColumnSorterMixin
AutoWidthListCtrl subclass that sorts its columns when the column header is pressed.
This ListCtrl requires an itemDataMap member dictionary to be initialized before the sorting capabilities can be realized. This dictionary simply references the ListCtrl’s entries by a unique number. This number must be stored as the ItemData (with SetItemData) of the entry. The member data must be in the form of a tuple, where the tuple has a number of entries as the ListCtrl has columns. The sorting routine sorts the items in the ListCtrl by the entries in this tuple.
- initializeSorter()[source]
Initialize the column sorter mixin after the ListCtrl is filled.
This method must be called whenever the itemDataMap is altered.
- makeIDM()[source]
This method automatically sets up the itemDataMap.
The itemDataMap gets filled with the current ListCtrl entries. The itemDataMap does not update automatically when the list is changed. To update the itemDataMap this method must be called again. initializeSorter should be called after a call to this method.
- class diffpy.pdfgui.gui.wxextensions.listctrls.KeyEventsListCtrl(parent, id, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=0, *args, **kwargs)[source]
Bases:
ColumnSortListCtrl
ColumnSortListCtrl that catches key events and selects the item that matches.
It only searches for items in the first column.
diffpy.pdfgui.gui.wxextensions.validators module
- class diffpy.pdfgui.gui.wxextensions.validators.TextValidator(flag=2, allowNeg=False)[source]
Bases:
Validator
This validator is designed to check text input for wxTextCtrls.
(It might have uses in other widgets.) It can validate for letters only, digits only, floats only, and can allow for a negative at the beginning of a digit string or a negative float.
- Clone() Object [source]
All validator classes must implement the Clone() function, which returns an identical copy of itself.
- TransferFromWindow() bool [source]
This overridable function is called when the value in the window must be transferred to the validator.
diffpy.pdfgui.gui.wxextensions.autowidthlabelsgrid module
This module contains AutoWidthListCtrl, a wxListCtrl object that automatically adjusts the width of its columns.
diffpy.pdfgui.gui.wxextensions.textctrlutils module
This module contains utilities that can be used with wxTextCtrls.
- diffpy.pdfgui.gui.wxextensions.textctrlutils.textCtrlAsGridCell(panel, event)[source]
Process a textCtrl key event as if the textCtrl was a grid cell.
This catches ESC and ENTER events in textCtrls and processes them as if the textCtrl were a grid cell. This method can be bound to the wx.EVT_KEY_DOWN event of any textCtrl. See phaseconfigurepanel.py in diffpy.pdfgui.gui for an example.
- ESC – Cancel the edit and highlight the text. This requires that
panel has a _focusedText attribute that stores the previous value.
- ENTER – Confirm the edit and move to the next cell (the default TAB
behavior).
diffpy.pdfgui.gui.wxextensions.paneldialog module
This module contains the PanelDialog class, a simple class that turns any panel into a dialog.