29 mText =
IText(15, COLOR_BLACK,
nullptr, EAlign::Near);
34 g.
DrawLine(COLOR_BLACK, 10, 0, 10, mRECT.
B);
35 g.
DrawLine(COLOR_BLACK, 0, mRECT.
B-10, mRECT.
R, mRECT.
B-10);
36 g.
DrawText(mText, mWidthStr.Get(), mRECT.
L + 15, mRECT.
T + 5);
37 g.
DrawText(mText, mHeightStr.Get(), mRECT.
R - 40, mRECT.
B - 20);
38 g.
DrawText(mText, mScaleStr.Get(), mRECT.
L + 15, mRECT.
B - 20);
47 mWidthStr.SetFormatted(32,
"%i px", (
int) mRECT.
W());
48 mHeightStr.SetFormatted(32,
"%i px", (
int) mRECT.
H());
49 mScaleStr.SetFormatted(64,
"width %i, height %i, scale %0.2f",
GetUI()->WindowWidth(),
GetUI()->WindowHeight(),
GetUI()->GetDrawScale());
54 WDL_String mHeightStr;
The lowest level base class of an IGraphics control.
Used to manage a rectangular area, independent of draw class/platform.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Control to display the size of a region.
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
This file contains the base IControl implementation, along with some base classes for specific types ...
float R
Right side of the rectangle (X + W)
IText is used to manage font and text/text entry style for a piece of text on the UI...
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
The lowest level base class of an IGraphics context.
float L
Left side of the rectangle (X)
void OnResize() override
Called when IControl is constructed or resized using SetRect().
virtual void DrawLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f)
Draw a line to the graphics context.
float T
Top of the rectangle (Y)
float B
Bottom of the rectangle (Y + H)