Exemplo n.º 1
0
        private void MyCanvas_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (ClikOnCanvas)
            {
                Globals.ToolNow.MouseUp(e.GetPosition(MyCanvas));

                if (Globals.ToolNow != Globals.Transform["Allotment"] & Globals.ToolNow != Globals.Transform["ZoomRect"] & Globals.ToolNow != Globals.Transform["Hand"])
                {
                    Globals.AddStep();
                    gotoPastStep.IsEnabled   = true;
                    gotoSecondStep.IsEnabled = false;
                }
                if (Globals.ToolNow == Globals.Transform["ZoomRect"])
                {
                    MyCanvas.LayoutTransform = new ScaleTransform(Globals.ScaleRateX, Globals.ScaleRateY);
                    ScrollViewerCanvas.ScrollToVerticalOffset(Globals.DistanceToPointY * Globals.ScaleRateY);
                    ScrollViewerCanvas.ScrollToHorizontalOffset(Globals.DistanceToPointX * Globals.ScaleRateX);
                }
                if (Globals.ToolNow == Globals.HandTool)
                {
                    Globals.ToolNow = Globals.Transform["Allotment"];
                }
                ClikOnCanvas = false;
                Invalidate();
            }
        }
Exemplo n.º 2
0
        private void MyCanvas_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (ClickOnCanvas)
            {
                NotArtist.SelectedTool.MouseUp(e.GetPosition(MyCanvas));

                if (NotArtist.SelectedTool != NotArtist.ToolsList["Allotment"] & NotArtist.SelectedTool != NotArtist.ToolsList["Zoom"] & NotArtist.SelectedTool != NotArtist.ToolsList["Hand"])
                {
                    NotArtist.AddCondition();
                    gotoPastCondition.IsEnabled   = true;
                    gotoSecondCondition.IsEnabled = false;
                    SaveButton.Content            = "Save*";
                }
                if (NotArtist.SelectedTool == NotArtist.ToolsList["Zoom"])
                {
                    MyCanvas.LayoutTransform = new ScaleTransform(NotArtist.ScaleRateX, NotArtist.ScaleRateY);
                    ScrollViewerCanvas.ScrollToVerticalOffset(NotArtist.DistanceToPointY * NotArtist.ScaleRateY);
                    ScrollViewerCanvas.ScrollToHorizontalOffset(NotArtist.DistanceToPointX * NotArtist.ScaleRateX);
                }
                if (NotArtist.SelectedTool == NotArtist.HandTool)
                {
                    NotArtist.SelectedTool = NotArtist.ToolsList["Allotment"];
                }
                ClickOnCanvas = false;
                Invalidate();
            }
        }
Exemplo n.º 3
0
        private void MyCanvas_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (ClikOnCanvas)
            {
                TreeTop.ToolNow.MouseUp(e.GetPosition(MyCanvas));

                if (!(TreeTop.ToolNow is AllotmentTool) & !(TreeTop.ToolNow is ZoomTool) & !(TreeTop.ToolNow is HandTool))
                {
                    TreeTop.AddState();
                    gotoPastCondition.IsEnabled   = true;
                    gotoSecondCondition.IsEnabled = false;
                }
                if (TreeTop.ToolNow is ZoomTool)
                {
                    MyCanvas.LayoutTransform = new ScaleTransform(TreeTop.ScaleRateX, TreeTop.ScaleRateY);
                    ScrollViewerCanvas.ScrollToVerticalOffset(TreeTop.DistanceToPointY * TreeTop.ScaleRateY);
                    ScrollViewerCanvas.ScrollToHorizontalOffset(TreeTop.DistanceToPointX * TreeTop.ScaleRateX);
                }
                if (TreeTop.ToolNow is HandForFigureTool)
                {
                    TreeTop.ToolNow = TreeTop.TransformTools["Allotment"];
                }
                ClikOnCanvas = false;
                Invalidate();
            }
        }
Exemplo n.º 4
0
        private void MyCanvas_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (ClikOnCanvas)
            {
                ToolsBar.ToolNow.MouseUp(e.GetPosition(MyCanvas));

                if (ToolsBar.ToolNow != ToolsBar.Transform["Allotment"] & ToolsBar.ToolNow != ToolsBar.Transform["ZoomRect"] & ToolsBar.ToolNow != ToolsBar.Transform["Hand"])
                {
                    ToolsBar.AddCondition();
                    gotoPastCondition.IsEnabled   = true;
                    gotoSecondCondition.IsEnabled = false;
                }
                if (ToolsBar.ToolNow == ToolsBar.Transform["ZoomRect"])
                {
                    MyCanvas.LayoutTransform = new ScaleTransform(ToolsBar.ScaleRateX, ToolsBar.ScaleRateY);
                    ScrollViewerCanvas.ScrollToVerticalOffset(ToolsBar.DistanceToPointY * ToolsBar.ScaleRateY);
                    ScrollViewerCanvas.ScrollToHorizontalOffset(ToolsBar.DistanceToPointX * ToolsBar.ScaleRateX);
                }
                if (ToolsBar.ToolNow == ToolsBar.HandTool)
                {
                    ToolsBar.ToolNow = ToolsBar.Transform["Allotment"];
                }
                ClikOnCanvas = false;
                Invalidate();
            }
        }
Exemplo n.º 5
0
 private void MyCanvas_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (ClickOnCanvas)
     {
         NotArtist.SelectedTool.MouseMove(e.GetPosition(MyCanvas));
         if (NotArtist.SelectedTool == NotArtist.ToolsList["Hand"])
         {
             ScrollViewerCanvas.ScrollToVerticalOffset(NotArtist.HandScrollY);
             ScrollViewerCanvas.ScrollToHorizontalOffset(NotArtist.HandScrollX);
         }
         Invalidate();
     }
 }
Exemplo n.º 6
0
 private void MyCanvas_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (ClikOnCanvas)
     {
         Globals.ToolNow.MouseMove(e.GetPosition(MyCanvas));
         if (Globals.ToolNow == Globals.Transform["Hand"])
         {
             ScrollViewerCanvas.ScrollToVerticalOffset(Globals.HandScrollY);
             ScrollViewerCanvas.ScrollToHorizontalOffset(Globals.HandScrollX);
         }
         Invalidate();
     }
 }
Exemplo n.º 7
0
 private void MyCanvas_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (ClikOnCanvas)
     {
         TreeTop.ToolNow.MouseMove(e.GetPosition(MyCanvas));
         if (TreeTop.ToolNow is HandTool)
         {
             ScrollViewerCanvas.ScrollToVerticalOffset(TreeTop.HandScrollY);
             ScrollViewerCanvas.ScrollToHorizontalOffset(TreeTop.HandScrollX);
         }
         Invalidate();
     }
 }
Exemplo n.º 8
0
 private void MyCanvas_MouseMove(object sender, MouseEventArgs e)
 {
     if (ClikOnCanvas)
     {
         ToolsBar.ToolNow.MouseMove(e.GetPosition(MyCanvas));
         if (ToolsBar.ToolNow == ToolsBar.Transform["Hand"])
         {
             ScrollViewerCanvas.ScrollToVerticalOffset(ToolsBar.HandScrollY);
             ScrollViewerCanvas.ScrollToHorizontalOffset(ToolsBar.HandScrollX);
         }
         Invalidate();
     }
 }
Exemplo n.º 9
0
        private void MainCanvasMouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                NotArtist.SelectedTool.MouseMove(e.GetPosition(MainCanvas));
                if (NotArtist.SelectedTool == NotArtist.Tools[7])
                {
                    ScrollViewerCanvas.ScrollToVerticalOffset(NotArtist.DistanceToPointY);
                    ScrollViewerCanvas.ScrollToHorizontalOffset(NotArtist.DistanceToPointX);
                }

                Invalidate();
            }
        }
Exemplo n.º 10
0
 private void MainCanvasMouseUp(object sender, MouseButtonEventArgs e)
 {
     if (NotArtist.SelectedTool != NotArtist.Tools[6])
     {
         NotArtist.AddCondition();
     }
     NotArtist.SelectedTool.MouseUp(e.GetPosition(MainCanvas));
     if (NotArtist.SelectedTool == NotArtist.Tools[6])
     {
         MainCanvas.LayoutTransform = new ScaleTransform(NotArtist.ScaleRate, NotArtist.ScaleRate);
         ScrollViewerCanvas.ScrollToVerticalOffset(NotArtist.DistanceToPointY * NotArtist.ScaleRate);
         ScrollViewerCanvas.ScrollToHorizontalOffset(NotArtist.DistanceToPointX * NotArtist.ScaleRate);
     }
     Invalidate();
 }
Exemplo n.º 11
0
 public void MinusZoomMyCanvas(object sender, RoutedEventArgs e)
 {
     MyCanvas.LayoutTransform = new ScaleTransform(1, 1);
     ScrollViewerCanvas.ScrollToVerticalOffset(0);
     ScrollViewerCanvas.ScrollToHorizontalOffset(0);
 }