comparison pyink/MBScene.py @ 1249:16a1166c3850

Add more method being monitored
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 11 Jan 2011 10:20:53 +0800
parents 2f9fa5d59e67
children 62eaa20b8cf7
comparison
equal deleted inserted replaced
1248:2f9fa5d59e67 1249:16a1166c3850
108 108
109 self.desktop = desktop 109 self.desktop = desktop
110 self.window = win 110 self.window = win
111 self.top = None 111 self.top = None
112 self.last_update = None 112 self.last_update = None
113 pybInkscape.inkscape.connect('change_selection', self.on_selection) 113 pybInkscape.inkscape.connect('change_selection', self.do_selection)
114 self.last_select = None 114 self.last_select = None
115 self._lockui = False 115 self._lockui = False
116 self._director = None 116 self._director = None
117 self.document = None 117 self.document = None
118 self._root = root 118 self._root = root
217 self._domview.copy_key_group(layer_idx, left_start, frame_idx) 217 self._domview.copy_key_group(layer_idx, left_start, frame_idx)
218 218
219 self._director.show_scene(frame_idx) 219 self._director.show_scene(frame_idx)
220 pass 220 pass
221 221
222 def changeObjectLabel(self,w): 222 def do_changeObjectLabel(self,w):
223 o = self.desktop.selection.list()[0] 223 o = self.desktop.selection.list()[0]
224 o.setAttribute("inkscape:label", self.nameEditor.get_text()) 224 o.setAttribute("inkscape:label", self.nameEditor.get_text())
225 pass 225 pass
226 226
227 def addNameEditor(self,hbox): 227 def addNameEditor(self,hbox):
228 self.nameEditor = gtk.Entry(max=40) 228 self.nameEditor = gtk.Entry(max=40)
229 hbox.pack_start(self.nameEditor,expand=False,fill=False) 229 hbox.pack_start(self.nameEditor,expand=False,fill=False)
230 self.editDone = gtk.Button('Set') 230 self.editDone = gtk.Button('Set')
231 hbox.pack_start(self.editDone,expand=False,fill=False) 231 hbox.pack_start(self.editDone,expand=False,fill=False)
232 self.editDone.connect('clicked', self.changeObjectLabel) 232 self.editDone.connect('clicked', self.do_changeObjectLabel)
233 pass 233 pass
234 234
235 def addTweenTypeSelector(self, hbox): 235 def addTweenTypeSelector(self, hbox):
236 tweenbox = gtk.HBox() 236 tweenbox = gtk.HBox()
237 label = gtk.Label('Tween Type') 237 label = gtk.Label('Tween Type')
241 self.tweenTypeSelector.append_text('normal') 241 self.tweenTypeSelector.append_text('normal')
242 self.tweenTypeSelector.append_text('scale') 242 self.tweenTypeSelector.append_text('scale')
243 self.tweenTypeSelector.set_active(0) 243 self.tweenTypeSelector.set_active(0)
244 tweenbox.pack_start(self.tweenTypeSelector, expand=False, fill=False) 244 tweenbox.pack_start(self.tweenTypeSelector, expand=False, fill=False)
245 hbox.pack_start(tweenbox, expand=False, fill=False) 245 hbox.pack_start(tweenbox, expand=False, fill=False)
246 self.tweenTypeSelector.connect('changed', self.onTweenTypeChange) 246 self.tweenTypeSelector.connect('changed', self.do_TweenTypeChange)
247 pass 247 pass
248 248
249 def on_selection(self,w,obj): 249 def do_selection(self,w,obj):
250 objs = self.desktop.selection.list() 250 objs = self.desktop.selection.list()
251 try: 251 try:
252 o = objs[0] 252 o = objs[0]
253 print o.getCenter() 253 print o.getCenter()
254 if o == self.last_select: 254 if o == self.last_select:
344 self.lockui=True 344 self.lockui=True
345 layer_idx, frame_idx = self._domview.get_active_layer_frame() 345 layer_idx, frame_idx = self._domview.get_active_layer_frame()
346 self._domview.rm_frames(layer_idx, frame_idx, 1) 346 self._domview.rm_frames(layer_idx, frame_idx, 1)
347 self.lockui=False 347 self.lockui=False
348 348
349 def onTweenTypeChange(self, w): 349 def do_TweenTypeChange(self, w):
350 if self._disable_tween_type_selector: 350 if self._disable_tween_type_selector:
351 return 351 return
352 352
353 layer_idx, frame_idx = self._domview.get_active_layer_frame() 353 layer_idx, frame_idx = self._domview.get_active_layer_frame()
354 tween_type = self.tweenTypeSelector.get_active() 354 tween_type = self.tweenTypeSelector.get_active()