git-svn-id: svn://ultimatepp.org/upp/trunk@12309 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2018-09-27 08:38:14 +00:00
parent 276b7bc45b
commit 6ef24bc50d
7 changed files with 121 additions and 1 deletions

View file

@ -22,7 +22,7 @@ struct MyApp : TopWindow {
int width = fnt[ch];
w.DrawRect(x, y, width - 1, fnt.GetAscent(), Color(255, 255, 200));
w.DrawRect(x, y + fnt.GetAscent(), width - 1, fnt.GetDescent(), Color(255, 200, 255));
w.DrawRect(x + width - 1, y, 1, fnt.GetHeight(), Black());
w.DrawRect(x + width - 1, y, 1, fnt.GetCy(), Black());
w.DrawText(x, y, WString(ch, 1), fnt);
x += width;
}

View file

@ -0,0 +1,9 @@
uses
CtrlLib;
file
main.cpp;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,33 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
Image img;
struct MyApp : TopWindow
{
void Paint(Draw& w) override {
w.DrawRect(GetSize(), LtGray());
w.DrawImage(0, 0, img);
w.DrawRect(DPI(400) - DPI(5), DPI(40) - DPI(5), DPI(210), DPI(90), Red());
}
void LeftDown(Point, dword) override {
static int ii;
ViewDraw iw(this);
iw.DrawRect(DPI(400), DPI(40), DPI(200), DPI(80), LtBlue());
iw.DrawText(DPI(400), DPI(40), AsString(ii++), Arial(DPI(80)));
}
};
GUI_APP_MAIN
{
Size isz(DPI(200), DPI(200));
ImageDraw iw(isz);
iw.DrawRect(isz, White());
iw.DrawText(10, 10, "Hello world");
iw.DrawImage(10, 50, CtrlImg::exclamation());
img = iw;
MyApp().Run();
}

View file

@ -0,0 +1,9 @@
uses
CtrlLib;
file
main.cpp;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,49 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
TopWindow win;
int y = 0;
auto add = [&](Ctrl& c) {
y += 25;
win.Add(c.TopPos(y, Zx(16)).LeftPos(10, Zx(100)));
};
DropList a, b, c;
a.Add(1);
add(a);
b.Add(1);
b.AddButton().Left().SetLabel("1");
add(b);
c.Add(1);
c.AddButton().Left().SetLabel("1");
c.AddButton().Left().SetLabel("2");
c.AddButton().SetLabel("3");
add(c);
WithDropChoice<EditInt> aa, bb, cc;
aa.AddList(1);
add(aa);
bb.AddList(1);
bb.AddButton().Left().SetLabel("1");
add(bb);
cc.AddList(1);
cc.AddButton().Left().SetLabel("1");
cc.AddButton().Left().SetLabel("2");
cc.AddButton().SetLabel("3");
add(cc);
win.Run();
}

View file

@ -0,0 +1,9 @@
uses
CtrlLib;
file
main.cpp;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,11 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
Exclamation("Exclamation");
PromptOK("PromptOK");
PromptOKCancel("PromptOKCancel");
ErrorOK("ErrorOK");
}