Changeset - e3362ad9a123
[Not reviewed]
default
0 3 0
David McClosky - 20 years ago 2005-06-17 20:21:31
dmcc@bigasterisk.com
curvecalc gets "see time until end", C-r for reload, doc updates
3 files changed with 19 insertions and 6 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -225,11 +225,13 @@ def sub_commands_tk(master, curveset, su
 

	
 
    def add_cmd():
 
        add_one_subterm(newname.get(), curveset, subterms, root, ssv, '')
 
        newname.set('')
 

	
 
    def reload_subs():
 
        dispatcher.send('reload all subs')
 

	
 
    tk.Button(f, text="reload subs", command=reload_subs).pack(side='left')
 
    tk.Button(f, text="reload subs (C-r)", 
 
        command=reload_subs).pack(side='left')
 
    tk.Button(f,text="new subterm named:", command=add_cmd).pack(side='left')
 
    tk.Entry(f,textvariable=newname).pack(side='left',fill='x',exp=1)
 
    return f
 
@@ -293,6 +295,7 @@ def savekey(*args):
 
    print "saved"
 
    
 
root.bind("<Control-Key-s>",savekey)
 
root.bind("<Control-Key-r>", lambda evt: dispatcher.send('reload all subs'))
 

	
 
create_status_lines(root)
 
for helpline in ["Bindings: C-s save subterms; B1 drag point; C-B1 curve add point; 1..5 add point at time; Esc see current time; S-Esc see curtime to end; Mousewheel zoom; C-p play/pause music at mouse",
light9/curve.py
Show inline comments
 
@@ -78,9 +78,12 @@ class Curveview(tk.Canvas):
 
                      dispatcher.send("zoom about mouse",
 
                                      t=self.world_from_screen(ev.x,0)[0],
 
                                      factor=factor))
 
        self.bind("<Key-Escape>",lambda ev:
 
        self.bind("<Key-Escape>", lambda ev:
 
                  dispatcher.send("see time",
 
                                  t=self.current_time()))
 
        self.bind("<Shift-Escape>", lambda ev:
 
                  dispatcher.send("see time until end",
 
                                  t=self.current_time()))
 
        self.bind("<Control-p>", lambda ev:
 
                  dispatcher.send("music seek",
 
                                  t=self.world_from_screen(ev.x,0)[0]))
light9/zoomcontrol.py
Show inline comments
 
@@ -75,9 +75,10 @@ class Zoomcontrol(object,tk.Canvas):
 
        dispatcher.connect(lambda maxtime: (setattr(self,'maxtime',maxtime+15),
 
                                            self.redrawzoom()),
 
                           "max time",weak=0)
 
        dispatcher.connect(self.zoom_about_mouse,"zoom about mouse")
 
        dispatcher.connect(self.see_time,"see time")
 
        dispatcher.connect(self.zoom_to_range,"zoom to range")
 
        dispatcher.connect(self.zoom_about_mouse, "zoom about mouse")
 
        dispatcher.connect(self.see_time, "see time")
 
        dispatcher.connect(self.see_time_until_end, "see time until end")
 
        dispatcher.connect(self.zoom_to_range, "zoom to range")
 
        self.created=1
 
    def zoom_to_range(self,start,end):
 
        self.start = start
 
@@ -89,13 +90,19 @@ class Zoomcontrol(object,tk.Canvas):
 
        self.end = t + factor*(self.end-t)
 
        self.redrawzoom()
 

	
 
    def see_time(self,t):
 
    def see_time(self, t):
 
        vis_seconds = self.end - self.start
 
        margin = vis_seconds * .1
 
        if t < self.start or t > (self.end - vis_seconds * .3):
 
            self.offset = t - margin
 

	
 
        self.redrawzoom()
 

	
 
    def see_time_until_end(self, t):
 
        self.start = t - 2
 
        self.end = self.maxtime
 

	
 
        self.redrawzoom()
 
            
 
    def input_time(self,val):
 
        t=val
0 comments (0 inline, 0 general)