diff --git a/upptst/CharMetrics/CharMetrics.upp b/upptst/CharMetrics/CharMetrics.upp new file mode 100644 index 000000000..f50db781f --- /dev/null +++ b/upptst/CharMetrics/CharMetrics.upp @@ -0,0 +1,11 @@ +description "Testing corectness of character metrics\377"; + +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/upptst/CharMetrics/main.cpp b/upptst/CharMetrics/main.cpp new file mode 100644 index 000000000..96cd7e589 --- /dev/null +++ b/upptst/CharMetrics/main.cpp @@ -0,0 +1,45 @@ +#include + +using namespace Upp; + +struct MyApp : TopWindow { + DropList fontlist; + + void Paint(Draw& w) { + w.DrawRect(GetSize(), White); + int y = 50; + for(int p = 32; p < 8192; p += 64) { + Font fnt(~fontlist, 30); + FontInfo fi = fnt.Info(); + int x = 0; + for(int ch = p; ch < p + 64; ch++) { + int width = fi[ch]; + w.DrawRect(x, y, width - 1, fi.GetAscent(), Color(255, 255, 200)); + w.DrawRect(x, y + fi.GetAscent(), width - 1, fi.GetDescent(), Color(255, 200, 255)); + w.DrawRect(x + width - 1, y, 1, fi.GetHeight(), Black()); + w.DrawText(x, y, WString(ch, 1), fnt); + x += width; + } + y += fi.GetHeight() + 20; + } + } + + void NewFont() { + Refresh(); + } + + typedef MyApp CLASSNAME; + + MyApp() { + for(int i = 0; i < Font::GetFaceCount(); i++) + fontlist.Add(i, Font::GetFaceName(i)); + Add(fontlist.TopPos(0, MINSIZE).LeftPosZ(0, 200)); + fontlist <<= 0; + fontlist <<= THISBACK(NewFont); + } +}; + +GUI_APP_MAIN +{ + MyApp().Sizeable().Run(); +} diff --git a/upptst/Clipboard/Clipboard.upp b/upptst/Clipboard/Clipboard.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/upptst/Clipboard/Clipboard.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/upptst/Clipboard/main.cpp b/upptst/Clipboard/main.cpp new file mode 100644 index 000000000..e49256e95 --- /dev/null +++ b/upptst/Clipboard/main.cpp @@ -0,0 +1,19 @@ +#include + +using namespace Upp; + +GUI_APP_MAIN +{ + Progress pi("%d"); + for(;;) { + if(pi.StepCanceled()) + break; + WString txt = AsString(Random()).ToWString(); + ClearClipboard(); + AppendClipboardText(txt.ToString()); + WriteClipboardUnicodeText(txt); + WString txt2 = ReadClipboardUnicodeText(); + DDUMP(txt2); + ASSERT(txt == txt2); + } +}