Mercurial > code > home > repos > light9
comparison light8/panels.py @ 30:e9d2e7754fd9
sideways subs, new x/y buttons (which don't draw right, but they work)
author | drewp |
---|---|
date | Sun, 07 Jul 2002 10:48:38 +0000 |
parents | 219d6fcbc28d |
children | 925382e7cdc8 |
comparison
equal
deleted
inserted
replaced
29:f595fdd4c548 | 30:e9d2e7754fd9 |
---|---|
2 | 2 |
3 from Tkinter import * | 3 from Tkinter import * |
4 from uihelpers import * | 4 from uihelpers import * |
5 import Patch | 5 import Patch |
6 from FlyingFader import FlyingFader | 6 from FlyingFader import FlyingFader |
7 import Pmw | |
7 | 8 |
8 stdfont = ('Arial', 8) | 9 stdfont = ('Arial', 8) |
9 monofont = ('Courier', 8) | 10 monofont = ('Courier', 8) |
10 | 11 |
11 class Controlpanel(Frame): | 12 class Controlpanel(Frame): |
80 | 81 |
81 sublist = Subs.subs.items() | 82 sublist = Subs.subs.items() |
82 sublist.sort() | 83 sublist.sort() |
83 | 84 |
84 for name, sub in sublist: | 85 for name, sub in sublist: |
86 # choose one of the sub panels to add to | |
85 if sub.is_effect: | 87 if sub.is_effect: |
86 parent=effectsparent | 88 parent=effectsparent |
89 side1='bottom' | |
90 orient='vert' | |
87 else: | 91 else: |
88 parent=scenesparent | 92 parent=scenesparent |
93 side1='right' | |
94 orient='horiz' | |
89 | 95 |
96 # make frame that surrounds the whole submaster | |
90 f=Frame(parent, bd=1, relief='raised') | 97 f=Frame(parent, bd=1, relief='raised') |
91 f.pack(fill='both',exp=1,side='left') | 98 f.pack(fill='both',exp=1,side=('top','left')[sub.is_effect]) |
92 | 99 |
100 # make DoubleVar (there might be one left around from before a refresh) | |
93 if name not in scalelevels: | 101 if name not in scalelevels: |
94 scalelevels[name]=DoubleVar() | 102 scalelevels[name]=DoubleVar() |
95 | 103 |
96 sub.set_slider_var(scalelevels[name]) | 104 sub.set_slider_var(scalelevels[name]) |
97 | 105 |
98 scaleopts = {} | 106 scaleopts = {} |
99 if sub.color: | 107 if sub.color: |
100 scaleopts['troughcolor'] = sub.color | 108 scaleopts['troughcolor'] = sub.color |
101 | 109 |
102 s = FlyingFader(f, label=str(name), variable=scalelevels[name], | 110 s = FlyingFader(f, label=str(name), variable=scalelevels[name], |
103 showvalue=0, length=300-17, | 111 showvalue=0, length=300-17, |
104 width=20, to=0,res=.001,from_=1,bd=1, font=stdfont, | 112 width=18, sliderlength=18, |
105 **scaleopts) | 113 to=1,res=.001,from_=0,bd=0, font=stdfont, |
114 orient=orient, | |
115 labelwidth=12, # this should be equal to the longest label name | |
116 **scaleopts) | |
106 | 117 |
107 for axis in ('y','x'): | 118 for axis in ('y','x'): |
108 cvar=IntVar() | 119 cvar=IntVar() |
109 cb=Checkbutton(f,text=axis,variable=cvar,font=stdfont, padx=0, | 120 cb=Togglebutton(f,text=axis.upper(),variable=cvar,font=stdfont, padx=0, |
110 pady=0, bd=1) | 121 pady=0, bd=1) |
111 button = ('Alt','Control')[axis=='y'] # unused? | 122 cb.pack(side=side1,fill='both', padx=0, pady=0) |
112 # s.bind('<Key-%s>'%axis, lambda ev,cb=cb: cb.invoke) | 123 s.bind('<Key-%s>'%axis, lambda ev,cb=cb: cb.invoke) |
113 cb.pack(side='bottom',fill='both', padx=0, pady=0) | |
114 xfader.registerbutton(name,axis,cvar) | 124 xfader.registerbutton(name,axis,cvar) |
115 | 125 |
116 s.pack(side='left', fill=BOTH) | 126 s.pack(side='left', fill=BOTH) |
117 | 127 |
118 # effects frame? | 128 # effects frame? |