comparison pyink/MBScene.py @ 1267:2318a094a277

Move function around to separate do_* from others
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 12 Jan 2011 20:42:31 +0800
parents d4559e7f82cd
children cd848c2ec29f
comparison
equal deleted inserted replaced
1266:d4559e7f82cd 1267:2318a094a277
166 self._domviewui.copy_key_group(layer_idx, left_start, frame_idx) 166 self._domviewui.copy_key_group(layer_idx, left_start, frame_idx)
167 167
168 self._director.show_scene(frame_idx) 168 self._director.show_scene(frame_idx)
169 pass 169 pass
170 170
171 def do_changeObjectLabel(self,w): 171 def markUndo(self, msg):
172 o = self.desktop.selection.list()[0] 172 #self._domviewui.mark_undo(msg)
173 o.setAttribute("inkscape:label", self.nameEditor.get_text()) 173 # FIXME: move into domview latter when the inkscpae-pybind is modified
174 pass 174 # to support the sp_document_done.
175 175 self.desktop.doc().done("None",msg)
176
176 def addNameEditor(self,hbox): 177 def addNameEditor(self,hbox):
177 self.nameEditor = gtk.Entry(max=40) 178 self.nameEditor = gtk.Entry(max=40)
178 hbox.pack_start(self.nameEditor,expand=False,fill=False) 179 hbox.pack_start(self.nameEditor,expand=False,fill=False)
179 self.editDone = gtk.Button('Set') 180 self.editDone = gtk.Button('Set')
180 hbox.pack_start(self.editDone,expand=False,fill=False) 181 hbox.pack_start(self.editDone,expand=False,fill=False)
193 tweenbox.pack_start(self.tweenTypeSelector, expand=False, fill=False) 194 tweenbox.pack_start(self.tweenTypeSelector, expand=False, fill=False)
194 hbox.pack_start(tweenbox, expand=False, fill=False) 195 hbox.pack_start(tweenbox, expand=False, fill=False)
195 self.tweenTypeSelector.connect('changed', self.do_TweenTypeChange) 196 self.tweenTypeSelector.connect('changed', self.do_TweenTypeChange)
196 pass 197 pass
197 198
199 def lock(self):
200 self._domviewui.lock()
201 pass
202
203 def unlock(self):
204 self._domviewui.unlock()
205 pass
206
207
208 def do_changeObjectLabel(self,w):
209 o = self.desktop.selection.list()[0]
210 o.setAttribute("inkscape:label", self.nameEditor.get_text())
211 pass
212
198 def do_selection(self,w,obj): 213 def do_selection(self,w,obj):
199 objs = self.desktop.selection.list() 214 objs = self.desktop.selection.list()
200 try: 215 try:
201 o = objs[0] 216 o = objs[0]
202 print o.getCenter() 217 print o.getCenter()
220 def do_CellClick(self, layer_idx, frame_idx): 235 def do_CellClick(self, layer_idx, frame_idx):
221 self._director.show_scene(frame_idx) 236 self._director.show_scene(frame_idx)
222 self.selectSceneObject(layer_idx, frame_idx) 237 self.selectSceneObject(layer_idx, frame_idx)
223 pass 238 pass
224 239
225 def markUndo(self, msg):
226 #self._domviewui.mark_undo(msg)
227 # FIXME: move into domview latter when the inkscpae-pybind is modified
228 # to support the sp_document_done.
229 self.desktop.doc().done("None",msg)
230
231 def doInsertKeyScene(self,w): 240 def doInsertKeyScene(self,w):
232 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() 241 layer_idx, frame_idx = self._domviewui.get_active_layer_frame()
233 self.insertKeyScene(layer_idx, frame_idx) 242 self.insertKeyScene(layer_idx, frame_idx)
234 self.selectSceneObject(layer_idx, frame_idx) 243 self.selectSceneObject(layer_idx, frame_idx)
235 self.markUndo("insert key") 244 self.markUndo("insert key")
244 layer_idx, frame_idx = self._domviewui.get_active_layer_frame() 253 layer_idx, frame_idx = self._domviewui.get_active_layer_frame()
245 self.removeKeyScene(layer_idx, frame_idx) 254 self.removeKeyScene(layer_idx, frame_idx)
246 self.markUndo("remove key") 255 self.markUndo("remove key")
247 return 256 return
248 257
249 def lock(self):
250 self._domviewui.lock()
251 pass
252
253 def unlock(self):
254 self._domviewui.unlock()
255 pass
256
257
258 def doExtendScene(self,w): 258 def doExtendScene(self,w):
259 self.extendScene() 259 self.extendScene()
260 self.markUndo("extend key") 260 self.markUndo("extend key")
261 pass 261 pass
262 262