35 g.
DrawText(mText, GetCursorStr(mCursor), mRECT);
42 if (mCursor > static_cast<int>(ECursor::HELP))
59 const char* GetCursorStr(
int cursor)
62 return "Click to set cursor";
64 switch (static_cast<ECursor>(cursor))
66 case ECursor::ARROW:
return "arrow";
67 case ECursor::IBEAM:
return "ibeam";
68 case ECursor::WAIT:
return "wait";
69 case ECursor::CROSS:
return "cross";
70 case ECursor::UPARROW:
return "up arrow";
71 case ECursor::SIZENWSE:
return "size NW-SE";
72 case ECursor::SIZENESW:
return "size NE-SW";
73 case ECursor::SIZEWE:
return "size WE";
74 case ECursor::SIZENS:
return "size NS";
75 case ECursor::SIZEALL:
return "size all";
76 case ECursor::INO:
return "no";
77 case ECursor::HAND:
return "hand";
78 case ECursor::APPSTARTING:
return "app starting";
79 case ECursor::HELP:
return "help";
The lowest level base class of an IGraphics control.
Used to manage a rectangular area, independent of draw class/platform.
virtual ECursor SetMouseCursor(ECursor cursorType=ECursor::ARROW)
Sets the mouse cursor to one of ECursor (implementations should return the result of the base impleme...
virtual void DrawDottedRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted rectangle to the graphics context.
Used to manage mouse modifiers i.e.
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
Control to test changing the platform cursor.
void SetTooltip(const char *str)
Set a tooltip for the control.
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 ...
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
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.
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 OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
virtual void OnMouseOut()
Implement this method to respond to a mouseout event on this control.