개정판 e1b36bc0
Feature: Grouping 기능 추가(Ctrl+G : Group, Ctrl+Shift+G : Ungroup)
Change-Id: I99a3309acd55799ff7101522feaa035225b80e48
MarkupToPDF/Controls/Etc/DateControl.cs | ||
---|---|---|
23 | 23 |
{ |
24 | 24 |
private const string PART_ViewBox = "PART_ViewBox"; |
25 | 25 |
private const string PART_TextBox = "PART_TextBox"; |
26 |
public Viewbox Base_ViewBox = null; |
|
27 |
public TextBlock Base_TextBox = null; |
|
26 |
public Viewbox Base_ViewBox { get; set; } = null;
|
|
27 |
public TextBlock Base_TextBox { get; set; } = null;
|
|
28 | 28 |
|
29 | 29 |
static DateControl() |
30 | 30 |
{ |
... | ... | |
58 | 58 |
UserID = item.UserID; |
59 | 59 |
Memo = item.Memo; |
60 | 60 |
ZIndex = item.ZIndex; |
61 |
GroupID = item.GroupID; |
|
61 | 62 |
} |
62 | 63 |
} |
63 | 64 |
|
... | ... | |
378 | 379 |
|
379 | 380 |
#endregion |
380 | 381 |
#region Data |
381 |
LineGeometry p1 = new LineGeometry(); |
|
382 |
LineGeometry p2 = new LineGeometry(); |
|
383 |
LineGeometry p3 = new LineGeometry(); |
|
384 |
LineGeometry p4 = new LineGeometry(); |
|
385 |
GeometryGroup instanceGroup = new GeometryGroup(); |
|
386 |
FormattedText text; |
|
382 |
GeometryGroup instanceGroup { get; } = new GeometryGroup(); |
|
383 |
FormattedText text { get; set; } |
|
387 | 384 |
#endregion |
388 | 385 |
public override void OnApplyTemplate() |
389 | 386 |
{ |
... | ... | |
411 | 408 |
this.TopRightPoint, |
412 | 409 |
}); |
413 | 410 |
|
414 |
|
|
415 | 411 |
double AngleData = this.CommentAngle * -1; |
416 | 412 |
|
417 | 413 |
PathFigure pathFigure = new PathFigure(); |
... | ... | |
437 | 433 |
pathGeometry.Figures = new PathFigureCollection(); |
438 | 434 |
pathFigure.IsClosed = true; |
439 | 435 |
pathGeometry.Figures.Add(pathFigure); |
440 |
this.Base_ViewBox.Width = pathGeometry.Bounds.Width; |
|
441 |
this.Base_ViewBox.Height = pathGeometry.Bounds.Height; |
|
442 |
this.Tag = pathGeometry; |
|
443 |
|
|
444 |
Canvas.SetLeft(this, MathSet.RotateAbout(mid, mid, AngleData).X - this.Base_ViewBox.Width / 2); |
|
445 |
Canvas.SetTop(this, MathSet.RotateAbout(mid, mid, AngleData).Y - this.Base_ViewBox.Height / 2); |
|
446 | 436 |
|
447 | 437 |
//CenterX = MathSet.RotateAbout(mid, mid, AngleData).X - this.Base_ViewBox.Width / 2; |
448 | 438 |
//CenterY = MathSet.RotateAbout(mid, mid, AngleData).Y - this.Base_ViewBox.Height / 2; |
449 | 439 |
|
450 | 440 |
instanceGroup.Children.Add(pathGeometry); |
451 | 441 |
|
442 |
double emSize = MathSet.DistanceTo(this.StartPoint, this.LeftBottomPoint); |
|
443 |
if (emSize == 0) emSize = 16; |
|
452 | 444 |
text = new FormattedText(Text, System.Globalization.CultureInfo.CurrentCulture, |
453 |
FlowDirection.LeftToRight, new Typeface("Tahoma"), 16, Brushes.Black);
|
|
445 |
FlowDirection.LeftToRight, new Typeface("Tahoma"), emSize, Brushes.Black);
|
|
454 | 446 |
|
455 |
instanceGroup.Children.Add(text.BuildGeometry(new Point(10,10))); |
|
447 |
this.Base_ViewBox.Width = text.Width; |
|
448 |
this.Base_ViewBox.Height = text.Height; |
|
449 |
this.Tag = pathGeometry; |
|
456 | 450 |
|
457 |
PathData = instanceGroup; |
|
458 |
//OverViewPathData = PathData; |
|
451 |
Canvas.SetLeft(this, mid.X - this.Base_ViewBox.Width * 0.5); |
|
452 |
Canvas.SetTop(this, mid.Y - this.Base_ViewBox.Height * 0.5); |
|
453 |
Canvas.SetRight(this, mid.X + this.Base_ViewBox.Width * 0.5); |
|
454 |
Canvas.SetBottom(this, mid.Y + this.Base_ViewBox.Height * 0.5); |
|
459 | 455 |
|
456 |
instanceGroup.Children.Add(text.BuildGeometry(new Point(0, 0))); |
|
460 | 457 |
|
458 |
PathData = instanceGroup; |
|
461 | 459 |
} |
462 | 460 |
|
463 | 461 |
public event PropertyChangedEventHandler PropertyChanged; |
... | ... | |
584 | 582 |
using (S_DateControl ctrl = new S_DateControl()) |
585 | 583 |
{ |
586 | 584 |
ctrl.Angle = this.CommentAngle; |
585 |
ctrl.StartPoint = this.StartPoint; |
|
587 | 586 |
ctrl.EndPoint = this.EndPoint; |
587 |
ctrl.PointSet = this.PointSet; |
|
588 |
|
|
588 | 589 |
ctrl.UserID = this.UserID; |
589 | 590 |
ctrl.LB = this.LeftBottomPoint; |
590 | 591 |
ctrl.Name = this.GetType().Name; |
591 |
ctrl.PointSet = this.PointSet; |
|
592 |
ctrl.StartPoint = this.StartPoint; |
|
592 |
|
|
593 | 593 |
ctrl.Opac = this.Opacity; |
594 | 594 |
ctrl.TR = this.TopRightPoint; |
595 | 595 |
ctrl.TransformPoint = "0|0"; |
... | ... | |
602 | 602 |
ctrl.Memo = this.Memo; |
603 | 603 |
|
604 | 604 |
ctrl.ZIndex = this.ZIndex; |
605 |
ctrl.GroupID = this.GroupID; |
|
605 | 606 |
|
606 | 607 |
return "|DZ|" + JsonSerializerHelper.CompressString((ctrl.JsonSerialize())); |
607 | 608 |
} |
... | ... | |
631 | 632 |
PointSet = s.PointSet, |
632 | 633 |
UserID = s.UserID, |
633 | 634 |
Memo = s.Memo, |
634 |
ZIndex = s.ZIndex |
|
635 |
ZIndex = s.ZIndex, |
|
636 |
GroupID = s.GroupID |
|
635 | 637 |
}; |
636 | 638 |
} |
637 | 639 |
} |
내보내기 Unified diff