개정판 e1b36bc0
Feature: Grouping 기능 추가(Ctrl+G : Group, Ctrl+Shift+G : Ungroup)
Change-Id: I99a3309acd55799ff7101522feaa035225b80e48
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
2429 | 2429 |
double y = Canvas.GetTop(dragSelectionBorder); |
2430 | 2430 |
double width = dragSelectionBorder.Width; |
2431 | 2431 |
double height = dragSelectionBorder.Height; |
2432 |
Boolean Flag = false; |
|
2433 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
|
2434 |
var Items = ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.Visibility != Visibility.Hidden).ToList(); |
|
2435 | ||
2436 | 2432 |
Rect dragRect = new Rect(x, y, width, height); |
2437 |
///dragRect.Inflate(width / 10, height / 10); |
|
2438 | ||
2439 |
foreach (var item in Items) |
|
2440 |
{ |
|
2441 |
Flag = SelectionSet.Instance.SelectControl(item, dragRect); |
|
2442 | ||
2443 |
if (Flag) |
|
2444 |
{ |
|
2445 |
adornerSet.Add(item); |
|
2446 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(item); |
|
2447 |
Control_Style(item); |
|
2448 |
} |
|
2449 |
} |
|
2450 |
if (adornerSet.Count > 0) |
|
2451 |
{ |
|
2452 |
Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
|
2453 |
SelectLayer.Children.Add(final); |
|
2454 |
} |
|
2433 |
SelectionSet.Instance.SelectItemByRect(dragRect, this); |
|
2455 | 2434 |
} |
2456 | 2435 | |
2457 | 2436 |
private void InitDragSelectionRect(Point pt1, Point pt2) |
... | ... | |
2619 | 2598 |
zoomAndPanControl2.RotationAngle = rotate.Angle; |
2620 | 2599 |
} |
2621 | 2600 | |
2622 |
public void PlaceImageSymbol(string id, long group_id, int SelectedIndex, Point canvasZoomPanningMouseDownPoint)
|
|
2601 |
public void PlaceImageSymbol(string id, string groupID, int SelectedIndex, Point canvasZoomPanningMouseDownPoint)
|
|
2623 | 2602 |
{ |
2624 | 2603 |
string Data_ = ""; |
2625 | 2604 | |
... | ... | |
2697 | 2676 |
ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
2698 | 2677 |
currentControl.CommentID = Commons.ShortGuid(); |
2699 | 2678 |
currentControl.SymbolID = id; |
2700 |
currentControl.GroupID = group_id;
|
|
2679 |
currentControl.GroupID = groupID;
|
|
2701 | 2680 |
currentControl.ApplyTemplate(); |
2702 | 2681 |
currentControl.SetImage(); |
2703 | 2682 | |
... | ... | |
2891 | 2870 |
ViewerDataModel.Instance.SetAngleVisible(Visibility.Visible); |
2892 | 2871 |
} |
2893 | 2872 | |
2894 |
AdornerFinal final = null; |
|
2895 | ||
2873 |
AdornerFinal selection = null; |
|
2896 | 2874 |
if (!ViewerDataModel.Instance.IsPressCtrl) |
2897 | 2875 |
{ |
2898 |
/// 기존 selection 해제 |
|
2899 |
SelectionSet.Instance.UnSelect(this); |
|
2900 | ||
2901 |
final = new AdornerFinal(control); |
|
2902 | ||
2903 |
this.Control_Style(control); |
|
2904 | ||
2905 |
if ((control as IPath) != null) |
|
2876 |
selection = SelectionSet.Instance.SelectItem(control, this); |
|
2877 |
if (selection.Members.Count == 1) |
|
2906 | 2878 |
{ |
2907 |
if ((control as IPath).LineSize != 0) |
|
2908 |
{ |
|
2909 |
ViewerDataModel.Instance.LineSize = (control as IPath).LineSize; |
|
2910 |
} |
|
2911 |
} |
|
2912 |
if ((control as IShapeControl) != null) |
|
2913 |
{ |
|
2914 |
if ((control as IShapeControl).Paint == PaintSet.Hatch) |
|
2915 |
{ |
|
2916 |
ViewerDataModel.Instance.checkHatchShape = true; |
|
2917 |
} |
|
2918 |
else if ((control as IShapeControl).Paint == PaintSet.Fill) |
|
2879 |
control = selection.Members[0].DrawingData as CommentUserInfo; |
|
2880 |
if ((control as IPath) != null) |
|
2919 | 2881 |
{ |
2920 |
ViewerDataModel.Instance.checkFillShape = true; |
|
2882 |
if ((control as IPath).LineSize != 0) |
|
2883 |
{ |
|
2884 |
ViewerDataModel.Instance.LineSize = (control as IPath).LineSize; |
|
2885 |
} |
|
2921 | 2886 |
} |
2922 |
else
|
|
2887 |
if ((control as IShapeControl) != null)
|
|
2923 | 2888 |
{ |
2924 |
ViewerDataModel.Instance.checkHatchShape = false; |
|
2925 |
ViewerDataModel.Instance.checkFillShape = false; |
|
2889 |
if ((control as IShapeControl).Paint == PaintSet.Hatch) |
|
2890 |
{ |
|
2891 |
ViewerDataModel.Instance.checkHatchShape = true; |
|
2892 |
} |
|
2893 |
else if ((control as IShapeControl).Paint == PaintSet.Fill) |
|
2894 |
{ |
|
2895 |
ViewerDataModel.Instance.checkFillShape = true; |
|
2896 |
} |
|
2897 |
else |
|
2898 |
{ |
|
2899 |
ViewerDataModel.Instance.checkHatchShape = false; |
|
2900 |
ViewerDataModel.Instance.checkFillShape = false; |
|
2901 |
} |
|
2902 |
ViewerDataModel.Instance.paintSet = (control as IShapeControl).Paint; |
|
2926 | 2903 |
} |
2927 |
ViewerDataModel.Instance.paintSet = (control as IShapeControl).Paint; |
|
2928 |
} |
|
2929 | ||
2930 |
ViewerDataModel.Instance.ControlOpacity = control.Opacity; |
|
2931 | 2904 | |
2932 |
if (control is TextControl TextCtrl) |
|
2933 |
{ |
|
2934 |
ViewerDataModel.Instance.SystemMain.dzTopMenu.SetFont(TextCtrl.TextFamily); |
|
2905 |
ViewerDataModel.Instance.ControlOpacity = control.Opacity; |
|
2935 | 2906 | |
2936 |
if (!(TextCtrl.EnableEditing)) |
|
2937 |
{ |
|
2938 |
TextCtrl.EnableEditing = true; |
|
2939 |
} |
|
2940 |
if (TextCtrl.TextStyle == FontStyles.Italic) |
|
2941 |
{ |
|
2942 |
ViewerDataModel.Instance.checkTextStyle = true; |
|
2943 |
} |
|
2944 |
else |
|
2945 |
{ |
|
2946 |
ViewerDataModel.Instance.checkTextStyle = false; |
|
2947 |
} |
|
2948 |
if (TextCtrl.TextWeight == FontWeights.Bold) |
|
2949 |
{ |
|
2950 |
ViewerDataModel.Instance.checkTextWeight = true; |
|
2951 |
} |
|
2952 |
else |
|
2907 |
if (control is TextControl TextCtrl) |
|
2953 | 2908 |
{ |
2954 |
ViewerDataModel.Instance.checkTextWeight = false; |
|
2955 |
} |
|
2956 |
if (TextCtrl.UnderLine == TextDecorations.Underline) |
|
2957 |
{ |
|
2958 |
ViewerDataModel.Instance.checkUnderLine = true; |
|
2959 |
} |
|
2960 |
else |
|
2961 |
{ |
|
2962 |
ViewerDataModel.Instance.checkUnderLine = false; |
|
2963 |
} |
|
2964 |
ViewerDataModel.Instance.TextSize = TextCtrl.TextSize; |
|
2965 |
ViewerDataModel.Instance.checkHighlight = TextCtrl.IsHighLight; |
|
2966 |
ViewerDataModel.Instance.ArcLength = TextCtrl.ArcLength; |
|
2967 |
} |
|
2968 |
else if (control is ArrowTextControl ArrowTextCtrl) |
|
2969 |
{ |
|
2970 |
ViewerDataModel.Instance.SystemMain.dzTopMenu.SetFont((control as ArrowTextControl).TextFamily); |
|
2909 |
ViewerDataModel.Instance.SystemMain.dzTopMenu.SetFont(TextCtrl.TextFamily); |
|
2971 | 2910 | |
2972 |
if (!((control as ArrowTextControl).EnableEditing)) |
|
2973 |
{ |
|
2974 |
ArrowTextCtrl.EnableEditing = true; |
|
2975 |
} |
|
2976 |
if ((control as ArrowTextControl).TextStyle == FontStyles.Italic) |
|
2977 |
{ |
|
2978 |
ViewerDataModel.Instance.checkTextStyle = true; |
|
2979 |
} |
|
2980 |
else |
|
2981 |
{ |
|
2982 |
ViewerDataModel.Instance.checkTextStyle = false; |
|
2983 |
} |
|
2984 |
if ((control as ArrowTextControl).TextWeight == FontWeights.Bold) |
|
2985 |
{ |
|
2986 |
ViewerDataModel.Instance.checkTextWeight = true; |
|
2911 |
if (!(TextCtrl.EnableEditing)) |
|
2912 |
{ |
|
2913 |
TextCtrl.EnableEditing = true; |
|
2914 |
} |
|
2915 |
if (TextCtrl.TextStyle == FontStyles.Italic) |
|
2916 |
{ |
|
2917 |
ViewerDataModel.Instance.checkTextStyle = true; |
|
2918 |
} |
|
2919 |
else |
|
2920 |
{ |
|
2921 |
ViewerDataModel.Instance.checkTextStyle = false; |
|
2922 |
} |
|
2923 |
if (TextCtrl.TextWeight == FontWeights.Bold) |
|
2924 |
{ |
|
2925 |
ViewerDataModel.Instance.checkTextWeight = true; |
|
2926 |
} |
|
2927 |
else |
|
2928 |
{ |
|
2929 |
ViewerDataModel.Instance.checkTextWeight = false; |
|
2930 |
} |
|
2931 |
if (TextCtrl.UnderLine == TextDecorations.Underline) |
|
2932 |
{ |
|
2933 |
ViewerDataModel.Instance.checkUnderLine = true; |
|
2934 |
} |
|
2935 |
else |
|
2936 |
{ |
|
2937 |
ViewerDataModel.Instance.checkUnderLine = false; |
|
2938 |
} |
|
2939 |
ViewerDataModel.Instance.TextSize = TextCtrl.TextSize; |
|
2940 |
ViewerDataModel.Instance.checkHighlight = TextCtrl.IsHighLight; |
|
2941 |
ViewerDataModel.Instance.ArcLength = TextCtrl.ArcLength; |
|
2987 | 2942 |
} |
2988 |
else |
|
2943 |
else if (control is ArrowTextControl ArrowTextCtrl)
|
|
2989 | 2944 |
{ |
2990 |
ViewerDataModel.Instance.checkTextWeight = false; |
|
2945 |
ViewerDataModel.Instance.SystemMain.dzTopMenu.SetFont((control as ArrowTextControl).TextFamily); |
|
2946 | ||
2947 |
if (!((control as ArrowTextControl).EnableEditing)) |
|
2948 |
{ |
|
2949 |
ArrowTextCtrl.EnableEditing = true; |
|
2950 |
} |
|
2951 |
if ((control as ArrowTextControl).TextStyle == FontStyles.Italic) |
|
2952 |
{ |
|
2953 |
ViewerDataModel.Instance.checkTextStyle = true; |
|
2954 |
} |
|
2955 |
else |
|
2956 |
{ |
|
2957 |
ViewerDataModel.Instance.checkTextStyle = false; |
|
2958 |
} |
|
2959 |
if ((control as ArrowTextControl).TextWeight == FontWeights.Bold) |
|
2960 |
{ |
|
2961 |
ViewerDataModel.Instance.checkTextWeight = true; |
|
2962 |
} |
|
2963 |
else |
|
2964 |
{ |
|
2965 |
ViewerDataModel.Instance.checkTextWeight = false; |
|
2966 |
} |
|
2967 |
if ((control as ArrowTextControl).UnderLine == TextDecorations.Underline) |
|
2968 |
{ |
|
2969 |
ViewerDataModel.Instance.checkUnderLine = true; |
|
2970 |
} |
|
2971 |
else |
|
2972 |
{ |
|
2973 |
ViewerDataModel.Instance.checkUnderLine = false; |
|
2974 |
} |
|
2975 |
ViewerDataModel.Instance.checkHighlight = ArrowTextCtrl.isHighLight; |
|
2976 |
ViewerDataModel.Instance.TextSize = ArrowTextCtrl.TextSize; |
|
2977 |
ViewerDataModel.Instance.ArcLength = ArrowTextCtrl.ArcLength; |
|
2991 | 2978 |
} |
2992 |
if ((control as ArrowTextControl).UnderLine == TextDecorations.Underline)
|
|
2979 |
else if (control is RectCloudControl RectCloudCtrl)
|
|
2993 | 2980 |
{ |
2994 |
ViewerDataModel.Instance.checkUnderLine = true;
|
|
2981 |
ViewerDataModel.Instance.ArcLength = RectCloudCtrl.ArcLength;
|
|
2995 | 2982 |
} |
2996 |
else |
|
2983 |
else if (control is CloudControl CloudCtrl)
|
|
2997 | 2984 |
{ |
2998 |
ViewerDataModel.Instance.checkUnderLine = false;
|
|
2985 |
ViewerDataModel.Instance.ArcLength = CloudCtrl.ArcLength;
|
|
2999 | 2986 |
} |
3000 |
ViewerDataModel.Instance.checkHighlight = ArrowTextCtrl.isHighLight; |
|
3001 |
ViewerDataModel.Instance.TextSize = ArrowTextCtrl.TextSize; |
|
3002 |
ViewerDataModel.Instance.ArcLength = ArrowTextCtrl.ArcLength; |
|
3003 |
} |
|
3004 |
else if (control is RectCloudControl RectCloudCtrl) |
|
3005 |
{ |
|
3006 |
ViewerDataModel.Instance.ArcLength = RectCloudCtrl.ArcLength; |
|
3007 |
} |
|
3008 |
else if (control is CloudControl CloudCtrl) |
|
3009 |
{ |
|
3010 |
ViewerDataModel.Instance.ArcLength = CloudCtrl.ArcLength; |
|
3011 | 2987 |
} |
3012 | 2988 |
} |
3013 | 2989 |
else |
3014 | 2990 |
{ |
3015 |
List<CommentUserInfo> comment = SelectionSet.Instance.SelectedItems; |
|
3016 |
SelectionSet.Instance.UnSelect(this); |
|
3017 |
comment.Add(control); |
|
3018 | ||
3019 |
Control_Style(control); |
|
3020 | ||
3021 |
final = new AdornerFinal(comment); |
|
2991 |
selection = SelectionSet.Instance.SelectItem(control, this, false); |
|
3022 | 2992 |
} |
3023 | 2993 | |
3024 |
if (final != null)
|
|
2994 |
if (selection != null)
|
|
3025 | 2995 |
{ |
3026 |
this.SelectLayer.Children.Add(final);
|
|
2996 |
this.SelectLayer.Children.Add(selection);
|
|
3027 | 2997 |
} |
3028 | 2998 |
} |
3029 | 2999 |
} |
내보내기 Unified diff