개정판 0d00f9c8
issue #923: implementing drag textcontrol
Change-Id: I17d1f4ec754ea13646260d1c331d574ad680d47d
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
37 | 37 |
/// </summary> |
38 | 38 |
/// <param name="e"></param> |
39 | 39 |
/// <param name="angle"></param> |
40 |
public void Translate(DragDeltaEventArgs e, double angle)
|
|
40 |
public void Translate(double dx, double dy, double angle)
|
|
41 | 41 |
{ |
42 | 42 |
double radian = angle * Math.PI / 180; |
43 | 43 |
double cos = Math.Cos(radian); |
44 | 44 |
double sin = Math.Sin(radian); |
45 | 45 |
|
46 |
double dx = e.HorizontalChange*cos -e.VerticalChange * sin;
|
|
47 |
double dy = e.HorizontalChange*sin +e.VerticalChange * cos;
|
|
48 |
Canvas.SetLeft(this, Canvas.GetLeft(this) + dx); |
|
49 |
Canvas.SetTop(this, Canvas.GetTop(this) + dy); |
|
46 |
double _dx = dx * cos - dy * sin;
|
|
47 |
double _dy = dx * sin + dy * cos;
|
|
48 |
Canvas.SetLeft(this, Canvas.GetLeft(this) + _dx);
|
|
49 |
Canvas.SetTop(this, Canvas.GetTop(this) + _dy);
|
|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
/// <summary> |
... | ... | |
102 | 102 |
|
103 | 103 |
public Point reSizePoint { get; set; } |
104 | 104 |
private Point rotatePoint { get; set; } /// 2018.05.09 added by humkyung |
105 |
private Point MouseDownPoint = new Point(); |
|
106 |
private Point CurrentMousePoint = new Point(); |
|
105 | 107 |
#endregion |
106 | 108 |
#region 생성자 |
107 | 109 |
private void RadDropDownButton_Loaded(object sender, RoutedEventArgs e) |
... | ... | |
865 | 867 |
{ |
866 | 868 |
tm.RenderTransformOrigin = new Point(0, 0); |
867 | 869 |
tm.RenderTransform = new RotateTransform { Angle = 90 }; |
868 |
|
|
869 | 870 |
} |
870 | 871 |
else |
871 | 872 |
{ |
... | ... | |
930 | 931 |
{ |
931 | 932 |
MyThumb thumb = sender as MyThumb; |
932 | 933 |
Point setPoint = new Point(Canvas.GetLeft(thumb), Canvas.GetTop(thumb)); |
933 |
thumb.Translate(e, this.AngleValue); |
|
934 |
thumb.Translate(e.HorizontalChange, e.VerticalChange, this.AngleValue);
|
|
934 | 935 |
|
935 | 936 |
AdornerMember control = (from userThumb in this.Members |
936 | 937 |
where userThumb.ThumbList.Contains(thumb) |
... | ... | |
1018 | 1019 |
|
1019 | 1020 |
private void DragThumb_DragDelta(object sender, DragDeltaEventArgs e) |
1020 | 1021 |
{ |
1021 |
DragThumb.Cursor = Cursors.SizeAll; |
|
1022 |
Thumb thumb = sender as Thumb; |
|
1023 |
MoveAdorner(e); |
|
1022 |
try |
|
1023 |
{ |
|
1024 |
double dx = this.MouseDownPoint.X + e.HorizontalChange - this.CurrentMousePoint.X; |
|
1025 |
double dy = this.MouseDownPoint.Y + e.VerticalChange - this.CurrentMousePoint.Y; |
|
1026 |
|
|
1027 |
DragThumb.Cursor = Cursors.SizeAll; |
|
1028 |
Thumb thumb = sender as Thumb; |
|
1029 |
this.TranslateItems(e.HorizontalChange, e.VerticalChange); |
|
1030 |
System.Diagnostics.Debug.WriteLine(String.Format("dx={0}, dy={1}", e.HorizontalChange - dx, e.VerticalChange - dy)); |
|
1031 |
} |
|
1032 |
finally |
|
1033 |
{ |
|
1034 |
/// update CurrentMousePoint |
|
1035 |
this.CurrentMousePoint.X = this.MouseDownPoint.X + e.HorizontalChange; |
|
1036 |
this.CurrentMousePoint.Y = this.MouseDownPoint.Y + e.VerticalChange; |
|
1037 |
} |
|
1024 | 1038 |
} |
1025 | 1039 |
|
1026 |
public void MoveAdorner(DragDeltaEventArgs e) |
|
1040 |
/// <summary> |
|
1041 |
/// translate all members |
|
1042 |
/// </summary> |
|
1043 |
/// <param name="e"></param> |
|
1044 |
public void TranslateItems(double dx, double dy) |
|
1027 | 1045 |
{ |
1028 |
Point dragDelta = new Point(e.HorizontalChange, e.VerticalChange); |
|
1029 |
|
|
1030 | 1046 |
Dispatcher.BeginInvoke((Action)(() => |
1031 | 1047 |
{ |
1032 | 1048 |
foreach (var item in this.Members) |
1033 | 1049 |
{ |
1034 |
#region 라인 & 아크 |
|
1035 |
if (item.Drawingtype == ControlType.SingleLine || item.Drawingtype == ControlType.ArcLine || item.Drawingtype == ControlType.ArrowMultiLine || item.Drawingtype == ControlType.ArcArrow) |
|
1036 |
{ |
|
1037 |
DynamicThumbUpdate(e, item); |
|
1038 |
} |
|
1039 |
#endregion |
|
1040 |
#region 지시선화살표 |
|
1041 |
if (item.Drawingtype == ControlType.ArrowTextControl) |
|
1042 |
{ |
|
1043 |
DynamicThumbUpdate(e, item); |
|
1044 |
} |
|
1045 |
#endregion |
|
1046 |
|
|
1047 |
#region 써클 |
|
1048 |
if (item.Drawingtype == ControlType.Circle || item.Drawingtype == ControlType.Sign || item.Drawingtype == ControlType.Symbol || item.Drawingtype == ControlType.Stamp) |
|
1049 |
{ |
|
1050 |
DynamicThumbUpdate(e, item); |
|
1051 |
} |
|
1052 |
#endregion |
|
1053 |
#region 쉐이프 |
|
1054 |
if (item.Drawingtype == ControlType.Rectangle || item.Drawingtype == ControlType.ImgControl || item.Drawingtype == ControlType.RectCloud || item.Drawingtype == ControlType.Triangle) |
|
1055 |
{ |
|
1056 |
DynamicThumbUpdate(e, item); |
|
1057 |
} |
|
1058 |
#endregion |
|
1059 |
#region 텍스트 |
|
1060 |
if (item.Drawingtype == ControlType.TextControl) |
|
1061 |
{ |
|
1062 |
//DynamicThumbUpdate(e, item); |
|
1063 |
(item.DrawingData as TextControl).Move(e.HorizontalChange, e.VerticalChange); |
|
1064 |
} |
|
1065 |
#endregion |
|
1066 |
#region 날짜 |
|
1067 |
if (item.Drawingtype == ControlType.Date) |
|
1068 |
{ |
|
1069 |
DynamicThumbUpdate(e, item); |
|
1070 |
} |
|
1071 |
#endregion |
|
1072 |
#region 클라우드 |
|
1073 |
if (item.Drawingtype == ControlType.PolygonCloud) |
|
1074 |
{ |
|
1075 |
ICloudControl temp = ((ICloudControl)item.DrawingData); |
|
1076 |
DynamicThumbUpdate(e, item); |
|
1077 |
temp.DrawingCloud(); |
|
1078 |
} |
|
1079 |
#endregion |
|
1080 |
#region 심볼 |
|
1081 |
|
|
1082 |
#endregion |
|
1083 |
|
|
1084 |
#region 폴리곤 |
|
1085 |
if (item.Drawingtype == ControlType.PolygonControl) |
|
1086 |
{ |
|
1087 |
DynamicThumbUpdate(e, item); |
|
1088 |
BorderUpdate(); |
|
1089 |
} |
|
1090 |
#endregion |
|
1091 |
#region 잉크 |
|
1092 |
if (item.Drawingtype == ControlType.Ink) |
|
1093 |
{ |
|
1094 |
Point px = new Point(e.HorizontalChange, e.VerticalChange); |
|
1095 |
List<StylusPointSet> StylusPointSet = (item.DrawingData as InkControl).PointC; |
|
1096 |
for (int i = 0; i < StylusPointSet.Count; i++) |
|
1097 |
{ |
|
1098 |
List<Point> lstPoint = StylusPointSet[i].pointSet; |
|
1099 |
for (int j = 0; j < lstPoint.Count; j++) |
|
1100 |
{ |
|
1101 |
lstPoint[j] = new Point(lstPoint[j].X + px.X, lstPoint[j].Y + px.Y); |
|
1102 |
} |
|
1103 |
} |
|
1104 |
|
|
1105 |
for (int i = 0; i < item.ThumbList.Count; i++) |
|
1106 |
{ |
|
1107 |
Canvas.SetLeft(item.ThumbList[i], Canvas.GetLeft(item.ThumbList[i]) + px.X); |
|
1108 |
Canvas.SetTop(item.ThumbList[i], Canvas.GetTop(item.ThumbList[i]) + px.Y); |
|
1109 |
} |
|
1110 |
(item.DrawingData as IPath).updateControl(); |
|
1111 |
BorderUpdate(); |
|
1112 |
|
|
1113 |
} |
|
1114 |
#endregion |
|
1115 |
BorderUpdate(); |
|
1050 |
this.TranslateItem(dx, dy, item); |
|
1116 | 1051 |
} |
1117 | 1052 |
})); |
1053 |
///this.BorderUpdate(); |
|
1118 | 1054 |
} |
1119 | 1055 |
|
1120 |
public void DynamicThumbUpdate(DragDeltaEventArgs e, AdornerMember item) |
|
1056 |
/// <summary> |
|
1057 |
/// translate a item |
|
1058 |
/// </summary> |
|
1059 |
/// <param name="e"></param> |
|
1060 |
/// <param name="item"></param> |
|
1061 |
private void TranslateItem(double dx, double dy, AdornerMember item) |
|
1121 | 1062 |
{ |
1122 |
var AllControl = item.DrawingData as IPath; |
|
1123 |
List<Point> point = AllControl.PointSet; |
|
1063 |
///dx = this.CurrentMousePoint.X - this.MouseDownPoint.X + dx; |
|
1064 |
///dy = this.CurrentMousePoint.Y - this.MouseDownPoint.Y + dy; |
|
1065 |
|
|
1066 |
Point delta = MathSet.RotateAbout(new Point(0, 0), new Point(dx, dy), this.trRotate.Angle); |
|
1067 |
(item.DrawingData as CommentUserInfo).OnTranslate(delta.X, delta.Y); |
|
1124 | 1068 |
for (int i = 0; i < item.ThumbList.Count(); i++) |
1125 | 1069 |
{ |
1126 |
if (item.DrawingData.GetType().Name == "ArrowTextControl") |
|
1127 |
{ |
|
1128 |
Point dx = MathSet.RotateAbout(new Point(0, 0), new Point(e.HorizontalChange, e.VerticalChange), trRotate.Angle); |
|
1129 |
AllControl.PointSet[i] = new Point { X = point[i].X + dx.X, Y = point[i].Y + dx.Y }; |
|
1130 |
AllControl.updateControl(); |
|
1131 |
Canvas.SetLeft(item.ThumbList[i], Canvas.GetLeft(item.ThumbList[i]) + dx.X); |
|
1132 |
Canvas.SetTop(item.ThumbList[i], Canvas.GetTop(item.ThumbList[i]) + dx.Y); |
|
1133 |
|
|
1134 |
Canvas.SetLeft(item.ThumbList.Last(), Canvas.GetLeft((item.DrawingData as ArrowTextControl).Base_TextBox)); |
|
1135 |
Canvas.SetTop(item.ThumbList.Last(), Canvas.GetTop((item.DrawingData as ArrowTextControl).Base_TextBox)); |
|
1136 |
} |
|
1137 |
else |
|
1138 |
{ |
|
1139 |
Point dx = MathSet.RotateAbout(new Point(0, 0), new Point(e.HorizontalChange, e.VerticalChange), trRotate.Angle); |
|
1140 |
AllControl.PointSet[i] = new Point { X = point[i].X + dx.X, Y = point[i].Y + dx.Y }; |
|
1141 |
AllControl.updateControl(); |
|
1142 |
Canvas.SetLeft(item.ThumbList[i], Canvas.GetLeft(item.ThumbList[i]) + dx.X); |
|
1143 |
Canvas.SetTop(item.ThumbList[i], Canvas.GetTop(item.ThumbList[i]) + dx.Y); |
|
1144 |
} |
|
1070 |
(item.ThumbList[i] as MyThumb).Translate(dx, dy , this.trRotate.Angle); |
|
1145 | 1071 |
} |
1146 | 1072 |
} |
1147 | 1073 |
|
... | ... | |
1152 | 1078 |
|
1153 | 1079 |
for (int i = 0; i < AllControl.PointSet.Count(); i++) |
1154 | 1080 |
{ |
1155 |
|
|
1156 | 1081 |
Canvas.SetLeft(item.ThumbList[i], AllControl.PointSet[i].X); |
1157 | 1082 |
Canvas.SetTop(item.ThumbList[i], AllControl.PointSet[i].Y); |
1158 | 1083 |
} |
... | ... | |
1365 | 1290 |
|
1366 | 1291 |
case ControlType.Date: |
1367 | 1292 |
((DateControl)item.DrawingData).Angle = AngleValue; |
1368 |
(item.DrawingData as IPath).updateControl();
|
|
1293 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1369 | 1294 |
BorderUpdate(); |
1370 | 1295 |
break; |
1371 | 1296 |
case ControlType.ArrowMultiLine: |
... | ... | |
1373 | 1298 |
case ControlType.ArcArrow: |
1374 | 1299 |
case ControlType.SingleLine: |
1375 | 1300 |
case ControlType.Triangle: |
1376 |
(item.DrawingData as IPath).updateControl();
|
|
1301 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1377 | 1302 |
BorderUpdate(); |
1378 | 1303 |
break; |
1379 | 1304 |
case ControlType.ArrowTextControl: |
1380 |
(item.DrawingData as IPath).updateControl();
|
|
1305 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1381 | 1306 |
BorderUpdate(); |
1382 | 1307 |
break; |
1383 | 1308 |
case ControlType.RectCloud: |
1384 | 1309 |
((RectCloudControl)item.DrawingData).Angle = AngleValue; |
1385 |
(item.DrawingData as IPath).updateControl();
|
|
1310 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1386 | 1311 |
BorderUpdate(); |
1387 | 1312 |
break; |
1388 | 1313 |
case ControlType.Rectangle: |
1389 | 1314 |
((RectangleControl)item.DrawingData).Angle = AngleValue; |
1390 |
(item.DrawingData as IPath).updateControl();
|
|
1315 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1391 | 1316 |
BorderUpdate(); |
1392 | 1317 |
break; |
1393 | 1318 |
case ControlType.ImgControl: |
1394 | 1319 |
((ImgControl)item.DrawingData).Angle = AngleValue; |
1395 |
(item.DrawingData as IPath).updateControl();
|
|
1320 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1396 | 1321 |
BorderUpdate(); |
1397 | 1322 |
break; |
1398 | 1323 |
case ControlType.Sign: |
1399 | 1324 |
((SignControl)item.DrawingData).Angle = AngleValue; |
1400 |
(item.DrawingData as IPath).updateControl();
|
|
1325 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1401 | 1326 |
BorderUpdate(); |
1402 | 1327 |
break; |
1403 | 1328 |
case ControlType.Symbol: |
1404 | 1329 |
((SymControl)item.DrawingData).Angle = AngleValue; |
1405 |
(item.DrawingData as IPath).updateControl();
|
|
1330 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1406 | 1331 |
BorderUpdate(); |
1407 | 1332 |
break; |
1408 | 1333 |
case ControlType.Stamp: |
1409 | 1334 |
((SymControlN)item.DrawingData).Angle = AngleValue; |
1410 |
(item.DrawingData as IPath).updateControl();
|
|
1335 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1411 | 1336 |
BorderUpdate(); |
1412 | 1337 |
break; |
1413 | 1338 |
case ControlType.PolygonControl: |
1414 |
(item.DrawingData as IPath).updateControl();
|
|
1339 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1415 | 1340 |
BorderUpdate(); |
1416 | 1341 |
break; |
1417 | 1342 |
case ControlType.PolygonCloud: |
1418 | 1343 |
((ICloudControl)item.DrawingData).DrawingCloud(); |
1419 |
(item.DrawingData as IPath).updateControl();
|
|
1344 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1420 | 1345 |
BorderUpdate(); |
1421 | 1346 |
break; |
1422 | 1347 |
case ControlType.Circle: |
1423 | 1348 |
((IShapeControl)item.DrawingData).Angle = AngleValue; |
1424 |
(item.DrawingData as IPath).updateControl();
|
|
1349 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1425 | 1350 |
((CircleControl)item.DrawingData).SetCenterXY(); |
1426 | 1351 |
BorderUpdate(); |
1427 | 1352 |
break; |
1428 | 1353 |
case ControlType.Ink: |
1429 |
(item.DrawingData as IPath).updateControl();
|
|
1354 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1430 | 1355 |
BorderUpdate(); |
1431 | 1356 |
break; |
1432 | 1357 |
case ControlType.InsideWhite: |
1433 | 1358 |
((InsideWhiteControl)item.DrawingData).Angle = AngleValue; |
1434 |
(item.DrawingData as IPath).updateControl();
|
|
1359 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1435 | 1360 |
BorderUpdate(); |
1436 | 1361 |
break; |
1437 | 1362 |
case ControlType.OverlapWhite: |
1438 | 1363 |
((OverlapWhiteControl)item.DrawingData).Angle = AngleValue; |
1439 |
(item.DrawingData as IPath).updateControl();
|
|
1364 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1440 | 1365 |
BorderUpdate(); |
1441 | 1366 |
break; |
1442 | 1367 |
case ControlType.ClipWhite: |
1443 | 1368 |
((ClipWhiteControl)item.DrawingData).Angle = AngleValue; |
1444 |
(item.DrawingData as IPath).updateControl();
|
|
1369 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1445 | 1370 |
BorderUpdate(); |
1446 | 1371 |
break; |
1447 | 1372 |
case ControlType.Coordinate: |
1448 | 1373 |
((CoordinateControl)item.DrawingData).Angle = AngleValue; |
1449 |
(item.DrawingData as IPath).updateControl();
|
|
1374 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1450 | 1375 |
BorderUpdate(); |
1451 | 1376 |
break; |
1452 | 1377 |
default: |
... | ... | |
1461 | 1386 |
{ |
1462 | 1387 |
reSizePoint = e.GetPosition(this); |
1463 | 1388 |
} |
1389 |
|
|
1464 | 1390 |
/// <summary> |
1465 | 1391 |
/// 회전 |
1466 | 1392 |
/// </summary> |
... | ... | |
1468 | 1394 |
/// <param name="e"></param> |
1469 | 1395 |
public void rotate_DragDelta(object sender, DragDeltaEventArgs e) |
1470 | 1396 |
{ |
1471 |
|
|
1472 | 1397 |
MoveRotate(e); |
1473 | 1398 |
} |
1474 | 1399 |
|
... | ... | |
1594 | 1519 |
|
1595 | 1520 |
case ControlType.Date: |
1596 | 1521 |
((DateControl)item.DrawingData).Angle = AngleValue; |
1597 |
(item.DrawingData as IPath).updateControl();
|
|
1522 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1598 | 1523 |
BorderUpdate(); |
1599 | 1524 |
break; |
1600 | 1525 |
case ControlType.ArrowMultiLine: |
... | ... | |
1602 | 1527 |
case ControlType.ArcArrow: |
1603 | 1528 |
case ControlType.SingleLine: |
1604 | 1529 |
case ControlType.Triangle: |
1605 |
(item.DrawingData as IPath).updateControl();
|
|
1530 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1606 | 1531 |
BorderUpdate(); |
1607 | 1532 |
break; |
1608 | 1533 |
case ControlType.ArrowTextControl: |
1609 |
(item.DrawingData as IPath).updateControl();
|
|
1534 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1610 | 1535 |
BorderUpdate(); |
1611 | 1536 |
break; |
1612 | 1537 |
case ControlType.RectCloud: |
1613 | 1538 |
((RectCloudControl)item.DrawingData).Angle = AngleValue; |
1614 |
(item.DrawingData as IPath).updateControl();
|
|
1539 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1615 | 1540 |
BorderUpdate(); |
1616 | 1541 |
break; |
1617 | 1542 |
case ControlType.Rectangle: |
1618 | 1543 |
((RectangleControl)item.DrawingData).Angle = AngleValue; |
1619 |
(item.DrawingData as IPath).updateControl();
|
|
1544 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1620 | 1545 |
BorderUpdate(); |
1621 | 1546 |
break; |
1622 | 1547 |
case ControlType.ImgControl: |
1623 | 1548 |
((ImgControl)item.DrawingData).Angle = AngleValue; |
1624 |
(item.DrawingData as IPath).updateControl();
|
|
1549 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1625 | 1550 |
BorderUpdate(); |
1626 | 1551 |
break; |
1627 | 1552 |
case ControlType.Sign: |
1628 | 1553 |
((SignControl)item.DrawingData).Angle = AngleValue; |
1629 |
(item.DrawingData as IPath).updateControl();
|
|
1554 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1630 | 1555 |
BorderUpdate(); |
1631 | 1556 |
break; |
1632 | 1557 |
case ControlType.Symbol: |
1633 | 1558 |
((SymControl)item.DrawingData).Angle = AngleValue; |
1634 |
(item.DrawingData as IPath).updateControl();
|
|
1559 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1635 | 1560 |
BorderUpdate(); |
1636 | 1561 |
break; |
1637 | 1562 |
case ControlType.Stamp: |
1638 | 1563 |
((SymControlN)item.DrawingData).Angle = AngleValue; |
1639 |
(item.DrawingData as IPath).updateControl();
|
|
1564 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1640 | 1565 |
BorderUpdate(); |
1641 | 1566 |
break; |
1642 | 1567 |
case ControlType.PolygonControl: |
1643 |
(item.DrawingData as IPath).updateControl();
|
|
1568 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1644 | 1569 |
BorderUpdate(); |
1645 | 1570 |
break; |
1646 | 1571 |
case ControlType.PolygonCloud: |
1647 | 1572 |
((ICloudControl)item.DrawingData).DrawingCloud(); |
1648 |
(item.DrawingData as IPath).updateControl();
|
|
1573 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1649 | 1574 |
BorderUpdate(); |
1650 | 1575 |
break; |
1651 | 1576 |
case ControlType.Circle: |
1652 | 1577 |
((IShapeControl)item.DrawingData).Angle = AngleValue; |
1653 |
(item.DrawingData as IPath).updateControl();
|
|
1578 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1654 | 1579 |
((CircleControl)item.DrawingData).SetCenterXY(); |
1655 | 1580 |
BorderUpdate(); |
1656 | 1581 |
break; |
... | ... | |
1662 | 1587 |
(item.DrawingData as InkControl).PointC[i].pointSet[j] = MathSet.RotateAbout(CenterPoint, (item.DrawingData as InkControl).PointC[i].pointSet[j], dDeltaAngle); |
1663 | 1588 |
} |
1664 | 1589 |
} |
1665 |
(item.DrawingData as IPath).updateControl();
|
|
1590 |
(item.DrawingData as CommentUserInfo).UpdateControl();
|
|
1666 | 1591 |
BorderUpdate(); |
1667 | 1592 |
break; |
1668 | 1593 |
|
... | ... | |
1727 | 1652 |
|
1728 | 1653 |
private void drag_DragStarted(object sender, DragStartedEventArgs e) |
1729 | 1654 |
{ |
1655 |
/// save mouse down and current mouse point |
|
1656 |
this.MouseDownPoint.X = e.HorizontalOffset; |
|
1657 |
this.MouseDownPoint.Y = e.VerticalOffset; |
|
1658 |
this.CurrentMousePoint.X = e.HorizontalOffset; |
|
1659 |
this.CurrentMousePoint.Y = e.VerticalOffset; |
|
1660 |
/// up to here |
|
1661 |
|
|
1730 | 1662 |
if (ViewerDataModel.Instance.UndoDataList == null) |
1731 | 1663 |
{ |
1732 | 1664 |
return; |
KCOM/Controls/Symbol.xaml.cs | ||
---|---|---|
570 | 570 |
// final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY)); |
571 | 571 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
572 | 572 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
573 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
|
|
573 |
final.TranslateItems(realPointX, realPointY);
|
|
574 | 574 |
// move.control_Select(item, dragRect); |
575 | 575 |
ApplyDragSelectionRect(); |
576 | 576 |
this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = MouseHandlingMode.DragSymbol; |
KCOM/Events/Event_KeyEvent.cs | ||
---|---|---|
340 | 340 |
} |
341 | 341 |
else |
342 | 342 |
{ |
343 |
(item as Controls.AdornerFinal).MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(control.X, control.Y));
|
|
343 |
(item as Controls.AdornerFinal).TranslateItems(control.X, control.Y);
|
|
344 | 344 |
} |
345 | 345 |
|
346 | 346 |
} |
KCOM/Events/Implementation/TopMenuEvent.cs | ||
---|---|---|
2743 | 2743 |
{ |
2744 | 2744 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
2745 | 2745 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
2746 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
|
|
2746 |
final.TranslateItems(realPointX, realPointY);
|
|
2747 | 2747 |
|
2748 | 2748 |
if (final.Members.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null) |
2749 | 2749 |
{ |
2750 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy
|
|
2750 |
final.TranslateItems(0.001, 0.001); //dummy
|
|
2751 | 2751 |
} |
2752 | 2752 |
|
2753 | 2753 |
} |
... | ... | |
2873 | 2873 |
|
2874 | 2874 |
double realPointX = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
2875 | 2875 |
double realPointY = this.ParentOfType<MainWindow>().dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
2876 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
|
|
2876 |
final.TranslateItems(realPointX, realPointY);
|
|
2877 | 2877 |
} |
2878 | 2878 |
catch(Exception ex) |
2879 | 2879 |
{ |
KCOM/Events/PasteCommand.cs | ||
---|---|---|
111 | 111 |
|
112 | 112 |
double realPointX = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
113 | 113 |
double realPointY = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
114 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
|
|
114 |
final.TranslateItems(realPointX, realPointY);
|
|
115 | 115 |
|
116 | 116 |
if (final.Members.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null) |
117 | 117 |
{ |
118 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy
|
|
118 |
final.TranslateItems(0.001, 0.001); //dummy
|
|
119 | 119 |
} |
120 | 120 |
|
121 | 121 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
... | ... | |
229 | 229 |
|
230 | 230 |
double realPointX = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
231 | 231 |
double realPointY = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
232 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
|
|
232 |
final.TranslateItems(realPointX, realPointY);
|
|
233 | 233 |
} |
234 | 234 |
catch (Exception ex) |
235 | 235 |
{ |
KCOM/Events/RedoCommand.cs | ||
---|---|---|
90 | 90 |
else |
91 | 91 |
{ |
92 | 92 |
(item.Markup as IPath).PointSet = item.PointSet; |
93 |
(item.Markup as IPath).updateControl();
|
|
93 |
(item.Markup as CommentUserInfo).UpdateControl();
|
|
94 | 94 |
} |
95 | 95 |
comment.Add(item.Markup); |
96 | 96 |
} |
KCOM/Events/UndoCommand.cs | ||
---|---|---|
147 | 147 |
else |
148 | 148 |
{ |
149 | 149 |
(item.Markup as IPath).PointSet = item.PointSet; |
150 |
(item.Markup as IPath).updateControl();
|
|
150 |
(item.Markup as CommentUserInfo).UpdateControl();
|
|
151 | 151 |
} |
152 | 152 |
|
153 | 153 |
comment.Add(item.Markup); |
KCOM/MainWindow.xaml.cs | ||
---|---|---|
570 | 570 |
|
571 | 571 |
double realPointX = this.dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
572 | 572 |
double realPointY = this.dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
573 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
|
|
573 |
final.TranslateItems(realPointX, realPointY);
|
|
574 | 574 |
|
575 | 575 |
if (final.Members.Where(type => type.Drawingtype == MarkupToPDF.Controls.Common.ControlType.TextControl).FirstOrDefault() != null) |
576 | 576 |
{ |
577 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001));
|
|
577 |
final.TranslateItems(0.001, 0.001);
|
|
578 | 578 |
} |
579 | 579 |
|
580 | 580 |
this.dzMainMenu.SelectLayer.Children.Add(final); |
... | ... | |
676 | 676 |
|
677 | 677 |
double realPointX = this.dzMainMenu.getCurrentPoint.X - final.BorderSize.X - (final.BorderSize.Width / 2); |
678 | 678 |
double realPointY = this.dzMainMenu.getCurrentPoint.Y - final.BorderSize.Y - (final.BorderSize.Height / 2); |
679 |
final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(realPointX, realPointY));
|
|
679 |
final.TranslateItems(realPointX, realPointY);
|
|
680 | 680 |
} |
681 | 681 |
catch(Exception ex) |
682 | 682 |
{ |
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
2739 | 2739 |
control.ApplyOverViewData(); |
2740 | 2740 |
|
2741 | 2741 |
CreateCommand.Instance.Execute(currentControl); |
2742 |
control.updateControl();
|
|
2742 |
control.UpdateControl();
|
|
2743 | 2743 |
currentControl = null; |
2744 | 2744 |
} |
2745 | 2745 |
} |
MarkupToPDF/Common/CommentUserInfo.cs | ||
---|---|---|
15 | 15 |
{ |
16 | 16 |
void OnCreatingMouseMove(Point pt, bool bAxisLocked, bool bShiftKeyPressed); |
17 | 17 |
void OnMoveCtrlPoint(Point pt, double dx, double dy); |
18 |
void OnTranslate(double dx, double dy); |
|
19 |
void UpdateControl(); |
|
18 | 20 |
} |
19 | 21 |
|
20 | 22 |
public class CommentUserInfo : System.Windows.Controls.Control, ICommentUserInfo |
... | ... | |
72 | 74 |
public virtual void OnMoveCtrlPoint(Point pt, double dx, double dy) { } |
73 | 75 |
|
74 | 76 |
/// <summary> |
77 |
/// translate control along given dx,dy |
|
78 |
/// </summary> |
|
79 |
/// <param name="dx"></param> |
|
80 |
/// <param name="dy"></param> |
|
81 |
public virtual void OnTranslate(double dx, double dy) |
|
82 |
{ |
|
83 |
var path = (this as IPath); |
|
84 |
for(int i=0;i < path.PointSet.Count;++i) |
|
85 |
{ |
|
86 |
path.PointSet[i] = new Point(path.PointSet[i].X + dx, path.PointSet[i].Y + dy); |
|
87 |
} |
|
88 |
this.UpdateControl(); |
|
89 |
} |
|
90 |
|
|
91 |
/// <summary> |
|
92 |
/// update control |
|
93 |
/// </summary> |
|
94 |
public virtual void UpdateControl() { } |
|
95 |
|
|
96 |
/// <summary> |
|
75 | 97 |
/// subclass has to override this property |
76 | 98 |
/// </summary> |
77 | 99 |
public virtual bool IsSelected { get; set; } |
... | ... | |
84 | 106 |
public virtual SolidColorBrush StrokeColor { get; set; } |
85 | 107 |
|
86 | 108 |
/// <summary> |
87 |
/// translate commeny by given dx, dy |
|
88 |
/// </summary> |
|
89 |
/// <param name="dx"></param> |
|
90 |
/// <param name="dy"></param> |
|
91 |
public virtual void Move(double dx, double dy) { } |
|
92 |
|
|
93 |
/// <summary> |
|
94 | 109 |
/// |
95 | 110 |
/// </summary> |
96 | 111 |
public virtual void ApplyOverViewData() { } |
MarkupToPDF/Controls/Common/IPath.cs | ||
---|---|---|
21 | 21 |
double Height { get; set; } |
22 | 22 |
|
23 | 23 |
string UserID { get; set; } |
24 |
|
|
25 |
void updateControl(); |
|
26 | 24 |
} |
27 | 25 |
} |
MarkupToPDF/Controls/Common/Interfaces.cs | ||
---|---|---|
20 | 20 |
double Height { get; set; } |
21 | 21 |
Point StartPoint { get; set; } |
22 | 22 |
Point EndPoint { get; set; } |
23 |
void updateControl(); |
|
24 | 23 |
} |
25 | 24 |
|
26 | 25 |
public interface ICloudControl : IPath |
MarkupToPDF/Controls/Etc/DateControl.cs | ||
---|---|---|
449 | 449 |
this.OverViewEndPoint = this.EndPoint; |
450 | 450 |
} |
451 | 451 |
|
452 |
public void updateControl()
|
|
452 |
public override void UpdateControl()
|
|
453 | 453 |
{ |
454 | 454 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
455 | 455 |
this.TopRightPoint = new Point(this.PointSet[3].X, this.PointSet[3].Y); |
... | ... | |
520 | 520 |
[i].Y - path.PointSet[ReverseP].Y); |
521 | 521 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
522 | 522 |
|
523 |
this.updateControl();
|
|
523 |
this.UpdateControl();
|
|
524 | 524 |
} |
525 | 525 |
|
526 | 526 |
/// <summary> |
MarkupToPDF/Controls/Etc/ImgControl.cs | ||
---|---|---|
333 | 333 |
ApplyOverViewData(); |
334 | 334 |
|
335 | 335 |
} |
336 |
public void updateControl()
|
|
336 |
public override void UpdateControl()
|
|
337 | 337 |
{ |
338 | 338 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
339 | 339 |
this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
406 | 406 |
[i].Y - path.PointSet[ReverseP].Y); |
407 | 407 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
408 | 408 |
|
409 |
this.updateControl();
|
|
409 |
this.UpdateControl();
|
|
410 | 410 |
} |
411 | 411 |
|
412 | 412 |
/// <summary> |
MarkupToPDF/Controls/Etc/SignControl.cs | ||
---|---|---|
288 | 288 |
if (PropertyChanged != null) |
289 | 289 |
PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
290 | 290 |
} |
291 |
public void updateControl() |
|
291 |
|
|
292 |
public override void UpdateControl() |
|
292 | 293 |
{ |
293 | 294 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
294 | 295 |
this.TopRightPoint = new Point(this.PointSet[3].X, this.PointSet[3].Y); |
... | ... | |
377 | 378 |
[i].Y - path.PointSet[ReverseP].Y); |
378 | 379 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
379 | 380 |
|
380 |
this.updateControl();
|
|
381 |
this.UpdateControl();
|
|
381 | 382 |
} |
382 | 383 |
|
383 | 384 |
/// <summary> |
MarkupToPDF/Controls/Etc/SymControl.cs | ||
---|---|---|
355 | 355 |
Canvas.SetTop(this, MathSet.RotateAbout(mid, mid, AngleData).Y - this.Base_ViewBox.Height / 2); |
356 | 356 |
|
357 | 357 |
} |
358 |
public void updateControl() |
|
358 |
|
|
359 |
public override void UpdateControl() |
|
359 | 360 |
{ |
360 | 361 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
361 | 362 |
this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
446 | 447 |
[i].Y - path.PointSet[ReverseP].Y); |
447 | 448 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
448 | 449 |
|
449 |
this.updateControl();
|
|
450 |
this.UpdateControl();
|
|
450 | 451 |
} |
451 | 452 |
|
452 | 453 |
/// <summary> |
MarkupToPDF/Controls/Etc/SymControlN.cs | ||
---|---|---|
328 | 328 |
} |
329 | 329 |
} |
330 | 330 |
|
331 |
public void updateControl()
|
|
331 |
public override void UpdateControl()
|
|
332 | 332 |
{ |
333 | 333 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
334 | 334 |
this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
419 | 419 |
[i].Y - path.PointSet[ReverseP].Y); |
420 | 420 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
421 | 421 |
|
422 |
this.updateControl();
|
|
422 |
this.UpdateControl();
|
|
423 | 423 |
} |
424 | 424 |
|
425 | 425 |
/// <summary> |
MarkupToPDF/Controls/Line/ArcControl.cs | ||
---|---|---|
363 | 363 |
Base_ArcPath = GetTemplateChild(PART_ArcPath) as Path; |
364 | 364 |
SetArcPath(); |
365 | 365 |
} |
366 |
public void updateControl() |
|
366 |
|
|
367 |
public override void UpdateControl() |
|
367 | 368 |
{ |
368 | 369 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
369 | 370 |
this.MidPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
569 | 570 |
(this as IPath).PointSet[i] = selected; |
570 | 571 |
} |
571 | 572 |
} |
572 |
this.updateControl();
|
|
573 |
this.UpdateControl();
|
|
573 | 574 |
} |
574 | 575 |
|
575 | 576 |
/// <summary> |
MarkupToPDF/Controls/Line/ArrowArcControl.cs | ||
---|---|---|
362 | 362 |
Base_ArcPath = GetTemplateChild(PART_ArcPath) as Path; |
363 | 363 |
SetArcPath(); |
364 | 364 |
} |
365 |
public void updateControl() |
|
365 |
|
|
366 |
public override void UpdateControl() |
|
366 | 367 |
{ |
367 | 368 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
368 | 369 |
this.MidPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
513 | 514 |
(this as IPath).PointSet[i] = selected; |
514 | 515 |
} |
515 | 516 |
} |
516 |
this.updateControl();
|
|
517 |
this.UpdateControl();
|
|
517 | 518 |
} |
518 | 519 |
|
519 | 520 |
/// <summary> |
MarkupToPDF/Controls/Line/ArrowControl_Multi.cs | ||
---|---|---|
342 | 342 |
if (PropertyChanged != null) |
343 | 343 |
PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
344 | 344 |
} |
345 |
public void updateControl() |
|
345 |
|
|
346 |
public override void UpdateControl() |
|
346 | 347 |
{ |
347 | 348 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
348 | 349 |
this.MiddlePoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
405 | 406 |
(this as IPath).PointSet[i] = selected; |
406 | 407 |
} |
407 | 408 |
} |
408 |
this.updateControl();
|
|
409 |
this.UpdateControl();
|
|
409 | 410 |
} |
410 | 411 |
|
411 | 412 |
/// <summary> |
MarkupToPDF/Controls/Line/LineControl.cs | ||
---|---|---|
357 | 357 |
SetLinePath(); |
358 | 358 |
} |
359 | 359 |
|
360 |
public void updateControl()
|
|
360 |
public override void UpdateControl()
|
|
361 | 361 |
{ |
362 | 362 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
363 | 363 |
this.EndPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
541 | 541 |
(this as IPath).PointSet[i] = selected; |
542 | 542 |
} |
543 | 543 |
} |
544 |
this.updateControl();
|
|
544 |
this.UpdateControl();
|
|
545 | 545 |
} |
546 | 546 |
|
547 | 547 |
/// <summary> |
MarkupToPDF/Controls/Polygon/CloudControl.cs | ||
---|---|---|
795 | 795 |
if (PropertyChanged != null) |
796 | 796 |
PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
797 | 797 |
} |
798 |
public void updateControl() |
|
798 |
|
|
799 |
public override void UpdateControl() |
|
799 | 800 |
{ |
800 | 801 |
|
801 | 802 |
var lastIndex = this.PointSet.Count - 1; |
... | ... | |
852 | 853 |
break; |
853 | 854 |
} |
854 | 855 |
} |
855 |
this.updateControl();
|
|
856 |
this.UpdateControl();
|
|
856 | 857 |
this.DrawingCloud(); |
857 | 858 |
} |
858 | 859 |
|
MarkupToPDF/Controls/Polygon/InkControl.cs | ||
---|---|---|
424 | 424 |
} |
425 | 425 |
#endregion |
426 | 426 |
|
427 |
public void updateControl()
|
|
427 |
public override void UpdateControl()
|
|
428 | 428 |
{ |
429 | 429 |
this.PointSet = new List<Point>(); |
430 | 430 |
|
... | ... | |
559 | 559 |
break; |
560 | 560 |
} |
561 | 561 |
} |
562 |
this.updateControl();
|
|
562 |
this.UpdateControl();
|
|
563 | 563 |
} |
564 | 564 |
|
565 | 565 |
/// <summary> |
MarkupToPDF/Controls/Polygon/PolygonControl.cs | ||
---|---|---|
417 | 417 |
} |
418 | 418 |
#endregion |
419 | 419 |
|
420 |
public void updateControl()
|
|
420 |
public override void UpdateControl()
|
|
421 | 421 |
{ |
422 | 422 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
423 | 423 |
this.EndPoint = new Point(this.PointSet[this.PointSet.Count - 1].X, this.PointSet[this.PointSet.Count - 1].Y); |
... | ... | |
499 | 499 |
} |
500 | 500 |
this.PointSet.Add(tmp); |
501 | 501 |
|
502 |
this.updateControl();
|
|
502 |
this.UpdateControl();
|
|
503 | 503 |
} |
504 | 504 |
|
505 | 505 |
/// <summary> |
... | ... | |
523 | 523 |
break; |
524 | 524 |
} |
525 | 525 |
} |
526 |
this.updateControl();
|
|
526 |
this.UpdateControl();
|
|
527 | 527 |
} |
528 | 528 |
|
529 | 529 |
/// <summary> |
MarkupToPDF/Controls/Shape/CircleControl.cs | ||
---|---|---|
412 | 412 |
this.PathData = CircleGroup; |
413 | 413 |
ApplyOverViewData(); |
414 | 414 |
} |
415 |
public void updateControl() |
|
415 |
|
|
416 |
public override void UpdateControl() |
|
416 | 417 |
{ |
417 | 418 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
418 | 419 |
this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
503 | 504 |
newPointSet[NextP] = new Point(newPointSet[ReverseP].X + NextV.X * l, newPointSet[ReverseP].Y + NextV.Y * l); |
504 | 505 |
|
505 | 506 |
path.PointSet = newPointSet; |
506 |
this.updateControl();
|
|
507 |
this.UpdateControl();
|
|
507 | 508 |
} |
508 | 509 |
|
509 | 510 |
/// <summary> |
MarkupToPDF/Controls/Shape/RectCloudControl.cs | ||
---|---|---|
506 | 506 |
this.OverViewPathData = this.PathData; |
507 | 507 |
} |
508 | 508 |
|
509 |
public void updateControl()
|
|
509 |
public override void UpdateControl()
|
|
510 | 510 |
{ |
511 | 511 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
512 | 512 |
this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
623 | 623 |
[i].Y - path.PointSet[ReverseP].Y); |
624 | 624 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
625 | 625 |
|
626 |
this.updateControl();
|
|
626 |
this.UpdateControl();
|
|
627 | 627 |
} |
628 | 628 |
|
629 | 629 |
/// <summary> |
MarkupToPDF/Controls/Shape/RectangleControl.cs | ||
---|---|---|
525 | 525 |
Base_RectPath.Focus(); |
526 | 526 |
} |
527 | 527 |
|
528 |
public void updateControl()
|
|
528 |
public override void UpdateControl()
|
|
529 | 529 |
{ |
530 | 530 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
531 | 531 |
this.LeftBottomPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
612 | 612 |
[i].Y - path.PointSet[ReverseP].Y); |
613 | 613 |
path.PointSet[NextP] = new Point(path.PointSet[ReverseP].X + NextV.X * l, path.PointSet[ReverseP].Y + NextV.Y * l); |
614 | 614 |
|
615 |
this.updateControl();
|
|
615 |
this.UpdateControl();
|
|
616 | 616 |
} |
617 | 617 |
|
618 | 618 |
/// <summary> |
MarkupToPDF/Controls/Shape/TriControl.cs | ||
---|---|---|
395 | 395 |
this.OverViewPathData = this.PathData; |
396 | 396 |
} |
397 | 397 |
|
398 |
public void updateControl()
|
|
398 |
public override void UpdateControl()
|
|
399 | 399 |
{ |
400 | 400 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
401 | 401 |
this.MidPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
455 | 455 |
(this as IPath).PointSet[i] = selected; |
456 | 456 |
} |
457 | 457 |
} |
458 |
this.updateControl();
|
|
458 |
this.UpdateControl();
|
|
459 | 459 |
} |
460 | 460 |
|
461 | 461 |
/// <summary> |
MarkupToPDF/Controls/Text/ArrowTextControl.cs | ||
---|---|---|
1305 | 1305 |
} |
1306 | 1306 |
} |
1307 | 1307 |
|
1308 |
public void updateControl()
|
|
1308 |
public override void UpdateControl()
|
|
1309 | 1309 |
{ |
1310 | 1310 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
1311 | 1311 |
this.MidPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
... | ... | |
1535 | 1535 |
path.PointSet[1] = pts[1]; |
1536 | 1536 |
path.PointSet[i] = selected; |
1537 | 1537 |
|
1538 |
this.updateControl();
|
|
1538 |
this.UpdateControl();
|
|
1539 | 1539 |
} |
1540 | 1540 |
|
1541 | 1541 |
/// <summary> |
MarkupToPDF/Controls/Text/TextControl.cs | ||
---|---|---|
29 | 29 |
private const string PART_TextBox = "PART_TextBox"; |
30 | 30 |
private const string PART_TextPath = "PART_TextPath"; |
31 | 31 |
private const string PART_TextBlock = "PART_TextBlock"; |
32 |
private const string PART_Canvas = "PART_TextControlCanvas"; |
|
32 | 33 |
//private const string PART_TextPrefix = "PART_TextPrefix"; |
33 | 34 |
|
34 | 35 |
public Path Base_TextPath = null; |
35 | 36 |
public Grid Base_Grid = null; |
36 | 37 |
public Border Base_Border = null; |
38 |
public Canvas Base_Canvas = null; |
|
37 | 39 |
//public TextBlock Base_TextPrefixBlock = null; |
38 | 40 |
public TextBlock Base_TextBlock = null; |
39 | 41 |
public TextBox Base_TextBox = null; |
... | ... | |
83 | 85 |
Base_TextBlock = GetTemplateChild(PART_TextBlock) as TextBlock; |
84 | 86 |
Base_Grid = GetTemplateChild(PART_Grid) as Grid; |
85 | 87 |
Base_Border = GetTemplateChild(PART_Border) as Border; |
86 |
|
|
88 |
Base_Canvas = GetTemplateChild(PART_Canvas) as Canvas; |
|
89 |
|
|
87 | 90 |
this.Base_TextBox.SizeChanged += new SizeChangedEventHandler(Base_TextBox_SizeChanged); |
88 | 91 |
this.Base_TextBlock.SizeChanged += new SizeChangedEventHandler(Base_TextBlock_SizeChanged); |
89 | 92 |
this.Base_TextBox.GotFocus += new RoutedEventHandler(TextControl_GotFocus); |
... | ... | |
311 | 314 |
GC.Collect(); |
312 | 315 |
GC.SuppressFinalize(this); |
313 | 316 |
} |
314 |
public void updateControl() |
|
317 |
|
|
318 |
public override void UpdateControl() |
|
315 | 319 |
{ |
316 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
|
317 |
this.EndPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
|
320 |
if (this.PointSet.Count > 1) |
|
321 |
{ |
|
322 |
this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
|
323 |
this.EndPoint = new Point(this.PointSet[1].X, this.PointSet[1].Y); |
|
324 |
} |
|
318 | 325 |
} |
319 | 326 |
|
320 | 327 |
#region Drawing Cloud Method |
... | ... | |
1062 | 1069 |
instance.SetValue(e.Property, e.NewValue); |
1063 | 1070 |
|
1064 | 1071 |
Canvas.SetLeft(instance, instance.CanvasX); |
1065 |
|
|
1066 | 1072 |
Canvas.SetTop(instance, instance.CanvasY); |
1067 | 1073 |
} |
1068 | 1074 |
} |
... | ... | |
1146 | 1152 |
} |
1147 | 1153 |
|
1148 | 1154 |
/// <summary> |
1149 |
/// translate TextControl by given dx, dy
|
|
1155 |
/// translate control along given dx,dy
|
|
1150 | 1156 |
/// </summary> |
1151 | 1157 |
/// <param name="dx"></param> |
1152 | 1158 |
/// <param name="dy"></param> |
1153 |
public override void Move(double dx, double dy)
|
|
1159 |
public override void OnTranslate(double dx, double dy)
|
|
1154 | 1160 |
{ |
1155 |
this.SetValue(TextControl.CanvasXProperty, Canvas.GetLeft(this) + dx); |
|
1156 |
this.SetValue(TextControl.CanvasYProperty, Canvas.GetTop(this) + dy); |
|
1161 |
//this.CanvasX = Canvas.GetLeft(this) + dx; |
|
1162 |
//this.CanvasY = Canvas.GetTop(this) + dy; |
|
1163 |
|
|
1164 |
//this.SetValue(TextControl.CanvasXProperty, Canvas.GetLeft(this) + dx); |
|
1165 |
//this.SetValue(TextControl.CanvasYProperty, Canvas.GetTop(this) + dy); |
|
1157 | 1166 |
this.StartPoint = new Point(this.StartPoint.X + dx, this.StartPoint.Y + dy); |
1158 | 1167 |
this.EndPoint = new Point(this.EndPoint.X + dx, this.EndPoint.Y + dy); |
1168 |
|
|
1169 |
Canvas.SetLeft(this, Canvas.GetLeft(this) + dx); |
|
1170 |
Canvas.SetTop(this, Canvas.GetTop(this) + dy); |
|
1159 | 1171 |
} |
1160 | 1172 |
|
1161 | 1173 |
/// <summary> |
MarkupToPDF/Themes/generic.xaml | ||
---|---|---|
299 | 299 |
<Setter.Value> |
300 | 300 |
<!--<ControlTemplate TargetType="Text:TextControl">--> |
301 | 301 |
<ControlTemplate TargetType="{x:Type Text:TextControl}"> |
302 |
<Canvas Background="Red"> |
|
302 |
<Canvas Background="Red" x:Name="PART_TextControlCanvas">
|
|
303 | 303 |
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="PART_Grid" RenderTransformOrigin="0,0" Canvas.ZIndex="0"> |
304 | 304 |
<Grid.RenderTransform> |
305 | 305 |
<RotateTransform Angle="{Binding Angle, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent} }" |
내보내기 Unified diff