comparison pyink/frameline.py @ 952:88bf64efcc1d

rename _type_id to _type, it is GGbject type actually
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 17 Nov 2010 11:18:44 +0800
parents e06a8d90592c
children 2346d3238e03
comparison
equal deleted inserted replaced
951:e06a8d90592c 952:88bf64efcc1d
18 self.right_tween_type = 0 18 self.right_tween_type = 0
19 pass 19 pass
20 pass 20 pass
21 21
22 class frameruler(gtk.DrawingArea): 22 class frameruler(gtk.DrawingArea):
23 _type_id = 0 23 _type = 0
24 _frame_width = 10 # Width for each frame is 10 pixels 24 _frame_width = 10 # Width for each frame is 10 pixels
25 _mark_color = 0x808080 # color of mark lines 25 _mark_color = 0x808080 # color of mark lines
26 _number_color = 0x000000 # color of frame number 26 _number_color = 0x000000 # color of frame number
27 _number_sz = 8 # font size of frame number 27 _number_sz = 8 # font size of frame number
28 28
29 def __new__(clz, *args): 29 def __new__(clz, *args):
30 if not frameruler._type_id: 30 if not frameruler._type:
31 frameruler._type_id = gobject.type_register(frameruler) 31 frameruler._type = gobject.type_register(frameruler)
32 pass 32 pass
33 fr = gobject.new(frameruler._type_id) 33 fr = gobject.new(frameruler._type)
34 return fr 34 return fr
35 35
36 def __init__(self, num_frames=20): 36 def __init__(self, num_frames=20):
37 self.connect('expose_event', self._fr_expose) 37 self.connect('expose_event', self._fr_expose)
38 self._num_frames = num_frames 38 self._num_frames = num_frames
103 pass 103 pass
104 104
105 ## Show frame status of a layer 105 ## Show frame status of a layer
106 # 106 #
107 class frameline(gtk.DrawingArea): 107 class frameline(gtk.DrawingArea):
108 _type_id = 0 108 _type = 0
109 _frame_width = 10 # Width for each frame is 10 pixels 109 _frame_width = 10 # Width for each frame is 10 pixels
110 _select_color = 0xee2222 # color of border of selected frame 110 _select_color = 0xee2222 # color of border of selected frame
111 _key_mark_color = 0x000000 # color of marks for key frames. 111 _key_mark_color = 0x000000 # color of marks for key frames.
112 _key_mark_sz = 4 # width and height of a key frame mark 112 _key_mark_sz = 4 # width and height of a key frame mark
113 _tween_color = 0x808080 # color of tween line 113 _tween_color = 0x808080 # color of tween line
116 _normal_bgcolors = [0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xcccccc] 116 _normal_bgcolors = [0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xcccccc]
117 _normal_border = 0xaaaaaa # border color of normal frames. 117 _normal_border = 0xaaaaaa # border color of normal frames.
118 _active_border = 0xff3030 # border color of an active frame 118 _active_border = 0xff3030 # border color of an active frame
119 119
120 def __new__(clz, *args): 120 def __new__(clz, *args):
121 if not frameline._type_id: 121 if not frameline._type:
122 frameline._type_id = gobject.type_register(frameline) 122 frameline._type = gobject.type_register(frameline)
123 pass 123 pass
124 fl_obj = gobject.new(frameline._type_id) 124 fl_obj = gobject.new(frameline._type)
125 return fl_obj 125 return fl_obj
126 126
127 def __init__(self, num_frames=20): 127 def __init__(self, num_frames=20):
128 self.connect('button-press-event', self._press_hdl) 128 self.connect('button-press-event', self._press_hdl)
129 self.connect('expose-event', self._fl_expose) 129 self.connect('expose-event', self._fl_expose)