comparison pyink/domview_ui.py @ 1431:60f2c9a24cdb

Keep the same active layer and frame when switching back a timeline. - Add functions to remember frame and layer for timeline at domview. - Recall active frame and layer when calling switch_component() and switch_timeline().
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 11 Apr 2011 00:05:25 +0800
parents f1fa284fc9c9
children 8e8c9ab3818f
comparison
equal deleted inserted replaced
1430:bf405cb2d7cb 1431:60f2c9a24cdb
422 422
423 def switch_component(self, name): 423 def switch_component(self, name):
424 self._dom.switch_component(name) 424 self._dom.switch_component(name)
425 self._framelines_refresh() # from domview_ui 425 self._framelines_refresh() # from domview_ui
426 self._comp_dock.refresh_timelines() 426 self._comp_dock.refresh_timelines()
427
428 cur_layer_idx, cur_frame_idx = self._dom.get_current_frame()
429 self._fl_stack.active_frame(cur_layer_idx, cur_frame_idx)
427 pass 430 pass
428 431
429 def all_comp_names(self): 432 def all_comp_names(self):
430 names = self._dom.all_comp_names() 433 names = self._dom.all_comp_names()
431 return names 434 return names
448 pass 451 pass
449 452
450 def switch_timeline(self, name): 453 def switch_timeline(self, name):
451 self._dom.switch_timeline(name) 454 self._dom.switch_timeline(name)
452 self._framelines_refresh() # from domview_ui 455 self._framelines_refresh() # from domview_ui
456
457 cur_layer_idx, cur_frame_idx = self._dom.get_current_frame()
458 self._fl_stack.active_frame(cur_layer_idx, cur_frame_idx)
453 pass 459 pass
454 460
455 def all_timeline_names(self): 461 def all_timeline_names(self):
456 names = self._dom.all_timeline_names() 462 names = self._dom.all_timeline_names()
457 return names 463 return names
874 880
875 def get_max_frame(self): 881 def get_max_frame(self):
876 max_frame = self._dom.get_max_frame() 882 max_frame = self._dom.get_max_frame()
877 return max_frame 883 return max_frame
878 884
885 def remember_current_frame(self, layer_idx, frame_idx):
886 self._dom.remember_current_frame(layer_idx, frame_idx)
887 pass
888
889 def get_current_frame(self):
890 return self._dom.get_current_frame()
891
879 ## \brief add the current position to the undo buffer. 892 ## \brief add the current position to the undo buffer.
880 # 893 #
881 # The msg will be displayed in the UI to indicate the undo set. 894 # The msg will be displayed in the UI to indicate the undo set.
882 def mark_undo(self, msg): 895 def mark_undo(self, msg):
883 self._dom.mark_undo(msg) 896 self._dom.mark_undo(msg)