Changeset - f22f925442a2
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 13 years ago 2012-06-16 01:31:50
drewp@bigasterisk.com
2 files changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -88,25 +88,25 @@ class Main(object):
 
        connect(wtree.get_object("subterms")) # works for that area
 

	
 
    def onDataReceived(self, widget, context, x, y, selection,
 
                       targetType, time):
 
        uri = URIRef(selection.data.strip())
 
        subName = self.graph.label(uri)
 

	
 
        try:
 
            self.makeSubterm(subName, withCurve=True)
 
        except SubtermExists:
 
            pass
 
        curveView = self.curvesetView.row(subName).curveView
 
        t = self.lastSeenInputTime # curveView.current_time() # new curve hasn't heard the time yet
 
        t = self.lastSeenInputTime # curveView.current_time() # new curve hasn't heard the time yet. this has gotten too messy- everyone just needs to be able to reach the time source
 
        print "time", t
 
        curveView.add_point((t - .5, 0))
 
        curveView.add_point((t, 1))
 
            
 

	
 
    def onNewCurve(self, *args):
 
        dialog = self.wtree.get_object("newCurve")
 
        entry = self.wtree.get_object("newCurveName")
 
        # if you don't have songx, that should be the suggested name
 
        entry.set_text("")
 
        if dialog.run() == 1:
 
            self.curveset.new_curve(entry.get_text())
light9/curvecalc/curveview.py
Show inline comments
 
@@ -68,37 +68,39 @@ class Sketch:
 
                self.curveview.add_point(p)
 
                finalPoints.append(p)
 
            
 
        self.curveview.update_curve()
 
        self.curveview.select_points(finalPoints)
 

	
 
class SelectManip(object):
 
    """
 
    selection manipulator is created whenever you have a selection. It
 
    draws itself on the canvas and edits the points when you drag
 
    various parts
 
    """
 
    def __init__(self, parent, getSelectedIndices, getWorldPoint, getScreenPoint, getCanvasSize, setPoints, getWorldTime, getWorldValue, getDragRange):
 
    def __init__(self, parent, getSelectedIndices, getWorldPoint, getScreenPoint,
 
                 getCanvasSize, setPoints, getWorldTime, getWorldValue, getDragRange):
 
        """parent goocanvas group"""
 
        self.getSelectedIndices = getSelectedIndices
 
        self.getWorldPoint = getWorldPoint
 
        self.getScreenPoint = getScreenPoint
 
        self.getCanvasSize = getCanvasSize
 
        self.setPoints = setPoints
 
        self.getWorldTime = getWorldTime
 
        self.getDragRange = getDragRange
 
        self.getWorldValue = getWorldValue
 
        self.grp = goocanvas.Group(parent=parent)
 
        
 
        self.title = goocanvas.Text(parent=self.grp, text="selectmanip", x=10, y=10, fill_color='white', font="ubuntu 10")
 
        self.title = goocanvas.Text(parent=self.grp, text="selectmanip",
 
                                    x=10, y=10, fill_color='white', font="ubuntu 10")
 

	
 
        self.bbox = goocanvas.Rect(parent=self.grp,
 
                                   fill_color_rgba=0xffff0030,
 
                                   line_width=0)
 

	
 
        self.xTrans = goocanvas.Polyline(parent=self.grp, close_path=True,
 
                                         fill_color_rgba=0xffffff88,
 
                                         )
 
        self.centerScale = goocanvas.Polyline(parent=self.grp, close_path=True,
 
                                              fill_color_rgba=0xffffff88,
 
                                         )
 

	
0 comments (0 inline, 0 general)