Files
Terminal.Gui/UICatalog/Scenarios/ChineseUI.cs
Tig 7af54f369d Robustness improvements in prep for implementing Virtual Terminal Sequences (#3094)
* Fixes #2616. Support combining sequences that don't normalize

* Decouples Application from ConsoleDriver in TestHelpers

* Updates driver tests to match new arch

* Start on making all driver tests test all drivers

* Improves handling if combining marks.

* Fix unit tests fails.

* Fix unit tests fails.

* Handling combining mask.

* Tying to fix this unit test that sometimes fail.

* Add support for combining mask on NetDriver.

* Enable CombiningMarks as List<Rune>.

* Prevents combining marks on invalid runes default and space.

* Formatting for CI tests.

* Fix non-normalized combining mark to add 1 to Col.

* Reformatting for retest the CI.

* Forces non-normalized CMs to be ignored.

* Initial experiment

* Created ANSiDriver. Updated UI Catalog command line handling

* Fixed ForceDriver logic

* Fixed ForceDriver logic

* Updating P/Invoke

* Force16 colors WIP

* Fixed 16 colo mode

* Updated unit tests

* UI catalog tweak

* Added chinese scenario from bdisp

* Disabled AnsiDriver unit tests for now.

* Code cleanup

* Initial commit (fork from v2_fixes_2610_WT_VTS)

* Code cleanup

* Removed nativemethods.txt

* Removed not needed native stuff

* Code cleanup

* Ensures command line handler doesn't eat exceptions

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
2024-01-04 22:35:18 -07:00

53 lines
960 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 (1, 1, "你", true); // 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 (12, 1, "好"), // v1: B
new Button (22, 1, "呀") // v1: C
);
Application.Run ();
}
public override void Run ()
{
}
}