ui/wpf/UIcore/TextArea.cs

changeset 101
1c943d43fa81
parent 88
04c81be1c5a0
child 104
3efe0210e27e
equal deleted inserted replaced
100:d276306d801f 101:1c943d43fa81
6 6
7 namespace UI 7 namespace UI
8 { 8 {
9 public class TextArea : System.Windows.Controls.TextBox 9 public class TextArea : System.Windows.Controls.TextBox
10 { 10 {
11 public TextArea(Container container, String text) : base() 11 public TextArea(Container container, String text, bool textarea) : base()
12 { 12 {
13 AcceptsReturn = true; 13 bool fill = false;
14 IsUndoEnabled = false; // we need our own undo stack 14 if (textarea)
15 {
16 AcceptsReturn = true;
17 IsUndoEnabled = false; // we need our own undo stack
18 VerticalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto;
19 HorizontalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto;
20 fill = true;
21 }
22
15 if (text != null) 23 if (text != null)
16 { 24 {
17 Text = text; 25 Text = text;
18 } 26 }
19 VerticalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto; 27
20 HorizontalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto; 28 container.Add(this, fill);
21
22 container.Add(this, true);
23 } 29 }
24 30
25 public static TextArea CreateTextArea(Container container, String text) 31 public static TextArea CreateTextArea(Container container, String text)
26 { 32 {
27 return Application.GetInstance().Exec<TextArea>(() => new TextArea(container, text)); 33 return Application.GetInstance().Exec<TextArea>(() => new TextArea(container, text, true));
34 }
35
36 public static TextArea CreateTextField(Container container, String text)
37 {
38 return Application.GetInstance().Exec<TextArea>(() => new TextArea(container, text, false));
28 } 39 }
29 40
30 41
31 // ------------------ UiText methods ------------------ 42 // ------------------ UiText methods ------------------
32 43

mercurial