mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
GLCtrl: Added associated usc file.
This commit is contained in:
parent
8d25d929d5
commit
764629e849
3 changed files with 28 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
26
uppsrc/GLCtrl/GLCtrl.usc
Normal 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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue