# HG changeset patch # User Thinker K.F. Li # Date 1295502476 -28800 # Node ID 89e640789750590d790181afcb9b683784586c8d # Parent e6bb9d00341f4501a3a5d9382cb0a42d2af04712 Separate envet handlers from base functions of comp_doc diff -r e6bb9d00341f -r 89e640789750 pyink/comp_dock.py --- a/pyink/comp_dock.py Thu Jan 20 13:08:26 2011 +0800 +++ b/pyink/comp_dock.py Thu Jan 20 13:47:56 2011 +0800 @@ -5,12 +5,11 @@ ## \brief User interface for management components and their timelines. # -class comp_dock(object): - __metaclass__ = data_monitor.data_monitor - __data_monitor_prefix__ = 'on_' - +# This class provide base functions to show components and timelines. +# +class comp_dock_base(object): def __init__(self, domview_ui, fname=None): - super(comp_dock, self).__init__() + super(comp_dock_base, self).__init__(domview_ui, fname) if not fname: dirname = os.path.dirname(__file__) @@ -122,7 +121,20 @@ pass raise ValueError, 'unknown component name - %s' % (name) + pass +## \brief UI interactive handlers +# +# A mix-in to handle UI events. +# +class comp_dock_ui(object): + __metaclass__ = data_monitor.data_monitor + __data_monitor_prefix__ = 'on_' + + def __init__(self, *args): + super(comp_dock_ui, self).__init__() + pass + def _current_component(self): treeview = self._components_treeview path, col = treeview.get_cursor() @@ -238,3 +250,13 @@ print '%s - %s' % (path, new_text) pass pass + +## \brief Component dock +# +# Mix base functions and event handlers together. +# +class comp_dock(comp_dock_base, comp_dock_ui): + def __init__(self, domview_ui, fname=None): + super(comp_dock, self).__init__(domview_ui, fname) + pass + pass