|
@@ -14,6 +14,7 @@ namespace UICatalog.Scenarios {
|
|
private Label _labelR;
|
|
private Label _labelR;
|
|
private Label _labelV;
|
|
private Label _labelV;
|
|
private Window _win;
|
|
private Window _win;
|
|
|
|
+ private string _lastRunesUsed;
|
|
|
|
|
|
public override void Init (Toplevel top, ColorScheme colorScheme)
|
|
public override void Init (Toplevel top, ColorScheme colorScheme)
|
|
{
|
|
{
|
|
@@ -35,32 +36,32 @@ namespace UICatalog.Scenarios {
|
|
})
|
|
})
|
|
});
|
|
});
|
|
|
|
|
|
- _label = new Label (text: "あなたの名前を入力してください:") {
|
|
|
|
|
|
+ _label = new Label () {
|
|
X = Pos.Center (),
|
|
X = Pos.Center (),
|
|
Y = 0,
|
|
Y = 0,
|
|
ColorScheme = new ColorScheme () {
|
|
ColorScheme = new ColorScheme () {
|
|
Normal = Colors.Base.Focus
|
|
Normal = Colors.Base.Focus
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- _text = new TextField ("ティラミス") {
|
|
|
|
|
|
+ _text = new TextField () {
|
|
X = Pos.Center (),
|
|
X = Pos.Center (),
|
|
Y = 2,
|
|
Y = 2,
|
|
Width = 20
|
|
Width = 20
|
|
};
|
|
};
|
|
- _button = new Button (text: "こんにちはと言う") {
|
|
|
|
|
|
+ _button = new Button () {
|
|
X = Pos.Center (),
|
|
X = Pos.Center (),
|
|
Y = 4
|
|
Y = 4
|
|
};
|
|
};
|
|
- _button.Clicked += () => MessageBox.Query ("こんにちはと言う", $"こんにちは {_text.Text}", "Ok");
|
|
|
|
- _labelR = new Label (text: "あなたの名前を入力してください") {
|
|
|
|
|
|
+ _labelR = new Label () {
|
|
X = Pos.AnchorEnd (30),
|
|
X = Pos.AnchorEnd (30),
|
|
Y = 18
|
|
Y = 18
|
|
};
|
|
};
|
|
- _labelV = new Label (text: "あなたの名前を入力してください", TextDirection.TopBottom_RightLeft) {
|
|
|
|
|
|
+ _labelV = new Label () {
|
|
|
|
+ TextDirection = TextDirection.TopBottom_LeftRight,
|
|
X = Pos.AnchorEnd (30),
|
|
X = Pos.AnchorEnd (30),
|
|
Y = Pos.Bottom (_labelR)
|
|
Y = Pos.Bottom (_labelR)
|
|
};
|
|
};
|
|
- _win = new Window ("デモエムポンズ") {
|
|
|
|
|
|
+ _win = new Window () {
|
|
X = 5,
|
|
X = 5,
|
|
Y = 5,
|
|
Y = 5,
|
|
Width = Dim.Fill (22),
|
|
Width = Dim.Fill (22),
|
|
@@ -68,15 +69,50 @@ namespace UICatalog.Scenarios {
|
|
};
|
|
};
|
|
_win.Add (_label, _text, _button, _labelR, _labelV);
|
|
_win.Add (_label, _text, _button, _labelR, _labelV);
|
|
Application.Top.Add (menu, _win);
|
|
Application.Top.Add (menu, _win);
|
|
|
|
+
|
|
|
|
+ WideRunes ();
|
|
|
|
+ //NarrowRunes ();
|
|
|
|
+ //MixedRunes ();
|
|
Application.Run ();
|
|
Application.Run ();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void UnsetClickedEvent ()
|
|
|
|
+ {
|
|
|
|
+ switch (_lastRunesUsed) {
|
|
|
|
+ case "Narrow":
|
|
|
|
+ _button.Clicked -= NarrowMessage;
|
|
|
|
+ break;
|
|
|
|
+ case "Mixed":
|
|
|
|
+ _button.Clicked -= MixedMessage;
|
|
|
|
+ break;
|
|
|
|
+ case "Wide":
|
|
|
|
+ _button.Clicked -= WideMessage;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void MixedMessage ()
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Query ("Say Hello 你", $"Hello {_text.Text}", "Ok");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void NarrowMessage ()
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Query ("Say Hello", $"Hello {_text.Text}", "Ok");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void WideMessage ()
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Query ("こんにちはと言う", $"こんにちは {_text.Text}", "Ok");
|
|
|
|
+ }
|
|
|
|
+
|
|
private void MixedRunes ()
|
|
private void MixedRunes ()
|
|
{
|
|
{
|
|
|
|
+ UnsetClickedEvent ();
|
|
_label.Text = "Enter your name 你:";
|
|
_label.Text = "Enter your name 你:";
|
|
_text.Text = "gui.cs 你:";
|
|
_text.Text = "gui.cs 你:";
|
|
_button.Text = "Say Hello 你";
|
|
_button.Text = "Say Hello 你";
|
|
- _button.Clicked += () => MessageBox.Query ("Say Hello 你", $"Hello {_text.Text}", "Ok");
|
|
|
|
|
|
+ _button.Clicked += MixedMessage;
|
|
_labelR.X = Pos.AnchorEnd (21);
|
|
_labelR.X = Pos.AnchorEnd (21);
|
|
_labelR.Y = 18;
|
|
_labelR.Y = 18;
|
|
_labelR.Text = "This is a test text 你";
|
|
_labelR.Text = "This is a test text 你";
|
|
@@ -84,14 +120,17 @@ namespace UICatalog.Scenarios {
|
|
_labelV.Y = Pos.Bottom (_labelR);
|
|
_labelV.Y = Pos.Bottom (_labelR);
|
|
_labelV.Text = "This is a test text 你";
|
|
_labelV.Text = "This is a test text 你";
|
|
_win.Title = "HACC Demo 你";
|
|
_win.Title = "HACC Demo 你";
|
|
|
|
+ _lastRunesUsed = "Mixed";
|
|
|
|
+ Application.Refresh ();
|
|
}
|
|
}
|
|
|
|
|
|
private void NarrowRunes ()
|
|
private void NarrowRunes ()
|
|
{
|
|
{
|
|
|
|
+ UnsetClickedEvent ();
|
|
_label.Text = "Enter your name:";
|
|
_label.Text = "Enter your name:";
|
|
_text.Text = "gui.cs";
|
|
_text.Text = "gui.cs";
|
|
_button.Text = "Say Hello";
|
|
_button.Text = "Say Hello";
|
|
- _button.Clicked += () => MessageBox.Query ("Say Hello", $"Hello {_text.Text}", "Ok");
|
|
|
|
|
|
+ _button.Clicked += NarrowMessage;
|
|
_labelR.X = Pos.AnchorEnd (19);
|
|
_labelR.X = Pos.AnchorEnd (19);
|
|
_labelR.Y = 18;
|
|
_labelR.Y = 18;
|
|
_labelR.Text = "This is a test text";
|
|
_labelR.Text = "This is a test text";
|
|
@@ -99,14 +138,17 @@ namespace UICatalog.Scenarios {
|
|
_labelV.Y = Pos.Bottom (_labelR);
|
|
_labelV.Y = Pos.Bottom (_labelR);
|
|
_labelV.Text = "This is a test text";
|
|
_labelV.Text = "This is a test text";
|
|
_win.Title = "HACC Demo";
|
|
_win.Title = "HACC Demo";
|
|
|
|
+ _lastRunesUsed = "Narrow";
|
|
|
|
+ Application.Refresh ();
|
|
}
|
|
}
|
|
|
|
|
|
private void WideRunes ()
|
|
private void WideRunes ()
|
|
{
|
|
{
|
|
|
|
+ UnsetClickedEvent ();
|
|
_label.Text = "あなたの名前を入力してください:";
|
|
_label.Text = "あなたの名前を入力してください:";
|
|
_text.Text = "ティラミス";
|
|
_text.Text = "ティラミス";
|
|
_button.Text = "こんにちはと言う";
|
|
_button.Text = "こんにちはと言う";
|
|
- _button.Clicked += () => MessageBox.Query ("こんにちはと言う", $"こんにちは {_text.Text}", "Ok");
|
|
|
|
|
|
+ _button.Clicked += WideMessage;
|
|
_labelR.X = Pos.AnchorEnd (29);
|
|
_labelR.X = Pos.AnchorEnd (29);
|
|
_labelR.Y = 18;
|
|
_labelR.Y = 18;
|
|
_labelR.Text = "あなたの名前を入力してください";
|
|
_labelR.Text = "あなたの名前を入力してください";
|
|
@@ -114,6 +156,8 @@ namespace UICatalog.Scenarios {
|
|
_labelV.Y = Pos.Bottom (_labelR);
|
|
_labelV.Y = Pos.Bottom (_labelR);
|
|
_labelV.Text = "あなたの名前を入力してください";
|
|
_labelV.Text = "あなたの名前を入力してください";
|
|
_win.Title = "デモエムポンズ";
|
|
_win.Title = "デモエムポンズ";
|
|
|
|
+ _lastRunesUsed = "Wide";
|
|
|
|
+ Application.Refresh ();
|
|
}
|
|
}
|
|
|
|
|
|
private void WithoutDrawMargin ()
|
|
private void WithoutDrawMargin ()
|