24 static const int size = 36;
31 mDblAsSingleClick =
true;
38 IRECT drawRECT = mRECT;
39 const char* str =
"Some Text To Rotate";
40 mText.mAngle =
static_cast<float>(
GetValue()) * 360.f - 180.f;
44 g.
FillRect(COLOR_MID_GRAY, drawRECT);
73 IColor c = DEFAULT_TEXT_FGCOLOR;
74 const char* font =
"Roboto-Regular";
76 mText =
IText(size, c, font, EAlign::Near, EVAlign::Top);
78 mText =
IText(size, c, font, EAlign::Center, EVAlign::Top);
80 mText =
IText(size, c, font, EAlign::Far, EVAlign::Top);
82 mText =
IText(size, c, font, EAlign::Near, EVAlign::Middle);
84 mText =
IText(size, c, font, EAlign::Center, EVAlign::Middle);
86 mText =
IText(size, c, font, EAlign::Far, EVAlign::Middle);
88 mText =
IText(size, c, font, EAlign::Near, EVAlign::Bottom);
90 mText =
IText(size, c, font, EAlign::Center, EVAlign::Bottom);
92 mText =
IText(size, c, font, EAlign::Far, EVAlign::Bottom);
Used to manage a rectangular area, independent of draw class/platform.
Used to manage mouse modifiers i.e.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void SetTooltip(const char *str)
Set a tooltip for the control.
Used to manage color data, independent of draw class/platform.
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.
Control to test drawing text with orientation.
This file contains the base IControl implementation, along with some base classes for specific types ...
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
IText is used to manage font and text/text entry style for a piece of text on the UI...
The lowest level base class of an IGraphics context.
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
A base class for knob/dial controls, to handle mouse action and Sender.
double GetValue(int valIdx=0) const
Get the control's value.
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod) override
Implement this method to respond to a mouse drag event on this control.
virtual void SetValue(double value, int valIdx=0)
Set one of the control's values.
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod) override
Implement this method to respond to a mouse drag event on this control.
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.