comparison pyink/frameline.py @ 1224:5d731460b32c

Remove search_by_id() from frameline. - frameline is only responsible for drawing a row of frames. - layers and scenes are managed by MBScene_dom. So, function of search_by_id() must move to MBScene_dom class. - onCellClick() and _change_active_frame() are responsible for handling GUI event. - It should not be used with workaround to implement some function. - Solutions - MBScene_dom.find_layer_n_scene_of_nod() is used to replace search_by_id(). - MBScene_framelines.active_frame() is used to replace the workaround.
author Thinker K.F. Li <thinker@codemud.net>
date Thu, 06 Jan 2011 11:11:27 +0800
parents 33aa2d63e240
children f0864d7177e3
comparison
equal deleted inserted replaced
1223:ec964cf4c993 1224:5d731460b32c
864 def get_frame_data(self, idx): 864 def get_frame_data(self, idx):
865 pos = self._find_keyframe(idx) 865 pos = self._find_keyframe(idx)
866 key = self._keys[pos] 866 key = self._keys[pos]
867 return key.ref 867 return key.ref
868 868
869 def search_by_id(self,ID):
870 for k in self._keys:
871 try:
872 if k.ref == None: continue
873 if k.ref.getAttribute("ref") == ID:
874 return k.idx
875 except:
876 traceback.print_exc()
877 pass
878 pass
879 return -1
880
881 def set_frame_data(self, idx, value): 869 def set_frame_data(self, idx, value):
882 pos = self._find_keyframe(idx) 870 pos = self._find_keyframe(idx)
883 key = self._keys[pos] 871 key = self._keys[pos]
884 key.ref = value 872 key.ref = value
885 pass 873 pass