개정판 32e95118
최신 소스 취합 및 Convert내용 업데이트
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
102 | 102 |
SetAdornerMember(objectData as CommentUserInfo); |
103 | 103 |
this.Focus(); |
104 | 104 |
} |
105 |
public AdornerFinal(List<CommentUserInfo> objectData) : this() |
|
105 |
public AdornerFinal(List<CommentUserInfo> objectData) : this()
|
|
106 | 106 |
{ |
107 | 107 |
InitializeComponent(); |
108 | 108 |
foreach (var item in objectData) |
... | ... | |
203 | 203 |
break; |
204 | 204 |
case "TriControl": |
205 | 205 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Triangle, ThumbList = new List<Thumb>() }); |
206 |
break; |
|
206 |
break;
|
|
207 | 207 |
case "CircleControl": |
208 | 208 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Circle, ThumbList = new List<Thumb>() }); |
209 | 209 |
break; |
... | ... | |
253 | 253 |
DragThumb.RenderTransform = new RotateTransform() |
254 | 254 |
{ |
255 | 255 |
Angle = (member as TextControl).Angle, |
256 |
//CenterX = middle.X, |
|
257 |
//CenterY = middle.Y, |
|
258 | 256 |
}; |
259 | 257 |
|
260 | 258 |
AdornerBorder.RenderTransformOrigin = new Point(0.0, 0.0); |
261 | 259 |
AdornerBorder.RenderTransform = new RotateTransform() |
262 | 260 |
{ |
263 | 261 |
Angle = (member as TextControl).Angle, |
264 |
//CenterX = middle.X, |
|
265 |
//CenterY = middle.Y, |
|
266 | 262 |
}; |
267 | 263 |
Observable.FromEventPattern(((TextControl)member), "PropertyChanged").Subscribe(a => |
268 | 264 |
{ |
... | ... | |
279 | 275 |
this.ContainerContent.Children.Remove(member); |
280 | 276 |
this.Visibility = Visibility.Collapsed; |
281 | 277 |
} |
282 |
|
|
283 |
//((TextControl)member).UnEditingMode(); |
|
284 |
//((TextControl)member).Base_TextBlock.Visibility = Visibility.Collapsed; |
|
285 |
//((TextControl)member).Base_Border.Visibility = Visibility.Collapsed; |
|
286 |
//((TextControl)member).Base_TextPath.Visibility = Visibility.Collapsed; |
|
287 | 278 |
}); |
288 | 279 |
break; |
289 | 280 |
default: |
... | ... | |
366 | 357 |
case "RectCloudControl": |
367 | 358 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.RectCloud, ThumbList = new List<Thumb>() }); |
368 | 359 |
break; |
369 |
//강인구 추가 |
|
360 |
//강인구 추가
|
|
370 | 361 |
case "SignControl": |
371 | 362 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Sign, ThumbList = new List<Thumb>() }); |
372 | 363 |
break; |
... | ... | |
439 | 430 |
{ |
440 | 431 |
if ((MemberSet.First().DrawingData as TextControl).Angle != 0) |
441 | 432 |
{ |
433 |
///TODO: 원점 설정 |
|
442 | 434 |
trRotate.Angle = (MemberSet.First().DrawingData as TextControl).Angle; |
443 | 435 |
trRotateThumb.Angle = (MemberSet.First().DrawingData as TextControl).Angle; |
444 | 436 |
} |
... | ... | |
466 | 458 |
textControlWidth = ((currentControl as TextControl).Base_TextBox.ActualWidth); |
467 | 459 |
textControlHeight = ((currentControl as TextControl).Base_TextBox.ActualHeight); |
468 | 460 |
} |
469 |
|
|
470 | 461 |
//Border 사이즈 불필요 |
471 | 462 |
|
472 | 463 |
//if ((currentControl as TextControl).LineSize.Left == 0) |
... | ... | |
497 | 488 |
// textControlHeight += 8; |
498 | 489 |
// } |
499 | 490 |
//} |
500 |
|
|
501 | 491 |
if ((currentControl as TextControl).EndPoint.X < minX) |
502 | 492 |
{ |
503 | 493 |
minX = (currentControl as TextControl).EndPoint.X; |
... | ... | |
696 | 686 |
{ |
697 | 687 |
var temp = (MemberSet.First() as AdornerMember).DrawingData as ArrowTextControl; |
698 | 688 |
|
699 |
|
|
689 |
|
|
700 | 690 |
switch (Math.Abs(temp.Angle).ToString()) |
701 | 691 |
{ |
702 | 692 |
case "90": |
... | ... | |
1048 | 1038 |
|
1049 | 1039 |
DynamicThumbUpdate(control); |
1050 | 1040 |
BorderUpdate(); |
1051 |
|
|
1041 |
|
|
1052 | 1042 |
//if (control.DrawingData.GetType().Name == "ArrowTextControl") |
1053 | 1043 |
//{ |
1054 | 1044 |
// Thumb tm = control.ThumbList.Last(); |
... | ... | |
1093 | 1083 |
} |
1094 | 1084 |
break; |
1095 | 1085 |
#endregion |
1096 |
//강인구 추가
|
|
1086 |
//강인구 추가
|
|
1097 | 1087 |
#region Sign |
1098 | 1088 |
case ControlType.Sign: |
1099 | 1089 |
if (nearPoint.Equals(AllControl.PointSet[i])) |
... | ... | |
1320 | 1310 |
else |
1321 | 1311 |
IsTextAngle = false; |
1322 | 1312 |
|
1323 |
//System.Diagnostics.Debug.WriteLine("X축 : " + e.GetPosition(this).X + "LastRotateVerticalValue : " + LastRotateVerticalValue);
|
|
1313 |
System.Diagnostics.Debug.WriteLine("X축 : " + e.GetPosition(this).X + "LastRotateVerticalValue : " + LastRotateVerticalValue); |
|
1324 | 1314 |
LastRotateVerticalValue = e.GetPosition(this).X; |
1325 | 1315 |
} |
1326 | 1316 |
else |
1327 | 1317 |
{ |
1328 |
//System.Diagnostics.Debug.WriteLine("e.GetPosition(this).X : " + e.GetPosition(this).X);
|
|
1329 |
//System.Diagnostics.Debug.WriteLine("LastRotateHorizontalValue: " + LastRotateHorizontalValue);
|
|
1318 |
System.Diagnostics.Debug.WriteLine("e.GetPosition(this).X : " + e.GetPosition(this).X); |
|
1319 |
System.Diagnostics.Debug.WriteLine("LastRotateHorizontalValue: " + LastRotateHorizontalValue); |
|
1330 | 1320 |
|
1331 | 1321 |
if (e.GetPosition(this).X > LastRotateHorizontalValue) |
1332 | 1322 |
{ |
... | ... | |
1395 | 1385 |
(item.DrawingData as TextControl).StartPoint = |
1396 | 1386 |
new Point(Canvas.GetLeft((item.DrawingData as TextControl)) + e.HorizontalChange / 5, Canvas.GetTop((item.DrawingData as TextControl)) + e.VerticalChange / 5); |
1397 | 1387 |
(item.DrawingData as TextControl).EndPoint = (item.DrawingData as TextControl).StartPoint; |
1398 |
|
|
1399 |
(item.DrawingData as TextControl).CanvasX = (item.DrawingData as TextControl).StartPoint.X; |
|
1400 |
(item.DrawingData as TextControl).CanvasY = (item.DrawingData as TextControl).StartPoint.Y; |
|
1401 | 1388 |
} |
1402 | 1389 |
#endregion |
1403 | 1390 |
#region 날짜 |
... | ... | |
1422 | 1409 |
temp.DrawingCloud(); |
1423 | 1410 |
} |
1424 | 1411 |
#endregion |
1425 |
#region 심볼 |
|
1412 |
//#region 심볼
|
|
1426 | 1413 |
//if (item.Drawingtype == MarkupType.Viewbox) |
1427 | 1414 |
//{ |
1428 | 1415 |
// DynamicThumbUpdate(e, item); |
1429 | 1416 |
// BorderUpdate(); |
1430 | 1417 |
//} |
1431 |
#endregion |
|
1432 |
#region 폴리곤확장 |
|
1418 |
//#endregion
|
|
1419 |
//#region 폴리곤확장
|
|
1433 | 1420 |
//if (item.Drawingtype == MarkupType.PolygonEx) |
1434 | 1421 |
//{ |
1435 | 1422 |
// Point px = new Point(e.HorizontalChange, e.VerticalChange); |
... | ... | |
1462 | 1449 |
// //} |
1463 | 1450 |
// //(item.DrawingData as IPath).updateControl(); |
1464 | 1451 |
//} |
1465 |
#endregion |
|
1452 |
//#endregion
|
|
1466 | 1453 |
#region 폴리곤 |
1467 | 1454 |
if (item.Drawingtype == ControlType.PolygonControl) |
1468 | 1455 |
{ |
... | ... | |
2122 | 2109 |
// } |
2123 | 2110 |
//} |
2124 | 2111 |
} |
2112 |
|
|
2125 | 2113 |
/// <summary> |
2126 | 2114 |
/// 회전 |
2127 | 2115 |
/// </summary> |
... | ... | |
2129 | 2117 |
/// <param name="e"></param> |
2130 | 2118 |
public void rotate_DragDelta(object sender, DragDeltaEventArgs e) |
2131 | 2119 |
{ |
2132 |
|
|
2133 | 2120 |
MoveRotate(e); |
2134 | 2121 |
} |
2135 | 2122 |
|
... | ... | |
2202 | 2189 |
{ |
2203 | 2190 |
if (item.DrawingData.GetType().Name == "TextControl") |
2204 | 2191 |
{ |
2205 |
//if (AngleValue == 0) |
|
2206 |
//{ |
|
2207 |
// AngleValue = (item.DrawingData as TextControl).Angle; |
|
2208 |
//} |
|
2209 | 2192 |
//double X = Canvas.GetLeft((item.DrawingData as TextControl)); |
2210 | 2193 |
//double Y = Canvas.GetTop((item.DrawingData as TextControl)); |
2211 |
//AllPointSet.Add(new Point(X,Y)); |
|
2212 |
if (AngleValue == 0) |
|
2213 |
{ |
|
2214 |
AngleValue = (item.DrawingData as TextControl).Angle; |
|
2215 |
} |
|
2216 |
double X = Canvas.GetLeft((item.DrawingData as TextControl)); |
|
2217 |
double Y = Canvas.GetTop((item.DrawingData as TextControl)); |
|
2218 |
AllPointSet.Add(new Point(X, Y)); |
|
2194 |
//AllPointSet.Add(new Point(X, Y)); |
|
2195 |
AllPointSet.Add((item.DrawingData as TextControl).StartPoint); |
|
2219 | 2196 |
} |
2220 | 2197 |
else |
2221 | 2198 |
{ |
... | ... | |
2229 | 2206 |
CenterPoint = MathSet.FindCentroid(AllPointSet); |
2230 | 2207 |
Point pt = Mouse.GetPosition(this); |
2231 | 2208 |
|
2232 |
|
|
2233 |
|
|
2234 |
|
|
2235 |
//if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name != "TextControl") |
|
2236 |
//{ |
|
2237 | 2209 |
Point vec1 = new Point(this.rotatePoint.X - CenterPoint.X, this.rotatePoint.Y - CenterPoint.Y); |
2238 | 2210 |
Point vec2 = new Point(pt.X - CenterPoint.X, pt.Y - CenterPoint.Y); |
2239 | 2211 |
dDeltaAngle = (MathSet.getAngleBetweenVectors(vec1, vec2)); |
2240 | 2212 |
|
2241 |
System.Diagnostics.Debug.WriteLine("vec1 : " + vec1.X + "/" + vec1.Y); |
|
2242 |
System.Diagnostics.Debug.WriteLine("vec2 : " + vec2.X + "/" + vec2.Y); |
|
2243 |
System.Diagnostics.Debug.WriteLine("dDeltaAngle : " + dDeltaAngle); |
|
2244 |
|
|
2245 |
//} |
|
2246 |
//else |
|
2247 |
//{ |
|
2248 |
//if (IsTextAngle || RotateFlag) |
|
2249 |
//{ |
|
2250 |
// AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle + 5; |
|
2251 |
//} |
|
2252 |
//else |
|
2253 |
//{ |
|
2254 |
// AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle - 5; |
|
2255 |
//} |
|
2256 |
//} |
|
2257 |
|
|
2258 | 2213 |
AngleValue += dDeltaAngle; |
2259 | 2214 |
if (AngleValue > 360) AngleValue -= 360; |
2260 | 2215 |
if (AngleValue < 0) AngleValue += 360; |
... | ... | |
2273 | 2228 |
Canvas.SetLeft(thumb, value.X); |
2274 | 2229 |
Canvas.SetTop(thumb, value.Y); |
2275 | 2230 |
|
2276 |
/*if (item.DrawingData.GetType().Name == "ArrowTextControl" && thumb == item.ThumbList.Last()) |
|
2231 |
/* |
|
2232 |
if (item.DrawingData.GetType().Name == "ArrowTextControl" && thumb == item.ThumbList.Last()) |
|
2277 | 2233 |
{ |
2278 | 2234 |
Canvas.SetLeft(thumb, Canvas.GetLeft((item.DrawingData as ArrowTextControl).Base_TextBox)); |
2279 | 2235 |
Canvas.SetTop(thumb, Canvas.GetTop((item.DrawingData as ArrowTextControl).Base_TextBox)); |
... | ... | |
2336 | 2292 |
//Canvas.SetLeft((MemberSet.First() as AdornerMember).ThumbList[1], tempP.X); |
2337 | 2293 |
//Canvas.SetTop((MemberSet.First() as AdornerMember).ThumbList[1], tempP.Y); |
2338 | 2294 |
} |
2339 |
}*/ |
|
2295 |
} |
|
2296 |
*/ |
|
2340 | 2297 |
} |
2341 | 2298 |
|
2342 | 2299 |
for (int i = 0; i < (item.DrawingData as IPath).PointSet.Count(); i++) |
... | ... | |
2351 | 2308 |
{ |
2352 | 2309 |
case ControlType.TextControl: |
2353 | 2310 |
((TextControl)item.DrawingData).Angle = AngleValue; |
2354 |
//trRotate.Angle = AngleValue; |
|
2355 | 2311 |
|
2356 | 2312 |
RectangleGeometry Data = new RectangleGeometry |
2357 | 2313 |
{ |
... | ... | |
2377 | 2333 |
// CenterY = middle.Y + ((member as TextControl) as FrameworkElement).ActualHeight /2, |
2378 | 2334 |
//}; |
2379 | 2335 |
|
2380 |
|
|
2381 |
DragThumb.RenderTransformOrigin = new Point(0, 0); |
|
2336 |
DragThumb.RenderTransformOrigin = new Point(0.0, 0.0); |
|
2382 | 2337 |
DragThumb.RenderTransform = new RotateTransform() |
2383 | 2338 |
{ |
2384 | 2339 |
Angle = (item.DrawingData as TextControl).Angle, |
... | ... | |
2386 | 2341 |
//CenterY = middle.Y, |
2387 | 2342 |
}; |
2388 | 2343 |
|
2389 |
AdornerBorder.RenderTransformOrigin = new Point(0, 0);
|
|
2344 |
AdornerBorder.RenderTransformOrigin = new Point(0.0, 0.0);
|
|
2390 | 2345 |
AdornerBorder.RenderTransform = new RotateTransform() |
2391 | 2346 |
{ |
2392 | 2347 |
Angle = (item.DrawingData as TextControl).Angle, |
... | ... | |
2509 | 2464 |
BorderUpdate(); |
2510 | 2465 |
} |
2511 | 2466 |
|
2467 |
/// <summary> |
|
2468 |
/// starting rotate |
|
2469 |
/// </summary> |
|
2470 |
/// <param name="sender"></param> |
|
2471 |
/// <param name="e"></param> |
|
2512 | 2472 |
private void rotate_DragStarted(object sender, DragStartedEventArgs e) |
2513 | 2473 |
{ |
2514 |
////System.Windows.Forms.Cursor.Position = new System.Drawing.Point(System.Windows.Forms.Cursor.Position.X - 150, System.Windows.Forms.Cursor.Position.Y - 150); |
|
2515 |
//this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung |
|
2516 |
//rotateTop.Cursor = Cursors.SizeAll; |
|
2517 |
|
|
2518 |
////CustomCursor.SetCursorTemplate(rotateTop, this.Resources["AnimatedCursor"] as DataTemplate); |
|
2519 |
////rotateTop.Cursor = Cursors.None; |
|
2520 |
|
|
2521 |
////if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().PointSet != null) |
|
2522 |
////{ |
|
2523 |
//// return; |
|
2524 |
////} |
|
2525 |
|
|
2526 | 2474 |
this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung |
2527 | 2475 |
rotateTop.Cursor = Cursors.SizeAll; |
2528 | 2476 |
|
... | ... | |
2533 | 2481 |
} |
2534 | 2482 |
/// up to here |
2535 | 2483 |
|
2536 |
|
|
2537 |
|
|
2538 | 2484 |
if (ViewerDataModel.Instance.UndoDataList == null) |
2539 | 2485 |
{ |
2540 | 2486 |
return; |
... | ... | |
2613 | 2559 |
multi_Undo_Data.PointSet = new List<Point>(); |
2614 | 2560 |
p_set = new List<Point>(); |
2615 | 2561 |
|
2616 |
if (control.DrawingData as TextControl != null)
|
|
2562 |
if(control.DrawingData as TextControl != null) |
|
2617 | 2563 |
{ |
2618 | 2564 |
multi_Undo_Data.PointSet.Add((control.DrawingData as TextControl).StartPoint); |
2619 | 2565 |
multi_Undo_Data.PointSet.Add((control.DrawingData as TextControl).EndPoint); |
... | ... | |
2820 | 2766 |
Canvas.SetTop((MemberSet.First() as AdornerMember).ThumbList[1], tempP.Y); |
2821 | 2767 |
} |
2822 | 2768 |
|
2823 |
|
|
2769 |
|
|
2824 | 2770 |
BorderUpdate(); |
2825 |
|
|
2771 |
|
|
2826 | 2772 |
}; |
2827 | 2773 |
} |
2828 | 2774 |
else if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "DateControl") |
... | ... | |
2926 | 2872 |
if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "TextControl" || (MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "ArrowTextControl") |
2927 | 2873 |
{ |
2928 | 2874 |
DragThumb.Visibility = Visibility.Collapsed; |
2929 |
} |
|
2875 |
}
|
|
2930 | 2876 |
} |
2931 | 2877 |
|
2932 | 2878 |
//private void testText_Loaded(object sender, RoutedEventArgs e) |
내보내기 Unified diff