def draw(self): self.sliders = [] self.slidercaptions = [] w = 500.0 spacing_px = 40.0 button_px = 100 marginbottom_px = 20.0 margintop_px = 20.0 button_area_px = 100.0 button_height_px = 80 r = 100.0 h = len( self.variables ) * spacing_px + marginbottom_px + margintop_px + button_area_px + button_height_px spacing = (spacing_px / h) * r posy = -r / 2 + marginbottom_px / h * r + len(self.variables) * spacing self.c = controls.controls(x=0, y=0, width=w, height=h, range=r) for v in self.variables: s = controls.slider(pos=(-15, posy), width=7, length=70, axis=(1, 0, 0)) s.value = v.default s.min, s.max = v.bounds sc = controls.label(text=v.name, align='right', pos=(r * (-0.5 + 0.1), posy), display=self.c.display, box=False) self.sliders.append(s) self.slidercaptions.append(sc) print posy posy -= spacing controls.button(pos=(0, r * (0.5 - button_area_px / h)), height=button_height_px / h * r, width=r / 2, text='reset', action=lambda: self.reset())
def draw(self): w = 200 self.c = controls.controls(x=0, y=0, width=w, height=w, range=100) controls.button(pos=(-60,30), height=30, width=40, text='<<' , action=lambda: self.first()) controls.toggle(pos=(0,30),height=30, width=40, text='Pause', action=lambda: self.pauseToggle()) controls.button(pos=(60,30), height=30, width=40, text='>>',action= lambda: self.last()) self.timelabel = controls.label(pos=(-15,-55),display=self.c.display) self.s1=controls.slider(pos=(-15,-30), width=7, length=70, axis=(1,0,0), action=lambda: self.slider1()) self.s1.value = 0 self.s2=controls.slider(pos=(-15,80),min=-1,max=3, width=7, length=70, axis=(1,0,0),action=lambda: self.slider2()) self.s2.value = 0 self.pause = False self.advancestep = 1
def draw(self): self.sliders=[] self.slidercaptions = [] w = 500.0 spacing_px = 40.0 button_px = 100 marginbottom_px = 20.0 margintop_px = 20.0 button_area_px = 100.0 button_height_px = 80 r= 100.0 h = len(self.variables)*spacing_px + marginbottom_px + margintop_px + button_area_px + button_height_px spacing = (spacing_px / h) * r posy = -r/2 + marginbottom_px/h*r + len(self.variables)*spacing self.c = controls.controls(x=0, y=0, width=w, height=h, range=r) for v in self.variables: s = controls.slider(pos=(-15,posy), width=7, length=70, axis=(1,0,0)) s.value = v.default s.min,s.max = v.bounds sc = controls.label(text=v.name,align='right', pos=(r*(-0.5+0.1),posy),display=self.c.display,box = False ) self.sliders.append(s) self.slidercaptions.append(sc) print posy posy-=spacing controls.button(pos=(0,r*(0.5-button_area_px/h)), height=button_height_px/h*r, width=r/2, text='reset' , action=lambda: self.reset())
def draw(self): w = 200 self.c = controls.controls(x=0, y=0, width=w, height=w, range=100) controls.button(pos=(-60, 30), height=30, width=40, text='<<', action=lambda: self.first()) controls.toggle(pos=(0, 30), height=30, width=40, text='Pause', action=lambda: self.pauseToggle()) controls.button(pos=(60, 30), height=30, width=40, text='>>', action=lambda: self.last()) self.timelabel = controls.label(pos=(-15, -55), display=self.c.display) self.s1 = controls.slider(pos=(-15, -30), width=7, length=70, axis=(1, 0, 0), action=lambda: self.slider1()) self.s1.value = 0 self.s2 = controls.slider(pos=(-15, 80), min=-1, max=3, width=7, length=70, axis=(1, 0, 0), action=lambda: self.slider2()) self.s2.value = 0 self.pause = False self.advancestep = 1