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;
This file contains the base IControl implementation, along with some base classes for specific types ...
The lowest level base class of an IGraphics control.
The lowest level base class of an IGraphics context.
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.
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.
Control to display the size of a region.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
Used to manage a rectangular area, independent of draw class/platform.
IText is used to manage font and text/text entry style for a piece of text on the UI,...