comparison light8/panels.py @ 60:f177a2ff34f5

scrolled sub panels
author drewp
date Tue, 09 Jul 2002 07:36:45 +0000
parents 032b2b67bc10
children 2508c6b7a4e0
comparison
equal deleted inserted replaced
59:001646cd5349 60:f177a2ff34f5
83 changelevel, subediting, longestname): 83 changelevel, subediting, longestname):
84 84
85 sublist = Subs.subs.items() 85 sublist = Subs.subs.items()
86 sublist.sort() 86 sublist.sort()
87 87
88 for p in scenesparent,effectsparent:
89 sw = ScrolledWindow(p)
90 sw.window.bind("<ButtonPress-4>",lambda s=sw.vsb: scrollscrolledwindow(s,-1))
91 sw.window.bind("<ButtonPress-5>",lambda s=sw.vsb: scrollscrolledwindow(s,1))
92 sw.pack(expand=1,fill=BOTH)
93 if p==scenesparent:
94 scenesparent = sw.window
95 else:
96 effectsparent = sw.window
97
88 for name, sub in sublist: 98 for name, sub in sublist:
89 # choose one of the sub panels to add to 99 # choose one of the sub panels to add to
90 if sub.is_effect: 100 if sub.is_effect:
91 parent=effectsparent 101 parent=effectsparent
92 side1='bottom' 102 side1='bottom'
105 width1=longestname 115 width1=longestname
106 116
107 # make frame that surrounds the whole submaster 117 # make frame that surrounds the whole submaster
108 f=Frame(parent, bd=1, relief='raised') 118 f=Frame(parent, bd=1, relief='raised')
109 f.pack(fill='both',exp=1,side=side2) 119 f.pack(fill='both',exp=1,side=side2)
120
110 121
111 # make DoubleVar (there might be one left around from 122 # make DoubleVar (there might be one left around from
112 # before a refresh) 123 # before a refresh)
113 if name not in scalelevels: 124 if name not in scalelevels:
114 scalelevels[name]=DoubleVar() 125 scalelevels[name]=DoubleVar()
118 scaleopts = {'troughcolor' : 'grey70'} 129 scaleopts = {'troughcolor' : 'grey70'}
119 if sub.color: 130 if sub.color:
120 scaleopts['troughcolor'] = sub.color 131 scaleopts['troughcolor'] = sub.color
121 132
122 s = FlyingFader(f, label=str(name), variable=scalelevels[name], 133 s = FlyingFader(f, label=str(name), variable=scalelevels[name],
123 showvalue=0, length=300-17, 134 showvalue=0, length=100,
124 width=14, sliderlength=14, 135 width=14, sliderlength=14,
125 to=end1,res=.001,from_=end2,bd=1, font=stdfont, 136 to=end1,res=.001,from_=end2,bd=1, font=stdfont,
126 orient=orient1, 137 orient=orient1,
127 labelwidth=width1, 138 labelwidth=width1,
128 **scaleopts) 139 **scaleopts)
129 140
130 # tell subediting what widget to highlight when it's 141 # tell subediting what widgets to highlight when it's
131 # editing a sub 142 # editing a sub
132 for w in (s,s.label,s.vlabel, s.scale): 143 for w in (s,s.label,s.vlabel, s.scale):
133 subediting.register(subname=name,widget=w) 144 subediting.register(subname=name,widget=w)
134 145
135 if not sub.is_effect: 146 if not sub.is_effect:
136 self.subeditingbuttons(f,side1,sub,name,lightboard,subediting) 147 self.subeditingbuttons(f,side1,sub,name,lightboard,subediting)
137 148
138 self.axisbuttons(f,s,xfader,stdfont,side1,name) 149 self.axisbuttons(f,s,xfader,stdfont,side1,name)
139 150
140 s.pack(side='left', fill=BOTH) 151 s.pack(side='left', fill=BOTH, expand=1)
141 152
142 # effects frame? 153 # effects frame?
143 sframe = Frame(f,bd=2,relief='groove') 154 sframe = Frame(f,bd=2,relief='groove')
144 sub.draw_tk(sframe) 155 sub.draw_tk(sframe)
145 sframe.pack(side='left',fill='y') 156 sframe.pack(side='left',fill='y')