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);
This file contains the base IControl implementation, along with some base classes for specific types ...
IControl * SetTooltip(const char *str)
Set a tooltip for the control.
virtual void SetValue(double value, int valIdx=0)
Set one of the control's values.
double GetValue(int valIdx=0) const
Get the control's value.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
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 FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
A base class for knob/dial controls, to handle mouse action and Sender.
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.
Control to test drawing text with orientation.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
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.
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
Used to manage color data, independent of draw class/platform.
Used to manage mouse modifiers i.e.
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,...