1 #include <cppconsui/Label.h>
2 #include <cppconsui/Panel.h>
3 #include <cppconsui/TextEntry.h>
4 #include <cppconsui/Window.h>
7 class TestWindow
: public CppConsUI::Window
{
10 virtual ~TestWindow() override
{}
13 CONSUI_DISABLE_COPY(TestWindow
);
16 TestWindow::TestWindow() : CppConsUI::Window(0, 0, AUTOSIZE
, AUTOSIZE
)
20 addWidget(*(new CppConsUI::Label("Press F10 to quit.")), 1, 1);
21 addWidget(*(new CppConsUI::Label("Press TAB to move focus.")), 1, 2);
22 addWidget(*(new CppConsUI::Label(
23 "All TextEntry widgets are surrouned by "
24 "Panel widget in this test (except the autosize example).")),
27 addWidget(*(new CppConsUI::Panel(22, 3)), 1, 5);
28 addWidget(*(new CppConsUI::TextEntry(20, 1, "Edit me.")), 2, 6);
30 addWidget(*(new CppConsUI::Panel(22, 3)), 1, 9);
31 addWidget(*(new CppConsUI::TextEntry(
32 20, 1, "Too wide string, too wide string, too wide string")),
35 addWidget(*(new CppConsUI::Panel(22, 5)), 1, 13);
36 addWidget(*(new CppConsUI::TextEntry(
37 20, 3, "Multiline textentry, multiline textentry")),
41 addWidget(*(new CppConsUI::Panel(32, 5)), 1, 19);
42 addWidget(*(new CppConsUI::TextEntry(30, 3,
43 "\x56\xc5\x99\x65\xc5\xa1\x74\xc3\xad\x63\xc3\xad\x20\x70\xc5\x99"
44 "\xc3\xad\xc5\xa1\x65\x72\x79\x20\x73\x65\x20\x64\x6f\xc5\xbe\x61"
45 "\x64\x6f\x76\x61\x6c\x79\x20\xc3\xba\x70\x6c\x6e\xc4\x9b\x20\xc4"
46 "\x8d\x65\x72\x73\x74\x76\xc3\xbd\x63\x68\x20\xc5\x99\xc3\xad\x7a"
47 "\x65\xc4\x8d\x6b\xc5\xaf\x2e\x0a")),
50 addWidget(*(new CppConsUI::TextEntry("Autosize")), 2, 25);
55 // Create the main window.
56 auto win
= new TestWindow
;
60 // vim: set tabstop=2 shiftwidth=2 textwidth=80 expandtab