Package diffpy :: Package pdfgui :: Package gui :: Module phasepanelutils
[hide private]
[frames] | no frames]

Module phasepanelutils

source code

Common methods used in the phase panels.



Functions [hide private]
 
float2str(x)
compact string representation of float
source code
 
refreshTextCtrls(panel)
Refreshes the TextCtrls on the panel.
source code
 
refreshGrid(panel)
Refreshes grid on the panel.
source code
 
getSelectedAtoms(panel)
Get list of indices of selected atoms.
source code
 
getSelectedCells(panel)
Get list of (row,col) pairs of selected cells.
source code
 
quickResizeColumns(panel, indices)
Resize the columns that were recently affected by cell changes.
source code
 
isWholeRowSelected(panel, row)
Check whether a whole row is selected.
source code
 
canCopySelectedCells(panel)
Check to see if we can copy selected cells.
source code
 
canPasteIntoCells(panel)
Check if clipboard contents are formatted for grid insertion.
source code
 
copySelectedCells(panel)
Copy block of selected cells or individual cell into clipboard.
source code
 
pasteIntoCells(panel)
Paste clipboard contents into cells.
source code
Variables [hide private]
  clipcells = []
  __id__ = '$Id: phasepanelutils.py 2980 2009-04-02 00:14:33Z ju...
Function Details [hide private]

refreshTextCtrls(panel)

source code 
Refreshes the TextCtrls on the panel.

This is used by phaseconfigurepanel and phaseresultspanel.

This method updates the following TextCtrls with with contents of the
structure member variable of the panel.
textCtrlA
textCtrlB
textCtrlC
textCtrlAlpha
textCtrlBeta
textCtrlGamma
textCtrlScaleFactor
textCtrlDelta1
textCtrlDelta2
textCtrlSratio
textCtrlRcut
textCtrlStepcut
textCtrlSpdiameter

refreshGrid(panel)

source code 
Refreshes grid on the panel.

This is used by phaseconfigurepanel and phaseresultspanel.

This method fills the grid with the contents of the structure member
variable of the panel. It is expected that the grid is named 'gridAtoms'.

getSelectedCells(panel)

source code 
Get list of (row,col) pairs of selected cells.

This returns selected cells whether they are in blocks or are
independent.

This could be sped up if necessary.

quickResizeColumns(panel, indices)

source code 
Resize the columns that were recently affected by cell changes.

This is faster than the normal grid AutoSizeColumns, since the latter loops
over the entire grid. In addition, this will not cause a
EVT_GRID_CMD_CELL_CHANGE event to be thrown, which can cause recursion.
This method will only increase column size.

canCopySelectedCells(panel)

source code 
Check to see if we can copy selected cells.

To be copyable, the cells must exist in a single block or there must be a
single cell selected. Note that a block that is selected by individual cells
is considered a collection of individual atoms, not a block. This is default
wxPython behavior.

canPasteIntoCells(panel)

source code 
Check if clipboard contents are formatted for grid insertion.

This also checks to see if the cell selection is appropriate for pasting.

copySelectedCells(panel)

source code 
Copy block of selected cells or individual cell into clipboard.

    This stores the cells as a plain text grid so that it can be copied to and
    from other applications.
    Columns are delimited by tabs '     '.
    Rows are delimited by newlines '
'.
    

pasteIntoCells(panel)

source code 
Paste clipboard contents into cells.

canPasteIntoCells must be called before this method in order to format
clipboard text for pasting.


Variables Details [hide private]

__id__

Value:
'$Id: phasepanelutils.py 2980 2009-04-02 00:14:33Z juhas $'