HappyDoc Generated Documentation ./ModelPanel/base.py

. / ModelPanel / base.py 

Functions   
  attributesCmd 
attributesCmd ( models )
  toggleModelField 
toggleModelField (
        models,
        field,
        onVal=1,
        offVal=0,
        openState=0,
        )
  setModelField 
setModelField (
        models,
        field,
        value,
        openState=0,
        )

functions used in model panel button; could be called directly also

  addButton 
addButton (
        name,
        callback,
        minModels=1,
        maxModels=None,
        moleculesOnly=True,
        balloon=None,
        defaultFrequent=True,
        )

Add a button to the Model Actions button list.

name is the button name (duh). callback is the function to call when the button is pressed. The arg to callback will be a list of models. min/maxModels indicate how many models have to be selected in the browser for the button to be active (None indicates no limit). if moleculesOnly is True, then those models have to be Molecules.

This is a module function so that it can be called even if the model panel has not yet been created.

Exceptions   

KeyError, "Button named '%s' already exists" % name

  inputPath 
inputPath ( model )
  setModelFieldOnly 
setModelFieldOnly (
        models,
        field,
        onVal=1,
        offVal=0,
        openState=0,
        )
  activateAllCmd 
activateAllCmd ()

Activate all models. Restore previous activities if called again.

  backboneCmd 
backboneCmd ( models,  resTrace=1 )
  selectCmd 
selectCmd ( models )
  tileCmd 
tileCmd ( models )
  readableName 
readableName ( model )
  nameColumn 
nameColumn ( m )
  showAllAtomsCmd 
showAllAtomsCmd ( models )
  focusCmd 
focusCmd ( models )
  addColumns 
addColumns ( columnInfo,  defaultShown=1 )

Add columns to the model table.

columnInfo is a list of 3-tuples, one for each column to add. The tuple consists of (column name, value type, value-fetch function). The value type should be text, image, imagetext, or toggle. The value-fetch function takes one argument (a model) and (for image and text) should return the value to display in the table cell. For imagetext the return value should be an (image, text) tuple. toggle shows a toggle button and the return value should be a (boolean, callback) tuple. If the boolean is true, a check will be shown on the toggle button; otherwise the button is blank. The callback is invoked when the toggle is pressed, with the model and the new boolean as arguments. The value of an image is the name of the image (the Tix name, e.g. tick for tickmark). A value of None for image or text will leave a blank cell.

defaultShown controls whether the column is shown in the model table or not as long as the user has not yet expressed a preference in the Configuration panel about it.

Exceptions   

ValueError, "Duplicate model panel" "column name: %s" % name

  surfCmd 
surfCmd ( models,  category )
  getPhysicalChains 
getPhysicalChains ( model )
  seqCmd 
seqCmd ( models )
Classes   

ModelPanel


This document was automatically generated Thu Nov 15 14:11:11 2007 by HappyDoc version 3.0.a1