mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.upptst
git-svn-id: svn://ultimatepp.org/upp/trunk@12309 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
276b7bc45b
commit
6ef24bc50d
7 changed files with 121 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
9
upptst/ImageViewDraw/ImageViewDraw.upp
Normal file
9
upptst/ImageViewDraw/ImageViewDraw.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
33
upptst/ImageViewDraw/main.cpp
Normal file
33
upptst/ImageViewDraw/main.cpp
Normal 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();
|
||||
}
|
||||
9
upptst/MultiButton/MultiButton.upp
Normal file
9
upptst/MultiButton/MultiButton.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
49
upptst/MultiButton/main.cpp
Normal file
49
upptst/MultiButton/main.cpp
Normal 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();
|
||||
}
|
||||
9
upptst/PromptImage/PromptImage.upp
Normal file
9
upptst/PromptImage/PromptImage.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
11
upptst/PromptImage/main.cpp
Normal file
11
upptst/PromptImage/main.cpp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
Exclamation("Exclamation");
|
||||
PromptOK("PromptOK");
|
||||
PromptOKCancel("PromptOKCancel");
|
||||
ErrorOK("ErrorOK");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue