# HG changeset patch # User Thinker K.F. Li # Date 1295419949 -28800 # Node ID cf2691a18a7a449a61f757f481c1ac7cec7bce5b # Parent c53331c55a23046c5eaf7a2e6c702de7f1e47c31 Add component dock diff -r c53331c55a23 -r cf2691a18a7a pyink/MBScene.py --- a/pyink/MBScene.py Wed Jan 19 10:01:09 2011 +0800 +++ b/pyink/MBScene.py Wed Jan 19 14:52:29 2011 +0800 @@ -58,6 +58,7 @@ self.desktop = desktop self.window = win self.top = None + self._comp_dock = None self.last_update = None pybInkscape.inkscape.connect('change_selection', self.do_selection) self.last_select = None @@ -355,6 +356,8 @@ pass def show(self): + from comp_dock import comp_dock + self.OK = True if not self._root: self._root = self.desktop.doc().root().repr @@ -383,6 +386,10 @@ self._add_buttons(hbox) vbox.pack_start(hbox, expand=False) + dock = comp_dock() + dock.install_dock(self.desktop) + self._comp_dock = dock + self.top.show_all() self.last_update = None return False diff -r c53331c55a23 -r cf2691a18a7a pyink/comp_dock.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pyink/comp_dock.py Wed Jan 19 14:52:29 2011 +0800 @@ -0,0 +1,43 @@ +import gtk +import os + +## \brief User interface for management components and their timelines. +# +class comp_dock(gtk.VBox): + def __init__(self, fname=None): + super(comp_dock, self).__init__() + + if not fname: + dirname = os.path.dirname(__file__) + fname = os.path.join(dirname, 'component_dock.glade') + print fname + pass + + builder = gtk.Builder() + builder.add_from_file(fname) + dock_top = builder.get_object('component_dock_top') + dock_top_parent = dock_top.get_parent() + dock_top_parent.remove(dock_top) + self.pack_start(dock_top) + dock_top.show() + + self._builder = builder + self._dock_top = dock_top + self._desktop = None + self._dock_item = None + pass + + def install_dock(self, desktop): + self._desktop = desktop + + dock = desktop.getDock() + item = dock.new_item('component_dock', + 'Component and timeline manager', + 'feBlend-icon', dock.ITEM_ST_DOCKED_STATE) + item_vbox = item.get_vbox() + item_vbox.pack_start(self) + self._dock_item = item + + self.show() + pass + pass diff -r c53331c55a23 -r cf2691a18a7a pyink/component_dock.glade --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pyink/component_dock.glade Wed Jan 19 14:52:29 2011 +0800 @@ -0,0 +1,173 @@ + + + + + + + + True + vertical + + + True + vertical + + + True + 0 + 5 + Components + + + False + False + 0 + + + + + 100 + True + True + + + 1 + + + + + True + 5 + start + + + gtk-add + True + True + True + True + + + False + False + 0 + + + + + gtk-remove + True + True + True + True + + + False + False + 1 + + + + + False + False + 1 + 2 + + + + + 0 + + + + + True + + + False + False + 5 + 1 + + + + + True + vertical + + + True + 0 + 5 + Actions / timelines + + + False + False + 0 + + + + + 100 + True + True + + + 1 + + + + + True + 5 + start + + + gtk-add + True + True + True + True + + + False + False + 0 + + + + + gtk-remove + True + True + True + True + + + False + False + 1 + + + + + False + False + 2 + 2 + + + + + 2 + + + + + + + + +