Package schrodinger :: Package ui :: Module propertyselector :: Class PropertySelector
[hide private]
[frames] | no frames]

Class PropertySelector

widget.tkinterwidget.schroWidget --+    
                                   |    
        Tkinter.Misc --+           |    
                       |           |    
      Tkinter.BaseWidget --+       |    
                           |       |    
            Tkinter.Pack --+       |    
                           |       |    
           Tkinter.Place --+       |    
                           |       |    
            Tkinter.Grid --+       |    
                           |       |    
              Tkinter.Widget --+   |    
                               |   |    
                   Tkinter.Frame --+    
                                   |    
          widget.tkinterwidget.Frame --+
                                       |
                                      PropertySelector


Class for selecting properties, with features to organize by
family/owner, filter by name, and/or sort items in the list.
The PropertySelector displays a list of property user names,
specified as structure.PropertyName objects.  

Duplicate user names are distinguished by creating a
PropertyName.user_name attribute to with a unique numerical id suffix.
e.g. foo, foo-1, foo-2.  The name checking is done once, at __init__.


Class Attributes
----------------
None

Instance Attributes
-------------------
displayed_proplist (list)
    List of PropertyNames currently displayed in the (primary)
    listbox, in the order they appear in the list.  This is typically
    a subset of self.proplist.

propfamilies (dict)
    Family name keys for a list of structure.PropertyName instances
    in that roup.

displayed_aux_proplist (list)
    List of PropertyNames currently displayed in the auxilary listbox,
    in the order they appear in the list.  This is typically a subset
    of self.proplist.

selected_not_displayed_proplist (list)
    List of PropertyNames for item not currently displayed due to
    family menu or field regex filtering.

move_to_aux (bool)
    If True, items will be moved from main table to auxilary table
    when they are selected. If false, they will be duplicated in
    both tables if selected (default False)

Nested Classes [hide private]

Inherited from Tkinter.Misc: getdouble, getint

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
PropertySelector is a stk.Frame, and this container accepts all standard options from that base class.
 
alphabetizeNames(self)
Alternate order the displayed list items, either alphabetically or in the native order depending on the value of self.alpha_var.
 
checkUserNames(self)
Assigns PropertyName.user_name attributes, for all members in self.proplist.
 
filterNames(self)
Limit the displayed list items to those items that match the self.filter_field filter regex.
 
createFamilies(self)
Create a dictionary of families.
 
setProperties(self, proplist, selected=None)
Set the listbox items to the structure.PropertyName.user_name attributes for the PropertyName instances in proplist.
 
getSelected(self)
Return a list of PropertyName objects selected from the listbox.
 
selectAll(self)
Select all properties in the listbox.
 
clear(self)
Clear property selection
 
showProperties(self, proplist, selected=None)
Place the PropertyName.userName in the listbox.
 
showFamily(self, family)
Place only the properties of the specified family/owner in the listbox.
 
setState(self, state=stk.NORMAL)
Enable/disable the PropertySelector widget.
 
decrementAuxSelected(self)
Reorders the displayed list items in self.aux_listbox such that the selected item moves down one rung in the listbox.
 
incrementAuxSelected(self)
Reorders the displayed list items in self.aux_listbox such that the selected item moves up one rung in the listbox.
 
addToAuxListbox(self)
Adds items selected in self.listbox to self.aux_listbox.
 
delFromAuxListbox(self)
Removes selected item from self.aux_listbox.
 
getAllAuxListbox(self)
Returns a list of all the displayed property names in the self.aux_listbox.
 
showAuxProperties(self, proplist, selected=None)
Display the auxilary listbox items to the structure.PropertyName.user_name attributes for the PropertyName instances in proplist.

Inherited from widget.tkinterwidget.schroWidget: grid, pack

Inherited from Tkinter.BaseWidget: destroy

Inherited from Tkinter.BaseWidget (private): _do, _setup

Inherited from Tkinter.Misc: __contains__, __getitem__, __setitem__, __str__, after, after_cancel, after_idle, bbox, bell, bind, bind_all, bind_class, bindtags, cget, clipboard_append, clipboard_clear, clipboard_get, colormodel, columnconfigure, config, configure, deletecommand, event_add, event_delete, event_generate, event_info, focus, focus_displayof, focus_force, focus_get, focus_lastfor, focus_set, getboolean, getvar, grab_current, grab_release, grab_set, grab_set_global, grab_status, grid_bbox, grid_columnconfigure, grid_location, grid_propagate, grid_rowconfigure, grid_size, grid_slaves, image_names, image_types, keys, lift, lower, mainloop, nametowidget, option_add, option_clear, option_get, option_readfile, pack_propagate, pack_slaves, place_slaves, propagate, quit, register, rowconfigure, selection_clear, selection_get, selection_handle, selection_own, selection_own_get, send, setvar, size, slaves, tk_bisque, tk_focusFollowsMouse, tk_focusNext, tk_focusPrev, tk_menuBar, tk_setPalette, tk_strictMotif, tkraise, unbind, unbind_all, unbind_class, update, update_idletasks, wait_variable, wait_visibility, wait_window, waitvar, winfo_atom, winfo_atomname, winfo_cells, winfo_children, winfo_class, winfo_colormapfull, winfo_containing, winfo_depth, winfo_exists, winfo_fpixels, winfo_geometry, winfo_height, winfo_id, winfo_interps, winfo_ismapped, winfo_manager, winfo_name, winfo_parent, winfo_pathname, winfo_pixels, winfo_pointerx, winfo_pointerxy, winfo_pointery, winfo_reqheight, winfo_reqwidth, winfo_rgb, winfo_rootx, winfo_rooty, winfo_screen, winfo_screencells, winfo_screendepth, winfo_screenheight, winfo_screenmmheight, winfo_screenmmwidth, winfo_screenvisual, winfo_screenwidth, winfo_server, winfo_toplevel, winfo_viewable, winfo_visual, winfo_visualid, winfo_visualsavailable, winfo_vrootheight, winfo_vrootwidth, winfo_vrootx, winfo_vrooty, winfo_width, winfo_x, winfo_y

Inherited from Tkinter.Misc (private): _bind, _configure, _displayof, _getboolean, _getdoubles, _getints, _grid_configure, _nametowidget, _options, _register, _report_exception, _root, _substitute

Inherited from Tkinter.Pack: forget, info, pack_configure, pack_forget, pack_info

Inherited from Tkinter.Place: place, place_configure, place_forget, place_info

Inherited from Tkinter.Grid: grid_configure, grid_forget, grid_info, grid_remove, location

Class Variables [hide private]

Inherited from Tkinter.Misc: _noarg_

Inherited from Tkinter.Misc (private): _subst_format, _subst_format_str, _tclCommands

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

 

PropertySelector is a stk.Frame, and this container accepts all
standard options from that base class.

Other keyword options:

proplist (list)
    List of structure.PropertyName instances.  The order of items
    in the list is the default order of items in the list box.

multi (boolean)
    True allows selecting multiple properties.  Default is False,
    single item selection.

show_family_menu (boolean)
    True add property family menu to control visible list items.
    Default is True.

show_family_name (boolean) 
    True displays the family/owner in parentheses after each name.
    Default is True.

show_alpha_toggle (boolean) 
    True displays the alphabetize checkbox toggle.  Default is
    False.

show_filter_field (boolean) 
    True displays the string filter controls.  Default is False.

show_aux_listbox (boolean)
    True displays the auxilary listbox, add and remove buttons,
    and decrement/increment buttons.  self.getSelected() returns
    all the items in the auxilary list box, in the order they
    appear.

presort (boolean)
    True orders the properties alphabetically by
    PropertyName.userName() values.

move_to_aux (bool)
    If True, items will be moved from main table to auxilary table
    when they are selected. If false, they will be duplicated in
    both tables if selected (default False)

Overrides: Tkinter.BaseWidget.__init__

checkUserNames(self)

 

Assigns PropertyName.user_name attributes, for all members in self.proplist. The user_names are unique within the PropertySelector instance.

The user_name strings are typically just the PropertyName.userName(), but may be modified with a numerical suffix to make them unique, or decorated with the family name (which does not garuntee uniqeness, but may make the items easier for the end user to visually group).

createFamilies(self)

 

Create a dictionary of families. PropertyName.family keys for a list of PropertyNames in that family.

setProperties(self, proplist, selected=None)

 

Set the listbox items to the structure.PropertyName.user_name
attributes for the PropertyName instances in proplist.

proplist (list) 
    A list of structure.PropertyName objects. 

selected (list)
    List of structure.PropertyName instances in proplist
    that should be selected.

showProperties(self, proplist, selected=None)

 

Place the PropertyName.userName in the listbox.  The items appear
in the input list order.

If aux table is present and move_to_aux is set; do not include 
properties that are in the aux table.

proplist (list)
    List of structure.PropertyName instances. 

selected (list)
    List of structure.PropertyName instances in proplist
    that should be selected (used when there is no aux table).

showFamily(self, family)

 

Place only the properties of the specified family/owner in the listbox. 'family' is the family/owner string for a property (e.g., 'qp' for the property 'i_qp_#amide').

setState(self, state=stk.NORMAL)

 

Enable/disable the PropertySelector widget. If the widget has no property list, it is disabled. Otherwise, the 'state' can be set to stk.NORMAL or stk.DISABLED.

showAuxProperties(self, proplist, selected=None)

 

Display the auxilary listbox items to the
structure.PropertyName.user_name attributes for the PropertyName
instances in proplist.

proplist (list)
    List of structure.PropertyName instances. 

selected (list)
    List of structure.PropertyName instances in proplist
    that should be selected.