Package schrodinger :: Package application :: Package mcpro :: Module guide :: Class Guide
[hide private]
[frames] | no frames]

Class Guide

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


This class provides a simplistic workflow widget.
There are many meanings in the term ``workflow'', here it refers to a number of distinct steps going from the start to the
end to accomplish a task.

1. How does the widget look and work in general?
   - You are encouraged to run this script to take a look first before reading on. From now on, I assume you have looked.
   - So you see this widget is composed of a few buttons connected by a few arrows. Each button represents a distinct step
     in the workflow. Pressed buttons means the visited steps. An unpressed and active button means the immediate next
     step.
   - At each moment, there is zero or one unpressed and active button.
   - Going forward into the next step, you press a button down. Going backward to a prior step, you raise a pressed
     button.
   - Often than not, a dialog is wanted to pop out to warn the GUI user when s/he tries to go backward. This feature is
     supported by the widget.
   - In your code, each button will be hooked up to your function that takes the relief state of the particular button as
     the only one argument. Your function is responsible to react properly to the change of the status of the guide
     widget.
   - A separator line can be put on the top, or bottom, or both top and bottom of the step buttons so to separate other
     widgets from the guide widget.
2. Limitation of the current implementation:
   - It only draws and handles linear workflow steps.
   
*** Class attributes **********************
BUTTON_LOOK  A dictionary defining the default look of the step buttons.

*** Options *******************************
master          - Master frame on which this widget will be drawn on.
bw_dlg_title    - Title of the dialog that shows warning message when the GUI user tries to go backward.
                  Defaults to 'Warning'.
bw_dlg_message  - Warning message shown in a dialog when the GUI user tries to go backward.
                  Defaults tp 'Go to prior step?'.
bw_command      - Command that should be called before the backward warning dialog is popped out. Defaults to `None'.
step            - A tuple defining the steps.
button_look     - A dictionary defining the look of the step buttons. Defaults to `Guide.BUTTON_LOOK'.
sep_pos         - Position of the separator line, taking one of these values: `TOP', `BOTTOM', `BOTH', `None'.
                  Defaults to `Top'.

Nested Classes [hide private]

Inherited from Tkinter.Misc: getdouble, getint

Instance Methods [hide private]
 
__init__(self, master, bw_dlg_title='Warning', bw_dlg_message='Go to prior step?', bw_command=None, step=(), button_look={'bd': 1, 'state': 'disabled'}, sep_pos='top')
See docstring of the class.
 
_btn_cmd(self, button, should_warn=True)
 
_enable_arrow(self)
 
step_config(self, step, step_to=None, command=None, **kw)
 
step_configure(self, **kw)
 
step_hide(self, step, step_to=None)
 
step_show(self, step, step_to=None)
 
add_step(self, step)
 
del_step(self, i)
 
enable_next(self, should_enable=True)

Inherited from ui.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]
  BUTTON_LOOK = {'bd': 1, 'state': 'disabled'}

Inherited from Tkinter.Misc: _noarg_

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

Method Details [hide private]

__init__(self, master, bw_dlg_title='Warning', bw_dlg_message='Go to prior step?', bw_command=None, step=(), button_look={'bd': 1, 'state': 'disabled'}, sep_pos='top')
(Constructor)

 

See docstring of the class.

Overrides: Tkinter.BaseWidget.__init__