개정판 0d00f9c8
issue #923: implementing drag textcontrol
Change-Id: I17d1f4ec754ea13646260d1c331d574ad680d47d
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() { } |
내보내기 Unified diff