From b385eb56befa5226dcad8a30df2c5cb8cb683f2a Mon Sep 17 00:00:00 2001 From: cxl Date: Fri, 31 Aug 2018 12:06:39 +0000 Subject: [PATCH] .upptst git-svn-id: svn://ultimatepp.org/upp/trunk@12207 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- upptst/FontCJK/main.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/upptst/FontCJK/main.cpp b/upptst/FontCJK/main.cpp index d59e708db..cf90a52c0 100644 --- a/upptst/FontCJK/main.cpp +++ b/upptst/FontCJK/main.cpp @@ -2,26 +2,25 @@ using namespace Upp; -struct MyApp : TopWindow { - virtual void Paint(Draw& w); -}; - -void MyApp::Paint(Draw& w) -{ - w.DrawRect(GetSize(), White()); - String text = "αβγδ АБГД 吗嗎 弒"; - for(int i = 0; i < 30; i++) { - Font fnt(i, 16); - w.DrawText(0, i * 20, fnt.GetFaceName() + " " + text, fnt); - } -} - GUI_APP_MAIN { + ArrayCtrl list; + list.SetLineCy(30); + list.AddColumn("Font").Sorting(); + list.AddColumn("Monospace").Sorting(); + list.AddColumn("Serif").Sorting(); + list.AddColumn("Script").Sorting(); + list.AddColumn("Sample").Sorting(); + list.ColumnWidths("122 79 62 66 1084"); for(int i = 0; i < Font::GetFaceCount(); i++) { - Font fnt(i, 10); - LOG(fnt.GetFaceName() << " " << (fnt.IsSerif() ? "[serif] " : "") - << (fnt.IsScript() ? "[script] " : "")); + Font fnt(i, 20); + list.Add(fnt.GetFaceName(), + fnt.IsFixedPitch() ? "Yes" : "", + fnt.IsSerif() ? "Yes" : "", + fnt.IsScript() ? "Yes" : "", + AttrText("Hello αβγδ АБГД 吗嗎 弒").SetFont(fnt)); } - MyApp().Run(); + TopWindow win; + win.Add(list.SizePos()); + win.Run(); }