Ejemplo n.º 1
0
    def doMouseUp(self, Sender, Button, Shift, X, Y):
        thePoint = TPoint()

        # must always call this first because it sets the focus
        PdParameterPanel.doMouseUp(self, Sender, Button, Shift, X, Y)
        thePoint = Point(X, Y)
        if delphi_compatability.PtInRect(self.valueTextRect, thePoint):
            if self.slider.Enabled and not self.slider.readOnly:
                self.selectedItemIndex = kItemValueText
                self.Invalidate()
                self.adjustValue()
        elif delphi_compatability.PtInRect(self.unitTextRect, thePoint):
            self.selectedItemIndex = kItemUnitText
            self.Invalidate()
            self.selectNextUnitInSet(
                delphi_compatability.TShiftStateEnum.ssShift in Shift,
                delphi_compatability.TShiftStateEnum.ssCtrl in Shift)
Ejemplo n.º 2
0
    def doMouseDown(self, Sender, Button, Shift, X, Y):
        thePoint = TPoint()

        if delphi_compatability.Application.terminated:
            return
        # must always call this first because it sets the focus
        PdParameterPanel.doMouseDown(self, Sender, Button, Shift, X, Y)
        if (self.editEnabled):
            thePoint = Point(X, Y)
            if delphi_compatability.PtInRect(self.tdoRect, thePoint) and (
                    delphi_compatability.TShiftStateEnum.ssCtrl in Shift):
                #(button = mbRight) then
                self.movingTdo = true
                self.moveStart = thePoint
                self.moveStartPosition = self.position
Ejemplo n.º 3
0
    def doMouseUp(self, Sender, Button, Shift, X, Y):
        i = 0
        thePoint = TPoint()

        # must always call this first because it sets the focus
        PdParameterPanel.doMouseUp(self, Sender, Button, Shift, X, Y)
        if (self.editEnabled):
            thePoint = Point(X, Y)
            if self.choiceStrings.Count > 0:
                for i in range(0, self.choiceStrings.Count):
                    if delphi_compatability.PtInRect(self.choiceRects[i],
                                                     thePoint):
                        self.setNewValue(i)
                        self.selectedItemIndex = kItemFirstChoice + self.currentChoice
                        break
            self.Invalidate()
Ejemplo n.º 4
0
    def doMouseUp(self, Sender, Button, Shift, X, Y):
        thePoint = TPoint()
        newColor = TColorRef()

        # must always call this first because it sets the focus
        PdParameterPanel.doMouseUp(self, Sender, Button, Shift, X, Y)
        if (self.plant == None) or (self.readOnly):
            return
        thePoint = Point(X, Y)
        if delphi_compatability.PtInRect(self.colorRect, thePoint):
            self.selectedItemIndex = kItemColorRect
            newColor = udomain.domain.getColorUsingCustomColors(
                self.currentColor)
            if newColor != self.currentColor:
                self.currentColor = newColor
                umain.MainForm.doCommand(updcom.PdChangeColorValueCommand(
                ).createCommandWithListOfPlants(umain.MainForm.selectedPlants,
                                                self.currentColor,
                                                self.param.fieldNumber,
                                                uparams.kNotArray,
                                                self.param.regrow))
                self.updateDisplay()
                self.Invalidate()
Ejemplo n.º 5
0
    def doMouseUp(self, Sender, Button, Shift, X, Y):
        thePoint = TPoint()

        if delphi_compatability.Application.terminated:
            return
        PdParameterPanel.doMouseUp(self, Sender, Button, Shift, X, Y)
        if (self.editEnabled):
            thePoint = Point(X, Y)
            if delphi_compatability.PtInRect(self.fileNameRect, thePoint):
                self.selectedItemIndex = kItemFileName
                self.pickTdo()
            elif delphi_compatability.PtInRect(self.tdoRect, thePoint):
                self.selectedItemIndex = kItemTdo
                if self.movingTdo:
                    self.movingTdo = false
                    self.position.X = self.moveStartPosition.X + (
                        X - self.moveStart.X)
                    self.position.Y = self.moveStartPosition.Y + (
                        Y - self.moveStart.Y)
                    self.moveStart = Point(0, 0)
                    self.Invalidate()
                elif Button == delphi_compatability.TMouseButton.mbLeft:
                    self.pickTdo()
            elif delphi_compatability.PtInRect(self.turnLeftRect, thePoint):
                self.selectedItemIndex = kItemTurnLeft
                self.rotateAngle = self.rotateAngle + 10
            elif delphi_compatability.PtInRect(self.turnRightRect, thePoint):
                self.selectedItemIndex = kItemTurnRight
                self.rotateAngle = self.rotateAngle - 10
            elif delphi_compatability.PtInRect(self.enlargeRect, thePoint):
                self.selectedItemIndex = kItemEnlarge
                self.scale = self.scale + 0.1
                self.recenterTdo()
            elif delphi_compatability.PtInRect(self.reduceRect, thePoint):
                self.selectedItemIndex = kItemReduce
                self.scale = self.scale - 0.1
                self.recenterTdo()
            self.Invalidate()
Ejemplo n.º 6
0
 def pointOnDragger(self, x, y):
     result = false
     result = delphi_compatability.PtInRect(self.draggerRect, Point(x, y))
     return result