コード例 #1
0
ファイル: EllipseTool.cs プロジェクト: mathovonic96/KPL
 public void ToolMouseUp(object Sender, MouseEventArgs Event)
 {
     if (EllipseShape != null)
     {
         if (Event.Button == MouseButtons.Left)
         {
             Command = new DrawEllipseCommand(ActiveCanvas, LineColor.Info, FillColor.Info, XPoint, YPoint, this.EllipseShape.Width, this.EllipseShape.Height);
             ActiveCanvas.RemoveDrawnShape(this.EllipseShape);
             ActiveCanvas.AddCommandtoStack(Command);
             Command.Execute();
         }
     }
 }
コード例 #2
0
ファイル: SelectionTool.cs プロジェクト: mathovonic96/KPL
 public void ToolMouseUp(object Sender, MouseEventArgs Event)
 {
     if (Event.Button == MouseButtons.Left)
     {
         Debug.WriteLine("{0} {1} {2} {3}", XPoint, YPoint, Event.X - XPoint, Event.Y - YPoint);
         if (SelectionArea != null)
         {
             ActiveCanvas.DeselectAllShapes();
             SelectedShapes = ActiveCanvas.SelectShapeAt(XPoint, YPoint, SelectionArea.Width, SelectionArea.Height);
             ActiveCanvas.RemoveDrawnShape(SelectionArea);
         }
     }
     else if (Event.Button == MouseButtons.Right)
     {
         ActiveCanvas.RemoveDrawnShape(MovementTrace);
         this.xAmount = Event.X - XPoint;
         this.yAmount = Event.Y - YPoint;
         Command      = new MoveShapeCommand(SelectedShapes, XPoint, YPoint, xAmount, yAmount);
         Command.Execute();
         ActiveCanvas.AddCommandtoStack(Command);
     }
 }
コード例 #3
0
ファイル: LineTool.cs プロジェクト: mathovonic96/KPL
 public void ToolMouseUp(object Sender, MouseEventArgs Event)
 {
     if (this.LineShape != null)
     {
         if (Event.Button == MouseButtons.Left)
         {
             ActiveCanvas.RemoveDrawnShape(this.LineShape);
             LineShape = null;
             Command   = new DrawLineCommand(ActiveCanvas, LineColor.Info, XPoint, YPoint, Event.X, Event.Y);
             Command.Execute();
             ActiveCanvas.AddCommandtoStack(Command);
         }
     }
 }
コード例 #4
0
ファイル: FillTool.cs プロジェクト: mathovonic96/KPL
 public void ToolMouseUp(object Sender, MouseEventArgs Event)
 {
     if (Event.Button == MouseButtons.Left)
     {
         int   XPoint        = Event.X;
         int   YPoint        = Event.Y;
         Shape SelectedShape = ActiveCanvas.GetShapeAt(XPoint, YPoint);
         if (SelectedShape != null)
         {
             Command = new ChangeFillColorCommand(ActiveCanvas, FillColor.Info, XPoint, YPoint);
             Command.Execute();
             ActiveCanvas.AddCommandtoStack(Command);
         }
     }
 }