mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
53 lines
992 B
C#
53 lines
992 B
C#
using Terminal.Gui;
|
|
|
|
namespace UICatalog.Scenarios;
|
|
|
|
[ScenarioMetadata ("ChineseUI", "Chinese UI")]
|
|
[ScenarioCategory ("Unicode")]
|
|
public class ChineseUI : Scenario {
|
|
public override void Init ()
|
|
{
|
|
Application.Init ();
|
|
var top = Application.Top;
|
|
|
|
var win = new Window () {
|
|
Title = "Test",
|
|
X = 0,
|
|
Y = 0,
|
|
Width = Dim.Fill (),
|
|
Height = Dim.Fill ()
|
|
};
|
|
top.Add (win);
|
|
|
|
var buttonPanel = new FrameView () {
|
|
Title = "Command",
|
|
X = 0,
|
|
Y = 1,
|
|
Width = Dim.Fill (),
|
|
Height = 5
|
|
};
|
|
win.Add (buttonPanel);
|
|
|
|
var btn = new Button ("你", true) { X = 1, Y = 1 }; // v1: A
|
|
btn.Clicked += (s, e) => {
|
|
int result = MessageBox.Query ("Confirm",
|
|
"Are you sure you want to quit ui?", 0,
|
|
"Yes", "No");
|
|
if (result == 0) {
|
|
RequestStop ();
|
|
}
|
|
};
|
|
|
|
buttonPanel.Add (
|
|
btn,
|
|
new Button ("好") { X = 12, Y = 1 }, // v1: B
|
|
new Button ("呀") { X = 22, Y = 1 } // v1: C
|
|
);
|
|
|
|
Application.Run ();
|
|
}
|
|
|
|
public override void Run ()
|
|
{
|
|
}
|
|
} |