mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
Rainbow: WinGL..
git-svn-id: svn://ultimatepp.org/upp/trunk@3596 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f1001615b9
commit
c095ed37da
26 changed files with 2995 additions and 64 deletions
11
rainbow/PaintGl/PaintGl.upp
Normal file
11
rainbow/PaintGl/PaintGl.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
uses
|
||||
CtrlLib,
|
||||
Painter,
|
||||
WinGl;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI WINGL";
|
||||
|
||||
6
rainbow/PaintGl/init
Normal file
6
rainbow/PaintGl/init
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _PaintGl_icpp_init_stub
|
||||
#define _PaintGl_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#include "Painter/init"
|
||||
#include "WinGl/init"
|
||||
#endif
|
||||
78
rainbow/PaintGl/main.cpp
Normal file
78
rainbow/PaintGl/main.cpp
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
#include <RichEdit/RichEdit.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct App : public Ctrl {
|
||||
EditString x;
|
||||
ArrayCtrl a, b;
|
||||
DropList dl;
|
||||
|
||||
StaticRect popup;
|
||||
|
||||
void Paint(Draw& w)
|
||||
{
|
||||
Size sz = GetSize();
|
||||
DDUMP(sz);
|
||||
w.DrawRect(0, 0, sz.cx, sz.cy, SWhite);
|
||||
w.DrawRect(10, 10, 30, 30, SRed);
|
||||
w.DrawLine(45, 45, 80, 120, 4, Blue);
|
||||
w.DrawLine(80, 90, 400, 0, PEN_DASHDOT);
|
||||
w.DrawEllipse(200, 200, 50, 100, Green);
|
||||
w.DrawImage(200, 10, CtrlImg::HandCursor());
|
||||
const char *text = "This text is centered";
|
||||
Size tsz = GetTextSize(text, Arial(25).Bold());
|
||||
w.DrawText((sz.cx - tsz.cx) / 2, (sz.cy - tsz.cy) / 2, text, Arial(27).Bold(), SBlue);
|
||||
w.Clipoff(200, 50, 95, 100);
|
||||
w.DrawText(0, 80, "CLIPPED", Roman(25));
|
||||
w.End();
|
||||
}
|
||||
|
||||
void LeftDown(Point p, dword)
|
||||
{
|
||||
popup.SetRect(p.x, p.y, 100, 400);
|
||||
}
|
||||
|
||||
void InitArray(ArrayCtrl& a)
|
||||
{
|
||||
a.AddColumn("first");
|
||||
a.AddColumn("second");
|
||||
for(int i = 0; i < 100; i++)
|
||||
a.Add(i, FormatIntRoman(i));
|
||||
}
|
||||
|
||||
App()
|
||||
{
|
||||
x <<= "Hello world!";
|
||||
Add(x.LeftPos(100, 100).TopPos(500, 20));
|
||||
Add(a.LeftPos(300, 150).TopPos(10, 300));
|
||||
InitArray(a);
|
||||
InitArray(b);
|
||||
popup.SetFrame(BlackFrame());
|
||||
popup.Add(b.HSizePos(10, 10).VSizePos(10, 10));
|
||||
popup.SetRect(800, 100, 100, 400);
|
||||
|
||||
Add(dl.LeftPos(10, 300).TopPos(10, 30));
|
||||
for(int i = 0; i < 100; i++)
|
||||
dl.Add(i);
|
||||
// Sizeable();
|
||||
}
|
||||
};
|
||||
|
||||
#define EDITOR 0
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
#if EDITOR
|
||||
RichEditWithToolBar app;
|
||||
#else
|
||||
App app;
|
||||
#endif
|
||||
ChStdSkin();
|
||||
Ctrl::SetDesktop(app);
|
||||
app.SetFocus();
|
||||
#if !EDITOR
|
||||
app.popup.PopUp();
|
||||
#endif
|
||||
Ctrl::EventLoop();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue