프로젝트

일반

사용자정보

개정판 e6a9ddaf

IDe6a9ddaff1d8d2d0c1caa78bf31241e824450f09
상위 3593d746
하위 5423f26d, 29cf2c0c

백흠경이(가) 5년 이상 전에 추가함

issue #923: fixed ControlType.ChainLine drawing

Change-Id: Iee05d32624f7260c51cf31dc4827fcee6085be55

차이점 보기:

KCOM/Controls/AdornerFinal.xaml.cs
1301 1301
                    #region 텍스트
1302 1302
                    if (item.Drawingtype == ControlType.TextControl)
1303 1303
                    {
1304
                        Point dx = MathSet.RotateAbout(new Point(0, 0), new Point(e.HorizontalChange, e.VerticalChange), trRotate.Angle);
1305
                        Canvas.SetLeft((item.DrawingData as TextControl), Canvas.GetLeft((item.DrawingData as TextControl)) + dx.X);
1306
                        Canvas.SetTop((item.DrawingData as TextControl), Canvas.GetTop((item.DrawingData as TextControl)) + dx.Y);
1307
                        (item.DrawingData as TextControl).StartPoint =
1308
                        new Point(Canvas.GetLeft((item.DrawingData as TextControl)) + e.HorizontalChange / 5, Canvas.GetTop((item.DrawingData as TextControl)) + e.VerticalChange / 5);
1309
                        (item.DrawingData as TextControl).EndPoint = (item.DrawingData as TextControl).StartPoint;
1310

  
1311
                        // Point endPointV = new Point(Data.Bounds.Right, Data.Bounds.Bottom);
1312
                        //Point middle = MathSet.getMiddlePoint((item.DrawingData as TextControl).StartPoint, (item.DrawingData as TextControl).EndPoint);
1313

  
1314
                        // TextControlChanger(); 
1304
                        (item.DrawingData as TextControl).Move(e.HorizontalChange, e.VerticalChange);
1315 1305
                    }
1316 1306
                    #endregion
1317 1307
                    #region 날짜
KCOM/Controls/Symbol.xaml.cs
575 575
                    // move.control_Select(item, dragRect);
576 576
                    ApplyDragSelectionRect();
577 577
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = MouseHandlingMode.DragSymbol;
578
                    this.ParentOfType<MainWindow>().dzMainMenu.mouseButtonDown = MouseButton.Left;
578
                    ///this.ParentOfType<MainWindow>().dzMainMenu.mouseButtonDown = MouseButton.Left;
579 579
                    this.ParentOfType<MainWindow>().dzMainMenu.symboldata(id, group_id, RadTab.SelectedIndex, Data_, img.Source);
580 580
                    
581 581
                }
KCOM/Views/MainMenu.xaml.cs
125 125
        public Undo_data UndoData { get; set; }
126 126
        public CommentUserInfo currentControl { get; set; }
127 127
        public ControlType controlType { get; set; }
128
        private Move move;
128
        private Move move = new Move();
129 129
        private double[] rotateValue = { 0, 90, 180, 270 };
130 130
        public MouseHandlingMode mouseHandlingMode = MouseHandlingMode.None;
131
        public MouseButton mouseButtonDown { get; set; }
132 131
        private static readonly double DragThreshold = 5;
133 132
        private System.Windows.Input.Cursor cursor { get; set; }
134 133
        private Point canvasDrawingMouseDownPoint;
......
1258 1257
            //}
1259 1258
            #endregion
1260 1259

  
1261
            if ((mouseButtonDown == MouseButton.Middle) || (mouseButtonDown == MouseButton.Right))
1260
            if ((e.MiddleButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed))
1262 1261
            {
1263 1262
                SetCursor();
1264 1263
                Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas);
......
1275 1274
                }
1276 1275
            }
1277 1276

  
1278
            if (mouseHandlingMode == MouseHandlingMode.Drawing && mouseButtonDown == MouseButton.Left)
1277
            if (mouseHandlingMode == MouseHandlingMode.Drawing && currentControl != null)
1279 1278
            {
1280 1279
                Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas);
1281 1280
                Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas);
......
1799 1798
                            }
1800 1799
                            break;
1801 1800

  
1802
                        case ControlType.ChainLine:
1803
                            {
1804
                                var control = currentControl as PolygonControl;
1805

  
1806
                                if (control != null)
1807
                                {
1808

  
1809
                                    control.PointSet.RemoveAt(control.PointSet.Count - 1);
1810
                                    control.PointSet.Add(currentCanvasDrawingMouseMovePoint);
1811

  
1812
                                    Point tempPoint = control.PointSet[control.PointSet.Count - 1];
1813

  
1814
                                    if (ViewerDataModel.Instance.checkAxis || ViewerDataModel.Instance.IsPressShift)
1815
                                    {
1816
                                        //var AngleValue = MathSet.returnAngleString(control.StartPoint, ref tempPoint, true);
1817
                                        ViewerDataModel.Instance.AngleValue = MathSet.returnAngleString(control.PointSet[control.PointSet.Count - 2], ref tempPoint, true);
1818
                                        control.PointSet[control.PointSet.Count - 1] = tempPoint;
1819
                                        //control.EndPoint = tempPoint;
1820
                                    }
1821
                                    else
1822
                                    {
1823
                                        ViewerDataModel.Instance.AngleValue = MathSet.returnAngleString(control.StartPoint, ref tempPoint, false);
1824
                                    }
1825

  
1826
                                    ///control.SetPolyPath();
1827

  
1828
                                    control.DashSize = ViewerDataModel.Instance.DashSize;
1829
                                }
1830
                            }
1831
                            break;
1832

  
1833 1801
                        case ControlType.ArcLine:
1834 1802
                            {
1835 1803
                                var control = currentControl as ArcControl;
......
2276 2244
                            }
2277 2245
                            break;
2278 2246
                        case ControlType.PolygonControl:
2247
                        case ControlType.ChainLine:
2279 2248
                            {
2280 2249
                                var control = currentControl as PolygonControl;
2281 2250

  
2282 2251
                                if (control != null)
2283 2252
                                {
2284 2253
                                    control.PointSet.RemoveAt(control.PointSet.Count - 1);
2254
                                    Point tempPoint = currentCanvasDrawingMouseMovePoint;
2255
                                    if (ViewerDataModel.Instance.checkAxis || ViewerDataModel.Instance.IsPressShift)
2256
                                    {
2257
                                        ViewerDataModel.Instance.AngleValue = MathSet.returnAngleString(control.PointSet[control.PointSet.Count - 1], ref tempPoint, true);
2258
                                    }
2285 2259
                                    control.PointSet.Add(currentCanvasDrawingMouseMovePoint);
2260

  
2286 2261
                                    control.Paint = ViewerDataModel.Instance.paintSet;
2287 2262
                                    control.DashSize = ViewerDataModel.Instance.DashSize;
2288 2263
                                    control.Paint = ViewerDataModel.Instance.paintSet;
......
2461 2436
                    }
2462 2437
                }
2463 2438
            }
2464
            else if (mouseButtonDown == MouseButton.Left && mouseHandlingMode == MouseHandlingMode.Selecting || mouseButtonDown == MouseButton.Left && mouseHandlingMode == MouseHandlingMode.Capture || mouseButtonDown == MouseButton.Left && mouseHandlingMode == MouseHandlingMode.DragZoom)
2439
            else if (((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.Selecting) || 
2440
                ((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.Capture) || 
2441
                ((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.DragZoom))
2465 2442
            {
2466 2443
                Point curMouseDownPoint = e.GetPosition(drawingRotateCanvas);
2467 2444

  
......
2536 2513
                    e.Handled = true;
2537 2514
                }
2538 2515
            }
2539
            else if (mouseButtonDown == MouseButton.Left && mouseHandlingMode == MouseHandlingMode.DragSymbol)
2516
            else if ((e.LeftButton == MouseButtonState.Pressed) && mouseHandlingMode == MouseHandlingMode.DragSymbol)
2540 2517
            { //symbol      
2541 2518
                if(_dragdropWindow != null)
2542 2519
                {
......
2547 2524
                    this._dragdropWindow.Top = w32Mouse.Y - (symbol_img.Height / 2);
2548 2525
                }                
2549 2526
            }
2550
            else if (mouseButtonDown == MouseButton.Left && ViewerDataModel.Instance.MarkupControls_USER.Count > 0)
2527
            else if ((e.LeftButton == MouseButtonState.Released) && (e.MiddleButton == MouseButtonState.Released) && 
2528
                (e.RightButton == MouseButtonState.Released) && ViewerDataModel.Instance.MarkupControls_USER.Count > 0)
2551 2529
            {
2552 2530
                var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseOver).FirstOrDefault();
2553
                if (control != null)
2531
                if(control != null)
2554 2532
                {
2555 2533
                    this.cursor = Cursors.Hand;
2556 2534
                    SetCursor();
......
2558 2536
                else
2559 2537
                {
2560 2538
                    this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
2561

  
2562 2539
                    SetCursor();
2563 2540
                }
2564 2541
            }
......
2605 2582

  
2606 2583
        private void zoomAndPanControl2_MouseMove(object sender, MouseEventArgs e)
2607 2584
        {
2608
            if ((mouseButtonDown == MouseButton.Middle) || (mouseButtonDown == MouseButton.Right))
2585
            if ((e.MiddleButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed))
2609 2586
            {
2610 2587
                SetCursor();
2611 2588
                Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas2);
......
2722 2699
                        }
2723 2700
                    }
2724 2701
                }
2725
                else if (mouseButtonDown == MouseButton.Right)
2702
                else if (e.RightButton == MouseButtonState.Pressed)
2726 2703
                {
2727 2704
                    this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
2728 2705
                    SetCursor();
......
2738 2715
                this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
2739 2716
                SetCursor();
2740 2717
            }
2741
            mouseButtonDown = MouseButton.Left;
2742 2718

  
2719
            ///mouseButtonDown = MouseButton.Left;
2743 2720
            //controlType = ControlType.SingleLine;
2744 2721
        }
2745 2722

  
......
2815 2792

  
2816 2793
        private void zoomAndPanControl2_MouseUp(object sender, MouseButtonEventArgs e)
2817 2794
        {
2818
            mouseButtonDown = MouseButton.Left;
2795
            ///mouseButtonDown = MouseButton.Left;
2819 2796
        }
2820 2797

  
2821 2798
        private void zoomAndPanControl_MouseLeave(object sender, MouseEventArgs e)
2822 2799
        {
2823
            mouseButtonDown = MouseButton.Left;
2800
            ///mouseButtonDown = MouseButton.Left;
2824 2801
            //this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
2825 2802
        }
2826 2803

  
......
2840 2817
            double y = Canvas.GetTop(dragSelectionBorder);
2841 2818
            double width = dragSelectionBorder.Width;
2842 2819
            double height = dragSelectionBorder.Height;
2843
            Rect dragRect = new Rect(x, y, width, height);
2844 2820
            Boolean Flag = false;
2845
            dragRect.Inflate(width / 10, height / 10);
2846 2821
            List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
2847 2822
            var Items = ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.Visibility != Visibility.Hidden).ToList();
2848 2823

  
2849
            dragRect = new Rect(x, y, width, height);
2850
            dragRect.Inflate(width / 10, height / 10);
2824
            Rect dragRect = new Rect(x, y, width, height);
2825
            ///dragRect.Inflate(width / 10, height / 10);
2851 2826

  
2852 2827
            foreach (var item in Items)
2853 2828
            {
......
3127 3102
                }
3128 3103
            }
3129 3104

  
3130
            mouseButtonDown = e.ChangedButton;
3105
            ///mouseButtonDown = e.ChangedButton;
3131 3106
            /// complete drawing text control when user click mouse right button - 2018.05.14 added by humkyung
3132 3107

  
3133 3108
            //if (currentControl != null)
......
3162 3137
                (e.OriginalSource as System.Windows.Controls.Image).Focus();
3163 3138
            }
3164 3139

  
3165
            if (mouseHandlingMode == MouseHandlingMode.DragSymbol && mouseButtonDown == MouseButton.Left)
3140
            if (mouseHandlingMode == MouseHandlingMode.DragSymbol && e.LeftButton == MouseButtonState.Pressed)
3166 3141
            {                
3167 3142
                //this.cursor = new Cursor(MainWindow.CursorChange().StreamSource);
3168 3143
                //SetCursor();
......
3175 3150
                }                
3176 3151
            }
3177 3152

  
3178
            if (mouseHandlingMode == MouseHandlingMode.DragSymbol && mouseButtonDown == MouseButton.Right)
3153
            if (mouseHandlingMode == MouseHandlingMode.DragSymbol && e.RightButton == MouseButtonState.Pressed)
3179 3154
            {
3180 3155
                if (this._dragdropWindow != null)
3181 3156
                {
......
3185 3160
                }
3186 3161
            }
3187 3162

  
3188
            if (mouseButtonDown == MouseButton.Left)
3163
            if (e.LeftButton == MouseButtonState.Pressed)
3189 3164
            {
3190 3165
                canvasDrawingMouseDownPoint = e.GetPosition(drawingRotateCanvas);
3191 3166
                canvasZoomPanningMouseDownPoint = e.GetPosition(zoomAndPanCanvas);
......
3198 3173
                    SelectionSet.Instance.UnSelect(this);
3199 3174
                }
3200 3175
            }
3201
            if (mouseButtonDown == MouseButton.Middle)
3176
            if (e.MiddleButton == MouseButtonState.Pressed)
3202 3177
            {
3203 3178
                canvasZoommovingMouseDownPoint = e.GetPosition(zoomAndPanCanvas);
3204 3179
                cursor = Cursors.SizeAll;
3205 3180
                SetCursor();
3206 3181
            }
3207
            if (mouseButtonDown == MouseButton.Right)
3182
            if (e.RightButton == MouseButtonState.Pressed)
3208 3183
            {
3209 3184
                canvasZoommovingMouseDownPoint = e.GetPosition(zoomAndPanCanvas);
3210 3185
                cursor = Cursors.SizeAll;
3211 3186
                SetCursor();
3212 3187
            }
3213
            else if (mouseButtonDown == MouseButton.XButton1)
3188
            else if (e.XButton1 == MouseButtonState.Pressed)
3214 3189
            {
3215 3190
                if (this.pageNavigator.CurrentPage.PageNumber + 1 <= this.pageNavigator.PageCount)
3216 3191
                {
......
3220 3195
                this.pageNavigator.GotoPage(this.pageNavigator._NextPage.PageNumber);
3221 3196

  
3222 3197
            }
3223
            else if (mouseButtonDown == MouseButton.XButton2)
3198
            else if (e.XButton2 == MouseButtonState.Pressed)
3224 3199
            {
3225 3200
                if (this.pageNavigator.CurrentPage.PageNumber > 1)
3226 3201
                {
......
3229 3204
            }
3230 3205

  
3231 3206
            //if (mouseButtonDown == MouseButton.Left && ViewerDataModel.Instance.MarkupControls_USER.Count > 0 && mouseHandlingMode != MouseHandlingMode.Drawing && currentControl == null)
3232
            if (mouseButtonDown == MouseButton.Left && mouseHandlingMode != MouseHandlingMode.Drawing && currentControl == null)
3207
            if (e.LeftButton == MouseButtonState.Pressed && mouseHandlingMode != MouseHandlingMode.Drawing && currentControl == null)
3233 3208
            {
3234 3209
                if (mouseHandlingMode == MouseHandlingMode.Selecting)
3235 3210
                {
......
3451 3426
                {
3452 3427
                    case ControlType.Coordinate:
3453 3428
                        {
3454
                            if (mouseButtonDown == MouseButton.Left)
3429
                            if (e.LeftButton == MouseButtonState.Pressed)
3455 3430
                            {
3456 3431
                                if (currentControl is CoordinateControl)
3457 3432
                                {
......
3499 3474
                        break;
3500 3475
                    case ControlType.InsideWhite:
3501 3476
                        {
3502
                            if (mouseButtonDown == MouseButton.Left)
3477
                            if (e.LeftButton == MouseButtonState.Pressed)
3503 3478
                            {
3504 3479
                                if (currentControl is InsideWhiteControl)
3505 3480
                                {
......
3534 3509
                        break;
3535 3510
                    case ControlType.OverlapWhite:
3536 3511
                        {
3537
                            if (mouseButtonDown == MouseButton.Left)
3512
                            if (e.LeftButton == MouseButtonState.Pressed)
3538 3513
                            {
3539 3514
                                if (currentControl is OverlapWhiteControl)
3540 3515
                                {
......
3569 3544
                        break;
3570 3545
                    case ControlType.ClipWhite:
3571 3546
                        {
3572
                            if (mouseButtonDown == MouseButton.Left)
3547
                            if (e.LeftButton == MouseButtonState.Pressed)
3573 3548
                            {
3574 3549
                                if (currentControl is ClipWhiteControl)
3575 3550
                                {
......
3604 3579
                        break;
3605 3580
                    case ControlType.Rectangle:
3606 3581
                        {
3607
                            if (mouseButtonDown == MouseButton.Left)
3582
                            if (e.LeftButton == MouseButtonState.Pressed)
3608 3583
                            {
3609 3584
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3610 3585
                                //{
......
3644 3619
                        break;
3645 3620
                    case ControlType.RectCloud:
3646 3621
                        {
3647
                            if (mouseButtonDown == MouseButton.Left)
3622
                            if (e.LeftButton == MouseButtonState.Pressed)
3648 3623
                            {
3649 3624
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3650 3625
                                //{
......
3681 3656
                        break;
3682 3657
                    case ControlType.Circle:
3683 3658
                        {
3684
                            if (mouseButtonDown == MouseButton.Left)
3659
                            if (e.LeftButton == MouseButtonState.Pressed)
3685 3660
                            {
3686 3661
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3687 3662
                                //{
......
3716 3691
                        break;
3717 3692
                    case ControlType.Triangle:
3718 3693
                        {
3719
                            if (mouseButtonDown == MouseButton.Left)
3694
                            if (e.LeftButton == MouseButtonState.Pressed)
3720 3695
                            {
3721 3696
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3722 3697
                                //{
......
3760 3735
                        break;
3761 3736
                    case ControlType.SingleLine:
3762 3737
                        {
3763
                            if (mouseButtonDown == MouseButton.Left)
3738
                            if (e.LeftButton == MouseButtonState.Pressed)
3764 3739
                            {
3765 3740
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3766 3741
                                //{
......
3797 3772
                        break;
3798 3773
                    case ControlType.CancelLine:
3799 3774
                        {
3800
                            if (mouseButtonDown == MouseButton.Left)
3775
                            if (e.LeftButton == MouseButtonState.Pressed)
3801 3776
                            {
3802 3777
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3803 3778
                                //{
......
3834 3809
                        break;
3835 3810
                    case ControlType.ArrowLine:
3836 3811
                        {
3837
                            if (mouseButtonDown == MouseButton.Left)
3812
                            if (e.LeftButton == MouseButtonState.Pressed)
3838 3813
                            {
3839 3814
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3840 3815
                                //{
......
3871 3846
                        break;
3872 3847
                    case ControlType.TwinLine:
3873 3848
                        {
3874
                            if (mouseButtonDown == MouseButton.Left)
3849
                            if (e.LeftButton == MouseButtonState.Pressed)
3875 3850
                            {
3876 3851
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3877 3852
                                //{
......
3907 3882
                        break;
3908 3883
                    case ControlType.DimLine:
3909 3884
                        {
3910
                            if (mouseButtonDown == MouseButton.Left)
3885
                            if (e.LeftButton == MouseButtonState.Pressed)
3911 3886
                            {
3912 3887
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
3913 3888
                                //{
......
3946 3921
                            {
3947 3922
                                var control = currentControl as PolygonControl;
3948 3923

  
3949
                                if (mouseButtonDown == MouseButton.Right)
3924
                                if (e.RightButton == MouseButtonState.Pressed)
3950 3925
                                {
3951 3926
                                    //20180906 LJY TEST IsRotationDrawingEnable
3952 3927
                                    if (IsGetoutpoint((currentControl as PolygonControl).PointSet.Where(data => IsRotationDrawingEnable(data) == true).FirstOrDefault()))
......
3970 3945
                            }
3971 3946
                            else
3972 3947
                            {
3973
                                if (mouseButtonDown == MouseButton.Left)
3948
                                if (e.LeftButton == MouseButtonState.Pressed)
3974 3949
                                {
3975 3950
                                    MainAngle.Visibility = Visibility.Visible;
3976 3951
                                    currentControl = new PolygonControl
......
4002 3977
                        break;
4003 3978
                    case ControlType.ArcLine:
4004 3979
                        {
4005
                            if (mouseButtonDown == MouseButton.Left)
3980
                            if (e.LeftButton == MouseButtonState.Pressed)
4006 3981
                            {
4007 3982
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4008 3983
                                //{
......
4034 4009
                                    }
4035 4010
                                //}
4036 4011
                            }
4037
                            else if (mouseButtonDown == MouseButton.Right)
4012
                            else if (e.RightButton == MouseButtonState.Pressed)
4038 4013
                            {
4039 4014
                                if (currentControl != null)
4040 4015
                                {
......
4047 4022
                        break;
4048 4023
                    case ControlType.ArcArrow:
4049 4024
                        {
4050
                            if (mouseButtonDown == MouseButton.Left)
4025
                            if (e.LeftButton == MouseButtonState.Pressed)
4051 4026
                            {
4052 4027
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4053 4028
                                //{
......
4079 4054
                                }
4080 4055
                                //}
4081 4056
                            }
4082
                            else if (mouseButtonDown == MouseButton.Right)
4057
                            else if (e.RightButton == MouseButtonState.Pressed)
4083 4058
                            {
4084 4059
                                if (currentControl != null)
4085 4060
                                {
......
4092 4067
                        break;
4093 4068
                    case ControlType.ArrowMultiLine:
4094 4069
                        {
4095
                            if (mouseButtonDown == MouseButton.Left)
4070
                            if (e.LeftButton == MouseButtonState.Pressed)
4096 4071
                            {
4097 4072
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4098 4073
                                //{
......
4148 4123
                            if (currentControl is CloudControl)
4149 4124
                            {
4150 4125
                                var control = currentControl as CloudControl;
4151
                                if (mouseButtonDown == MouseButton.Right)
4126
                                if (e.RightButton == MouseButtonState.Pressed)
4152 4127
                                {
4153 4128
                                    control.IsCompleted = true;
4154 4129
                                }
......
4179 4154
                            }
4180 4155
                            else
4181 4156
                            {
4182
                                if (mouseButtonDown == MouseButton.Left)
4157
                                if (e.LeftButton == MouseButtonState.Pressed)
4183 4158
                                {
4184 4159
                                    currentControl = new CloudControl
4185 4160
                                    {
......
4205 4180
                        break;
4206 4181
                    case ControlType.ImgControl:
4207 4182
                        {
4208
                            if (mouseButtonDown == MouseButton.Left)
4183
                            if (e.LeftButton == MouseButtonState.Pressed)
4209 4184
                            {
4210 4185
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4211 4186
                                //{
......
4276 4251
                        break;
4277 4252
                    case ControlType.Date:
4278 4253
                        {
4279
                            if (mouseButtonDown == MouseButton.Left)
4254
                            if (e.LeftButton == MouseButtonState.Pressed)
4280 4255
                            {
4281 4256
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4282 4257
                                //{
......
4324 4299
                        break;
4325 4300
                    case ControlType.TextControl:
4326 4301
                        {
4327
                            if (mouseButtonDown == MouseButton.Left)
4302
                            if (e.LeftButton == MouseButtonState.Pressed)
4328 4303
                            {
4329 4304
                                if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4330 4305
                                {
......
4355 4330
                        break;
4356 4331
                    case ControlType.TextBorder:
4357 4332
                        {
4358
                            if (mouseButtonDown == MouseButton.Left)
4333
                            if (e.LeftButton == MouseButtonState.Pressed)
4359 4334
                            {
4360 4335
                                if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4361 4336
                                {
......
4387 4362
                        break;
4388 4363
                    case ControlType.TextCloud:
4389 4364
                        {
4390
                            if (mouseButtonDown == MouseButton.Left)
4365
                            if (e.LeftButton == MouseButtonState.Pressed)
4391 4366
                            {
4392 4367
                                if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4393 4368
                                {
......
4419 4394
                        break;
4420 4395
                    case ControlType.ArrowTextControl:
4421 4396
                         {
4422
                            if (mouseButtonDown == MouseButton.Left)
4397
                            if (e.LeftButton == MouseButtonState.Pressed)
4423 4398
                            {
4424 4399
                                if (currentControl is ArrowTextControl)
4425 4400
                                {
......
4468 4443
                        break;
4469 4444
                    case ControlType.ArrowTransTextControl:
4470 4445
                        {
4471
                            if (mouseButtonDown == MouseButton.Left)
4446
                            if (e.LeftButton == MouseButtonState.Pressed)
4472 4447
                            {
4473 4448
                                if (currentControl is ArrowTextControl)
4474 4449
                                {
......
4512 4487
                        break;
4513 4488
                    case ControlType.ArrowTextBorderControl:
4514 4489
                         {
4515
                            if (mouseButtonDown == MouseButton.Left)
4490
                            if (e.LeftButton == MouseButtonState.Pressed)
4516 4491
                            {
4517 4492
                                if (currentControl is ArrowTextControl)
4518 4493
                                {
......
4561 4536
                        break;
4562 4537
                    case ControlType.ArrowTransTextBorderControl:
4563 4538
                        {
4564
                            if (mouseButtonDown == MouseButton.Left)
4539
                            if (e.LeftButton == MouseButtonState.Pressed)
4565 4540
                            {
4566 4541
                                if (currentControl is ArrowTextControl)
4567 4542
                                {
......
4617 4592
                        break;
4618 4593
                    case ControlType.ArrowTextCloudControl:
4619 4594
                        {
4620
                            if (mouseButtonDown == MouseButton.Left)
4595
                            if (e.LeftButton == MouseButtonState.Pressed)
4621 4596
                            {
4622 4597
                                if (currentControl is ArrowTextControl)
4623 4598
                                {
......
4664 4639
                        break;
4665 4640
                    case ControlType.ArrowTransTextCloudControl:
4666 4641
                        {
4667
                            if (mouseButtonDown == MouseButton.Left)
4642
                            if (e.LeftButton == MouseButtonState.Pressed)
4668 4643
                            {
4669 4644
                                if (currentControl is ArrowTextControl)
4670 4645
                                {
......
4719 4694
                            {
4720 4695
                                var control = currentControl as PolygonControl;
4721 4696

  
4722
                                if (mouseButtonDown == MouseButton.Right)
4697
                                if (e.RightButton == MouseButtonState.Pressed)
4723 4698
                                {
4724 4699
                                    control.IsCompleted = true;
4725 4700
                                }
......
4750 4725
                            }
4751 4726
                            else
4752 4727
                            {
4753
                                if (mouseButtonDown == MouseButton.Left)
4728
                                if (e.LeftButton == MouseButtonState.Pressed)
4754 4729
                                {
4755 4730
                                    currentControl = new PolygonControl
4756 4731
                                    {
......
4775 4750
                    //강인구 추가
4776 4751
                    case ControlType.Sign:
4777 4752
                        {
4778
                            if (mouseButtonDown == MouseButton.Left)
4753
                            if (e.LeftButton == MouseButtonState.Pressed)
4779 4754
                            {
4780 4755
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4781 4756
                                //{
......
4833 4808
                        break;
4834 4809
                    case ControlType.Mark:
4835 4810
                        {
4836
                            if (mouseButtonDown == MouseButton.Left)
4811
                            if (e.LeftButton == MouseButtonState.Pressed)
4837 4812
                            {
4838 4813
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4839 4814
                                //{
......
4877 4852
                        break;
4878 4853
                    case ControlType.Symbol:
4879 4854
                        {
4880
                            if (mouseButtonDown == MouseButton.Left)
4855
                            if (e.LeftButton == MouseButtonState.Pressed)
4881 4856
                            {
4882 4857
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4883 4858
                                //{
......
4916 4891
                        break;
4917 4892
                    case ControlType.Stamp:
4918 4893
                        {
4919
                            if (mouseButtonDown == MouseButton.Left)
4894
                            if (e.LeftButton == MouseButtonState.Pressed)
4920 4895
                            {
4921 4896
                                //if (IsDrawingEnable(canvasZoomPanningMouseDownPoint))
4922 4897
                                //{
......
4981 4956
                        break;
4982 4957
                }
4983 4958
            }
4984
            if (mouseHandlingMode != MouseHandlingMode.None && mouseButtonDown == MouseButton.Left)
4959
            if (mouseHandlingMode != MouseHandlingMode.None && e.LeftButton == MouseButtonState.Pressed)
4985 4960
            {
4986 4961
                if (mouseHandlingMode == MouseHandlingMode.Adorner && SelectLayer.Children.Count > 0)
4987 4962
                {
......
5011 4986

  
5012 4987
        private void zoomAndPanControl2_MouseDown(object sender, MouseButtonEventArgs e)
5013 4988
        {
5014
            mouseButtonDown = e.ChangedButton;
4989
            ///mouseButtonDown = e.ChangedButton;
5015 4990
            canvasZoommovingMouseDownPoint = e.GetPosition(zoomAndPanCanvas2);
5016 4991
        }
5017 4992

  
......
6500 6475
            e.Effects = DragDropEffects.None;
6501 6476
        }
6502 6477

  
6478
        /*
6503 6479
        private void zoomAndPanControl_Drop(object sender, DragEventArgs e)
6504 6480
        {
6505 6481
            try
......
6516 6492
                Logger.sendResLog("zoomAndPanControl_Drop", ex.ToString(), 0);
6517 6493
            }            
6518 6494
        }
6519

  
6520
        private void Move_Symbol(object sender, string dragData)
6521
        {
6522
            try
6523
            {
6524
                if (dragData.Contains("|DZ|"))
6525
                {
6526
                    List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
6527

  
6528
                    string[] delimiterChars = { "|DZ|" };
6529
                    string[] data = dragData.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
6530

  
6531
                    SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
6532

  
6533
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
6534

  
6535
                    //강인구 Undo/Redo 보류
6536
                    UndoData = new Undo_data()
6537
                    {
6538
                        IsUndo = false,
6539
                        Event = Event_Type.Create,
6540
                        EventTime = DateTime.Now,
6541
                        Markup_List = new List<Multi_Undo_data>()
6542
                    };
6543

  
6544
                    ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i =>
6545
                    {
6546
                        ViewerDataModel.Instance.UndoDataList.Remove(i);
6547
                    });
6548

  
6549
                    foreach (string parse in data)
6550
                    {
6551
                        if (parse != "")
6552
                        {
6553
                            System.Windows.Controls.Control item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
6554
                            (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid();
6555

  
6556
                            ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo);
6557
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo);
6558

  
6559
                            adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo);
6560

  
6561
                            multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo);
6562

  
6563
                            UndoData.Markup_List.Add(multi_Undo_Data);
6564
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
6565
                        }
6566
                    }
6567
                    Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet);
6568

  
6569
                    /// move symbol to current mouse point
6570
                    double realPointX = this.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2);
6571
                    double realPointY = this.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2);
6572
                    final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
6573

  
6574
                    if (final.MemberSet.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null)
6575
                    {
6576
                        final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy
6577
                    }
6578
                    /// up to here
6579

  
6580
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final);
6581
                }
6582
            }
6583
            catch (Exception ex)
6584
            {
6585
                Logger.sendResLog("Move_Symbol", ex.ToString(), 0);
6586
            }            
6587
        }        
6495
        */
6588 6496
    }
6589 6497
}
MarkupToPDF/Common/CommentUserInfo.cs
79 79
        public virtual ControlType ControlType { get; set; }
80 80

  
81 81
        /// <summary>
82
        /// translate commeny by given dx, dy
83
        /// </summary>
84
        /// <param name="dx"></param>
85
        /// <param name="dy"></param>
86
        public virtual void Move(double dx, double dy) { }
87

  
88
        /// <summary>
82 89
        /// subclass has to override this method
83 90
        /// </summary>
84 91
        /// <returns>serialized string</returns>
MarkupToPDF/Controls/Parsing/MarkupParse.cs
291 291
                        if (!string.IsNullOrEmpty(markupInfoID)) control.MarkupInfoID = markupInfoID;
292 292
                        baseLayer.Add(control);
293 293
                        control.ApplyTemplate();
294
                        control.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
294
                        ///control.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
295 295

  
296 296
                        if (control is ArrowTextControl)
297 297
                        {
MarkupToPDF/Controls/Text/TextControl.cs
1146 1146
        {
1147 1147
            get
1148 1148
            {
1149
                Point start = new Point();
1150
                start.X = this.CanvasX;
1151
                start.Y = this.CanvasY;
1149
                Point start = new Point(this.CanvasX, this.CanvasY);
1152 1150

  
1153 1151
                Point length = new Point();
1154 1152
                double angle = this.Angle * Math.PI / 180;
......
1161 1159
            }
1162 1160
        }
1163 1161

  
1164
    /// <summary>
1165
    /// Serialize this
1166
    /// </summary>
1167
    /// <param name="sUserId"></param>
1168
    /// <returns></returns>
1169
    public override string Serialize()
1162
        /// <summary>
1163
        /// translate TextControl by given dx, dy
1164
        /// </summary>
1165
        /// <param name="dx"></param>
1166
        /// <param name="dy"></param>
1167
        public override void Move(double dx, double dy)
1168
        {
1169
            Canvas.SetLeft(this, Canvas.GetLeft(this) + dx);
1170
            Canvas.SetTop(this, Canvas.GetTop(this) + dy);
1171
            this.StartPoint = new Point(this.StartPoint.X + dx, this.StartPoint.Y + dy);
1172
            this.EndPoint = new Point(this.EndPoint.X + dx, this.EndPoint.Y + dy);
1173
        }
1174

  
1175
        /// <summary>
1176
        /// Serialize this
1177
        /// </summary>
1178
        /// <param name="sUserId"></param>
1179
        /// <returns></returns>
1180
        public override string Serialize()
1170 1181
        {
1171 1182
            using (S_TextControl STemp = new S_TextControl())
1172 1183
            {

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)