24 static const int size = 36;
28 :
IControl(bounds), mCount(-1), mFontCount(0), mStrCount(0)
31 mDblAsSingleClick =
true;
47 const char* str = mStrCount ?
"Quickly dog" :
"Font Test";
65 mFontCount = 1 - mFontCount;
68 mStrCount = 1 - mStrCount;
70 IColor c = DEFAULT_TEXT_FGCOLOR;
71 const char* font = mFontCount ?
"Roboto-Regular" :
"Alternative Font";
73 mText =
IText(size, c, font, EAlign::Near, EVAlign::Top);
75 mText =
IText(size, c, font, EAlign::Center, EVAlign::Top);
77 mText =
IText(size, c, font, EAlign::Far, EVAlign::Top);
79 mText =
IText(size, c, font, EAlign::Near, EVAlign::Middle);
81 mText =
IText(size, c, font, EAlign::Center, EVAlign::Middle);
83 mText =
IText(size, c, font, EAlign::Far, EVAlign::Middle);
85 mText =
IText(size, c, font, EAlign::Near, EVAlign::Bottom);
87 mText =
IText(size, c, font, EAlign::Center, EVAlign::Bottom);
89 mText =
IText(size, c, font, EAlign::Far, EVAlign::Bottom);
This file contains the base IControl implementation, along with some base classes for specific types ...
The lowest level base class of an IGraphics control.
IControl * SetTooltip(const char *str)
Set a tooltip for the control.
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.
Control to test drawing fonts.
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.
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.
IRECT GetFromBottom(float amount) const
Get a subrect of this IRECT bounded in Y by 'amount' and the bottom edge.
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.
IRECT GetFromTop(float amount) const
Get a subrect of this IRECT bounded in Y by the top edge and 'amount'.
IText is used to manage font and text/text entry style for a piece of text on the UI,...