개정판 fa48eb85
issue #1000 컨트롤 angle 수정/ Textcontrol 텍스트 선택 수정
Change-Id: I56b5c6295adb7409774045545f30f16a920be96c
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
303 | 303 |
{ |
304 | 304 |
if (AngleValue == 0) |
305 | 305 |
{ |
306 |
AngleValue = (item.DrawingData as TextControl).Angle; |
|
306 |
AngleValue = (item.DrawingData as TextControl).CommentAngle;
|
|
307 | 307 |
} |
308 | 308 |
double X = Canvas.GetLeft((item.DrawingData as TextControl)); |
309 | 309 |
double Y = Canvas.GetTop((item.DrawingData as TextControl)); |
... | ... | |
369 | 369 |
Group_ID = member.GroupID, |
370 | 370 |
}); |
371 | 371 |
(member as ArrowTextControl).Base_TextBox.IsHitTestVisible = false; |
372 |
AngleValue = (member as ArrowTextControl).Angle; |
|
372 |
AngleValue = (member as ArrowTextControl).CommentAngle;
|
|
373 | 373 |
Observable.FromEventPattern(((ArrowTextControl)member).Base_TextBox, "LostFocus").Subscribe(a => |
374 | 374 |
{ |
375 | 375 |
TextCompensation = false; |
... | ... | |
383 | 383 |
break; |
384 | 384 |
case "ImgControl": |
385 | 385 |
this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID }); |
386 |
AngleValue = (member as ImgControl).Angle; |
|
386 |
AngleValue = (member as ImgControl).CommentAngle;
|
|
387 | 387 |
break; |
388 | 388 |
case "DateControl": |
389 | 389 |
this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID }); |
390 |
AngleValue = (member as DateControl).Angle; |
|
390 |
AngleValue = (member as DateControl).CommentAngle;
|
|
391 | 391 |
break; |
392 | 392 |
case "SignControl": |
393 | 393 |
this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID }); |
394 |
AngleValue = (member as SignControl).Angle; |
|
394 |
AngleValue = (member as SignControl).CommentAngle;
|
|
395 | 395 |
break; |
396 | 396 |
case "SymControl": |
397 | 397 |
this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID }); |
398 |
AngleValue = (member as SymControl).Angle; |
|
398 |
AngleValue = (member as SymControl).CommentAngle;
|
|
399 | 399 |
break; |
400 | 400 |
case "SymControlN": |
401 | 401 |
this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = member.ControlType, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID }); |
402 |
AngleValue = (member as SymControlN).Angle; |
|
402 |
AngleValue = (member as SymControlN).CommentAngle;
|
|
403 | 403 |
break; |
404 | 404 |
case "TextControl": |
405 | 405 |
this.Members.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.TextControl, ThumbList = new List<MyThumb>(), Symbol_ID = member.SymbolID, Group_ID = member.GroupID }); |
... | ... | |
422 | 422 |
DragThumb.RenderTransformOrigin = new Point(0.0, 0.0); |
423 | 423 |
DragThumb.RenderTransform = new RotateTransform() |
424 | 424 |
{ |
425 |
Angle = (member as TextControl).Angle, |
|
425 |
Angle = (member as TextControl).CommentAngle,
|
|
426 | 426 |
//CenterX = middle.X, |
427 | 427 |
//CenterY = middle.Y, |
428 | 428 |
}; |
... | ... | |
430 | 430 |
AdornerBorder.RenderTransformOrigin = new Point(0.0, 0.0); |
431 | 431 |
AdornerBorder.RenderTransform = new RotateTransform() |
432 | 432 |
{ |
433 |
Angle = (member as TextControl).Angle, |
|
433 |
Angle = (member as TextControl).CommentAngle,
|
|
434 | 434 |
//CenterX = middle.X, |
435 | 435 |
//CenterY = middle.Y, |
436 | 436 |
}; |
... | ... | |
480 | 480 |
{ |
481 | 481 |
AdornerBorder.RenderTransformOrigin = new Point(0.5, 0.5); |
482 | 482 |
DragThumb.RenderTransformOrigin = new Point(0.5, 0.5); |
483 |
AdornerBorder.RenderTransform = new RotateTransform() { Angle = (member as IViewBox).Angle }; |
|
484 |
DragThumb.RenderTransform = new RotateTransform() { Angle = (member as IViewBox).Angle }; |
|
483 |
AdornerBorder.RenderTransform = new RotateTransform() { Angle = (member as IViewBox).CommentAngle };
|
|
484 |
DragThumb.RenderTransform = new RotateTransform() { Angle = (member as IViewBox).CommentAngle };
|
|
485 | 485 |
} |
486 | 486 |
|
487 | 487 |
public void SetAdornerMember(List<CommentUserInfo> members) |
... | ... | |
616 | 616 |
{ |
617 | 617 |
if (this.Members.First().DrawingData.GetType().Name == "TextControl") |
618 | 618 |
{ |
619 |
if ((this.Members.First().DrawingData as TextControl).Angle != 0) |
|
619 |
if ((this.Members.First().DrawingData as TextControl).CommentAngle != 0)
|
|
620 | 620 |
{ |
621 |
trRotate.Angle = (this.Members.First().DrawingData as TextControl).Angle; |
|
622 |
trRotateThumb.Angle = (this.Members.First().DrawingData as TextControl).Angle; |
|
621 |
trRotate.Angle = (this.Members.First().DrawingData as TextControl).CommentAngle;
|
|
622 |
trRotateThumb.Angle = (this.Members.First().DrawingData as TextControl).CommentAngle;
|
|
623 | 623 |
} |
624 | 624 |
else |
625 | 625 |
{ |
... | ... | |
635 | 635 |
{ |
636 | 636 |
double textControlWidth; |
637 | 637 |
double textControlHeight; |
638 |
|
|
638 | 639 |
if (((currentControl as TextControl).Base_TextBox.ActualWidth) == 0) |
639 | 640 |
{ |
640 | 641 |
textControlWidth = ((currentControl as TextControl).Base_TextBlock.ActualWidth); |
... | ... | |
650 | 651 |
{ |
651 | 652 |
minX = (currentControl as TextControl).EndPoint.X; |
652 | 653 |
} |
654 |
|
|
653 | 655 |
if ((currentControl as TextControl).EndPoint.Y < minY) |
654 | 656 |
{ |
655 | 657 |
minY = (currentControl as TextControl).EndPoint.Y; |
656 | 658 |
} |
659 |
|
|
657 | 660 |
if (textControlWidth + (currentControl as TextControl).EndPoint.X > maxX) |
658 | 661 |
{ |
659 | 662 |
maxX = textControlWidth + (currentControl as TextControl).EndPoint.X; |
660 | 663 |
} |
664 |
|
|
661 | 665 |
if (textControlHeight + (currentControl as TextControl).EndPoint.Y > maxY) |
662 | 666 |
{ |
663 | 667 |
maxY = textControlHeight + (currentControl as TextControl).EndPoint.Y; |
... | ... | |
829 | 833 |
var temp = (this.Members.First() as AdornerMember).DrawingData as ArrowTextControl; |
830 | 834 |
|
831 | 835 |
|
832 |
switch (Math.Abs(temp.Angle).ToString()) |
|
836 |
switch (Math.Abs(temp.CommentAngle).ToString())
|
|
833 | 837 |
{ |
834 | 838 |
case "90": |
835 | 839 |
{ |
... | ... | |
918 | 922 |
tm.Style = (Style)this.LayoutRoot.Resources["ThumbTextStyle"]; |
919 | 923 |
tm.Width = (member as ArrowTextControl).BoxWidth; |
920 | 924 |
tm.Height = (member as ArrowTextControl).BoxHeight; |
921 |
var angle = (member as ArrowTextControl).Angle; |
|
925 |
var angle = (member as ArrowTextControl).PageAngle;
|
|
922 | 926 |
if (Math.Abs(angle).ToString() == "90") |
923 | 927 |
{ |
924 | 928 |
tm.RenderTransformOrigin = new Point(0, 0); |
... | ... | |
934 | 938 |
tm.RenderTransformOrigin = new Point(0.5, 0.5); |
935 | 939 |
tm.RenderTransform = new RotateTransform() |
936 | 940 |
{ |
937 |
Angle = angle,
|
|
941 |
Angle = angle |
|
938 | 942 |
}; |
939 | 943 |
} |
940 | 944 |
} |
... | ... | |
1218 | 1222 |
switch (member.Drawingtype) |
1219 | 1223 |
{ |
1220 | 1224 |
case ControlType.TextControl: |
1221 |
(member.DrawingData as CommentUserInfo).Angle = AngleValue; |
|
1225 |
(member.DrawingData as CommentUserInfo).CommentAngle = AngleValue;
|
|
1222 | 1226 |
|
1223 | 1227 |
DragThumb.RenderTransformOrigin = new Point(0, 0); |
1224 | 1228 |
DragThumb.RenderTransform = new RotateTransform() |
1225 | 1229 |
{ |
1226 | 1230 |
|
1227 |
Angle = (member.DrawingData as CommentUserInfo).Angle |
|
1231 |
Angle = (member.DrawingData as CommentUserInfo).CommentAngle
|
|
1228 | 1232 |
}; |
1229 | 1233 |
|
1230 | 1234 |
AdornerBorder.RenderTransformOrigin = new Point(0, 0); |
1231 | 1235 |
AdornerBorder.RenderTransform = new RotateTransform() |
1232 | 1236 |
{ |
1233 |
Angle = (member.DrawingData as CommentUserInfo).Angle |
|
1237 |
Angle = (member.DrawingData as CommentUserInfo).CommentAngle
|
|
1234 | 1238 |
}; |
1235 | 1239 |
|
1236 | 1240 |
//(member.DrawingData as TextControl).Angle = AngleValue; |
... | ... | |
1256 | 1260 |
case ControlType.Sign: |
1257 | 1261 |
case ControlType.Symbol: |
1258 | 1262 |
case ControlType.Stamp: |
1259 |
(member.DrawingData as CommentUserInfo).Angle = AngleValue; |
|
1263 |
(member.DrawingData as CommentUserInfo).CommentAngle = AngleValue;
|
|
1260 | 1264 |
BorderUpdate(); |
1261 | 1265 |
break; |
1262 | 1266 |
case ControlType.PolygonCloud: |
... | ... | |
1264 | 1268 |
BorderUpdate(); |
1265 | 1269 |
break; |
1266 | 1270 |
case ControlType.Circle: |
1267 |
(member.DrawingData as CommentUserInfo).Angle = AngleValue; |
|
1271 |
(member.DrawingData as CommentUserInfo).CommentAngle = AngleValue;
|
|
1268 | 1272 |
((CircleControl)member.DrawingData).SetCenterXY(); |
1269 | 1273 |
BorderUpdate(); |
1270 | 1274 |
break; |
... | ... | |
1284 | 1288 |
/// get angle from text controls' angle if only text control exists - 2018.05.10 added by humkyung |
1285 | 1289 |
if ((1 == this.Members.Count) && (this.Members.First() as AdornerMember).DrawingData.GetType().Name == "TextControl") |
1286 | 1290 |
{ |
1287 |
this.AngleValue = ((this.Members.First() as AdornerMember).DrawingData as TextControl).Angle; |
|
1291 |
this.AngleValue = ((this.Members.First() as AdornerMember).DrawingData as TextControl).CommentAngle;
|
|
1288 | 1292 |
} |
1289 | 1293 |
/// up to here |
1290 | 1294 |
|
... | ... | |
1345 | 1349 |
AllControl.Base_TextBox.Focus(); |
1346 | 1350 |
AllControl.Base_TextBox.Visibility = Visibility.Visible; |
1347 | 1351 |
AllControl.Base_TextBlock.Visibility = Visibility.Collapsed; |
1352 |
AllControl.Base_TextBox.IsHitTestVisible = true; |
|
1348 | 1353 |
AllControl.Base_TextBox.Focus(); |
1354 |
|
|
1349 | 1355 |
AllControl.SizeChanged += (sen, ea) => |
1350 | 1356 |
{ |
1351 | 1357 |
if (AllControl.Base_TextBox != null) |
... | ... | |
1365 | 1371 |
Point middle = MathSet.getMiddlePoint(AllControl.StartPoint, endPointV); |
1366 | 1372 |
AllControl.Base_Grid.RenderTransform = new RotateTransform() |
1367 | 1373 |
{ |
1368 |
Angle = AllControl.Angle, |
|
1374 |
Angle = AllControl.CommentAngle,
|
|
1369 | 1375 |
CenterX = middle.X, |
1370 | 1376 |
CenterY = middle.Y, |
1371 | 1377 |
}; |
내보내기 Unified diff