comparison light8/panels.py @ 38:0ce56c4dd355

small ui enhancements
author drewp
date Sun, 07 Jul 2002 12:16:27 +0000
parents 411de8b46aef
children 2cd759c2b3c7
comparison
equal deleted inserted replaced
37:115636cca107 38:0ce56c4dd355
75 # channel_levels is an output - changelevel will use it to access 75 # channel_levels is an output - changelevel will use it to access
76 # these labels 76 # these labels
77 77
78 class Subpanels: 78 class Subpanels:
79 def __init__(self, scenesparent, effectsparent, scalelevels, Subs, xfader, 79 def __init__(self, scenesparent, effectsparent, scalelevels, Subs, xfader,
80 changelevel): 80 changelevel, subediting, longestname):
81 81
82 sublist = Subs.subs.items() 82 sublist = Subs.subs.items()
83 sublist.sort() 83 sublist.sort()
84 84
85 for name, sub in sublist: 85 for name, sub in sublist:
86 # choose one of the sub panels to add to 86 # choose one of the sub panels to add to
87 if sub.is_effect: 87 if sub.is_effect:
88 parent=effectsparent 88 parent=effectsparent
89 side1='bottom' 89 side1='bottom'
90 orient='vert' 90 orient1='vert'
91 end1=0 91 end1=0
92 end2=1 92 end2=1
93 width1=len(name)
93 else: 94 else:
94 parent=scenesparent 95 parent=scenesparent
95 side1='right' 96 side1='right'
96 orient='horiz' 97 orient1='horiz'
97 end1=1 98 end1=1
98 end2=0 99 end2=0
100 width1=longestname
99 101
100 # make frame that surrounds the whole submaster 102 # make frame that surrounds the whole submaster
101 f=Frame(parent, bd=1, relief='raised') 103 f=Frame(parent, bd=1, relief='raised')
102 f.pack(fill='both',exp=1,side=('top','left')[sub.is_effect]) 104 f.pack(fill='both',exp=1,side=('top','left')[sub.is_effect])
103 105
113 115
114 s = FlyingFader(f, label=str(name), variable=scalelevels[name], 116 s = FlyingFader(f, label=str(name), variable=scalelevels[name],
115 showvalue=0, length=300-17, 117 showvalue=0, length=300-17,
116 width=18, sliderlength=18, 118 width=18, sliderlength=18,
117 to=end1,res=.001,from_=end2,bd=0, font=stdfont, 119 to=end1,res=.001,from_=end2,bd=0, font=stdfont,
118 orient=orient, 120 orient=orient1,
119 labelwidth=12, # this should be equal to the longest label name 121 labelwidth=width1,
120 **scaleopts) 122 **scaleopts)
123
124 eb = Button(f,text="E",font=stdfont,padx=0,pady=0,bd=1,command=lambda subediting=subediting,sub=sub: subediting.setsub(sub))
125 eb.pack(side=side1,fill='both',padx=0,pady=0)
121 126
122 for axis in ('y','x'): 127 for axis in ('y','x'):
123 cvar=IntVar() 128 cvar=IntVar()
124 cb=Togglebutton(f,text=axis.upper(),variable=cvar,font=stdfont, padx=0, 129 cb=Togglebutton(f,text=axis.upper(),variable=cvar,font=stdfont, padx=0,
125 pady=0, bd=1) 130 pady=0, bd=1)