GLCtrl: Added associated usc file.

This commit is contained in:
Zbigniew Rębacz 2025-07-05 22:00:48 +02:00
parent 8d25d929d5
commit 764629e849
3 changed files with 28 additions and 2 deletions

View file

@ -39,8 +39,6 @@ void InitializeGlew();
class GLCtrl : public Ctrl {
typedef GLCtrl CLASSNAME;
public:
Image MouseEvent(int event, Point p, int zdelta, dword keyflags) override;
#ifdef PLATFORM_POSIX

View file

@ -13,6 +13,8 @@ file
Win32GLCtrl.cpp,
XGLCtrl.cpp,
GLCtrl.cpp,
Meta readonly separator,
GLCtrl.usc,
Info readonly separator,
src.tpp,
Copying;

26
uppsrc/GLCtrl/GLCtrl.usc Normal file
View file

@ -0,0 +1,26 @@
namespace Upp;
ctrl GLCtrl {
group "Graphics";
GetStdSize() { return Size(170, 130); }
Frame SetFrame = default;
Paint(w)
{
r = GetRect();
w.DrawRect(r, :SBlack);
font = Arial(12);
tn = GetTextSize("3D");
if (r.right >= 130 && r.bottom >= 130) {
w.DrawText(r.left + 10, r.top + 10, "OpenGL", font, :SWhite);
w.DrawText(r.right - 10 - tn.cx, r.top + 10, "3D", font, :SWhite);
}
poffset = 20;
w.DrawLine(r.left + poffset, r.bottom - poffset, r.right / 2, r.top + tn.cy, 3, :SWhite);
w.DrawLine(r.right - poffset, r.bottom - poffset, r.right / 2, r.top + tn.cy, 3, :SWhite);
w.DrawLine(r.left + poffset, r.bottom - poffset, r.right - poffset, r.bottom - poffset, 3, :SWhite);
}
}