aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/Label.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-05 18:36:22 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-05 18:36:22 +0100
commit759f4f39e3fdde1f9ed8b620af51e05d052d8964 (patch)
tree227dfc400aefab23c7f34ea8065049c9dcdbefc2 /src/GraphicObjects/Label.cs
parente86428443b1db0f1d07b51d0c202a111427837d2 (diff)
Textbox and Label: insert linebreak, update size if Fit
Diffstat (limited to 'src/GraphicObjects/Label.cs')
-rw-r--r--src/GraphicObjects/Label.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index ee7dd045..d8d214c7 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -271,7 +271,17 @@ namespace Crow
CurrentColumn += str.Length;
NotifyValueChanged ("Text", Text);
}
-
+ /// <summary>
+ /// Insert a line break.
+ /// </summary>
+ protected void InsertLineBreak()
+ {
+ lines.Insert(CurrentLine + 1, lines[CurrentLine].Substring(CurrentColumn));
+ lines [CurrentLine] = lines [CurrentLine].Substring (0, CurrentColumn);
+ CurrentLine++;
+ CurrentColumn = 0;
+ NotifyValueChanged ("Text", Text);
+ }
#region GraphicObject overrides
[XmlAttributeAttribute()][DefaultValue(-1)]
public override int Width {