2468 |
2468 |
|
2469 |
2469 |
}
|
2470 |
2470 |
|
|
2471 |
/// <summary>
|
|
2472 |
/// select item which's bouding rectangle is equal to given rectangle
|
|
2473 |
/// </summary>
|
|
2474 |
/// <author>humkyung</author>
|
|
2475 |
/// <date>2018.06.14</date>
|
|
2476 |
/// <param name="rect"></param>
|
|
2477 |
public void SelecteItemByRect(Rect rect)
|
|
2478 |
{
|
|
2479 |
multi_Undo_Data = new Multi_Undo_data();
|
|
2480 |
|
|
2481 |
UndoData = new Undo_data()
|
|
2482 |
{
|
|
2483 |
IsUndo = false,
|
|
2484 |
Event = Event_Type.Select,
|
|
2485 |
EventTime = DateTime.Now,
|
|
2486 |
Markup_List = new List<Multi_Undo_data>()
|
|
2487 |
};
|
|
2488 |
|
|
2489 |
var Items = ViewerDataModel.Instance.MarkupControls_USER.ToList();
|
|
2490 |
|
|
2491 |
CommentUserInfo selected = null;
|
|
2492 |
double dMinDiff = double.MaxValue;
|
|
2493 |
Move tmp = new Move();
|
|
2494 |
foreach (var item in Items)
|
|
2495 |
{
|
|
2496 |
Rect boundingBox = tmp.ItemRect(item);
|
|
2497 |
double dx = rect.X - boundingBox.X;
|
|
2498 |
double dy = rect.Y - boundingBox.Y;
|
|
2499 |
double dxx = rect.Right - boundingBox.Right;
|
|
2500 |
double dyy = rect.Bottom - boundingBox.Bottom;
|
|
2501 |
double dDiff = Math.Sqrt(dx * dx + dy * dy + dxx * dxx + dyy * dyy);
|
|
2502 |
if (dDiff < dMinDiff)
|
|
2503 |
{
|
|
2504 |
dMinDiff = dDiff;
|
|
2505 |
selected = item;
|
|
2506 |
}
|
|
2507 |
}
|
|
2508 |
|
|
2509 |
if (selected != null)
|
|
2510 |
{
|
|
2511 |
this.ReleaseAdorner();
|
|
2512 |
|
|
2513 |
List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
|
|
2514 |
adornerSet.Add(selected);
|
|
2515 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(selected);
|
|
2516 |
|
|
2517 |
Control_Style(selected);
|
|
2518 |
UndoData.Markup_List.Add(multi_Undo_Data);
|
|
2519 |
multi_Undo_Data = new Multi_Undo_data();
|
|
2520 |
|
|
2521 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
|
|
2522 |
{
|
|
2523 |
ViewerDataModel.Instance.UndoDataList.Remove(i);
|
|
2524 |
});
|
|
2525 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData);
|
|
2526 |
|
|
2527 |
Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet);
|
|
2528 |
SelectLayer.Children.Add(final);
|
|
2529 |
}
|
|
2530 |
}
|
|
2531 |
|
2471 |
2532 |
private void ApplyDragSelectionRect()
|
2472 |
2533 |
{
|
2473 |
2534 |
multi_Undo_Data = new Multi_Undo_data();
|
... | ... | |
2601 |
2662 |
dragZoomBorder.Width = width;
|
2602 |
2663 |
dragZoomBorder.Height = height;
|
2603 |
2664 |
}
|
2604 |
|
|
2605 |
|
|
2606 |
2665 |
}
|
2607 |
2666 |
|
2608 |
2667 |
public bool IsSelectionControl(Rect dragRect, Rect controlRect, Geometry OverViewPathData, ControlType type)
|
... | ... | |
2977 |
3036 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData);
|
2978 |
3037 |
|
2979 |
3038 |
SelectLayer.Children.Add(final);
|
2980 |
|
|
2981 |
|
//Control_Init(control);
|
2982 |
|
|
2983 |
|
|
2984 |
|
|
2985 |
|
|
2986 |
|
|
2987 |
|
//강인구 폰트 변경 보류
|
2988 |
|
|
2989 |
|
//if ((currentControl as TextControl) != null)
|
2990 |
|
//{
|
2991 |
|
// if ((control as TextControl).TextStyle == FontStyles.Italic)
|
2992 |
|
// {
|
2993 |
|
// ViewerDataModel.Instance.checkTextStyle = true;
|
2994 |
|
// }
|
2995 |
|
// else
|
2996 |
|
// {
|
2997 |
|
// ViewerDataModel.Instance.checkTextStyle = false;
|
2998 |
|
// }
|
2999 |
|
|
3000 |
|
// if((currentControl as TextControl).TextStyle == FontStyles.Italic)
|
3001 |
|
// {
|
3002 |
|
|
3003 |
|
// }
|
3004 |
|
// if((currentControl as TextControl).TextWeight == FontWeights.Bold)
|
3005 |
|
// {
|
3006 |
|
|
3007 |
|
// }
|
3008 |
|
// if((currentControl as TextControl).UnderLine == TextDecorations.Underline)
|
3009 |
|
// {
|
3010 |
|
|
3011 |
|
// }
|
3012 |
|
//}
|
3013 |
|
//else if ((currentControl as ArrowTextControl) != null)
|
3014 |
|
//{
|
3015 |
|
// if (this.ParentOfType<MainWindow>().dzTopMenu.btnItalic.IsChecked == true)
|
3016 |
|
// {
|
3017 |
|
// (currentControl as ArrowTextControl).TextStyle = FontStyles.Italic;
|
3018 |
|
// }
|
3019 |
|
// if (this.ParentOfType<MainWindow>().dzTopMenu.btnBold.IsChecked == true)
|
3020 |
|
// {
|
3021 |
|
// (currentControl as ArrowTextControl).TextWeight = FontWeights.Bold;
|
3022 |
|
// }
|
3023 |
|
// if (this.ParentOfType<MainWindow>().dzTopMenu.btnUnderLine.IsChecked == true)
|
3024 |
|
// {
|
3025 |
|
// (currentControl as ArrowTextControl).UnderLine = TextDecorations.Underline;
|
3026 |
|
// }
|
3027 |
|
//}
|
3028 |
|
|
3029 |
|
//mouseHandlingMode = MouseHandlingMode.Adorner;
|
3030 |
3039 |
}
|
3031 |
3040 |
}
|
3032 |
3041 |
|
... | ... | |
4376 |
4385 |
}
|
4377 |
4386 |
|
4378 |
4387 |
}
|
4379 |
|
|
4380 |
|
//else if (mouseButtonDown == MouseButton.Left && mouseHandlingMode == MouseHandlingMode.Selecting)
|
4381 |
|
//{
|
4382 |
|
// if (controlType == ControlType.None)
|
4383 |
|
// {
|
4384 |
|
// mouseHandlingMode = MouseHandlingMode.Selecting;
|
4385 |
|
// this.cursor = Cursors.Arrow;
|
4386 |
|
// inkDrawingCanvas.IsEnabled = false;
|
4387 |
|
// isLeftMouseButtonDownOnWindow = true;
|
4388 |
|
// }
|
4389 |
|
//}
|
4390 |
|
|
4391 |
4388 |
if (mouseHandlingMode != MouseHandlingMode.None && mouseButtonDown == MouseButton.Left)
|
4392 |
4389 |
{
|
4393 |
4390 |
if (mouseHandlingMode == MouseHandlingMode.Adorner && SelectLayer.Children.Count > 0)
|
... | ... | |
5862 |
5859 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final);
|
5863 |
5860 |
}
|
5864 |
5861 |
}
|
5865 |
|
|
5866 |
5862 |
}
|
5867 |
5863 |
}
|