21 BEGIN_IGRAPHICS_NAMESPACE
32 , mInitialGraphicsBounds(graphicsBounds)
34 , mMouseOverColor(mouseOverColour)
35 , mDragColor(dragColor)
48 GetUI()->StartDragResize();
53 GetUI()->
Resize(static_cast<int>(mInitialGraphicsBounds.
W()), static_cast<int>(mInitialGraphicsBounds.
H()), 1.f);
80 bool mMouseOver =
false;
81 ECursor mPrevCursorType = ECursor::ARROW;
82 IRECT mInitialGraphicsBounds;
83 IColor mColor, mMouseOverColor, mDragColor;
86 END_IGRAPHICS_NAMESPACE
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
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...
Used to manage mouse modifiers i.e.
void OnMouseOver(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouseover event on this control.
Used to manage color data, independent of draw class/platform.
This file contains the base IControl implementation, along with some base classes for specific types ...
float R
Right side of the rectangle (X + W)
void OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
float GetDrawScale() const
Gets the graphics context scaling factor.
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
bool GetMouseIsOver() const
This can be used in IControl::Draw() to check if the mouse is over the control, without implementing ...
The lowest level base class of an IGraphics context.
virtual void OnMouseOver(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouseover event on this control.
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
A control for resizing the plug-in window by clicking and dragging in the bottom right-hand corner Th...
void Resize(int w, int h, float scale, bool needsPlatformResize=true)
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void SetTargetAndDrawRECTs(const IRECT &bounds)
Set BOTH the draw rect and the target area, within the graphics context for this control.
float L
Left side of the rectangle (X)
void OnMouseDblClick(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse double click event on this control.
IRECT GetPadded(float padding) const
Get a copy of this IRECT with each value padded by padding N.B.
IRECT GetFromBRHC(float w, float h) const
Get a subrect of this IRECT expanding from the bottom-right corner.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
float T
Top of the rectangle (Y)
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
float B
Bottom of the rectangle (Y + H)
virtual void OnMouseOut()
Implement this method to respond to a mouseout event on this control.