-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UITextBox.cs
60 lines (37 loc) · 1.4 KB
/
UITextBox.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Windows.Forms;
namespace WinForMono {
public class UITextBox : UIElement {
public UITextBox() : this(false) {}
public UITextBox(bool _multiline) {
multiline = _multiline;
derived_underlying = new TextBox();
derived_underlying.AcceptsReturn = multiline;
derived_underlying.AutoSize = false;
multiline = true;
CALL_THIS_AFTER_CONSTRUCTION_PLEASE();
autosize_text = false;
}
public override Control underlying {
get => derived_underlying;
set => derived_underlying = (TextBox)value;
}
private TextBox derived_underlying;
public string text {
get => derived_underlying.Text;
set => derived_underlying.Text = value;
}
public bool multiline;
public bool autosize_text;
protected override TextFormatFlags get_text_format_flags() {
TextFormatFlags returning = TextFormatFlags.Default | TextFormatFlags.TextBoxControl;
returning = returning | TextFormatFlags.Left;
returning = returning | TextFormatFlags.Top;
return returning;
}
protected override void on_transform_invalidated() {
base.on_transform_invalidated();
if (autosize_text) fix_text_size(int.MaxValue);
}
}
}