36 float cr =
static_cast<float>(
GetValue()) * (mRECT.
H() / 2.f);
40 fillOptions.mPreserve =
true;
58 void RandomiseGradient()
64 if (std::rand() & 0x100)
69 tmp.mExtend = (std::rand() & 0x10) ? ((std::rand() & 0x1000) ? EPatternExtend::None : EPatternExtend::Pad) : ((std::rand() & 0x1000) ? EPatternExtend::Repeat : EPatternExtend::Reflect);
Used to manage a rectangular area, independent of draw class/platform.
Used to manage fill behaviour for path based drawing back ends.
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.
Control to test drawing gradients with path based drawing backends.
virtual void PathStroke(const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0
Stroke the current current path.
void SetTooltip(const char *str)
Set a tooltip for the control.
Used to manage color data, independent of draw class/platform.
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 stroke behaviour for path based drawing back ends.
This file contains the base IControl implementation, along with some base classes for specific types ...
static IPattern CreateRadialGradient(float x1, float y1, float r, const std::initializer_list< IColorStop > &stops={})
Create a radial gradient IPattern.
virtual void PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0
Fill the current current path.
The lowest level base class of an IGraphics context.
A base class for knob/dial controls, to handle mouse action and Sender.
void PathRoundRect(const IRECT &bounds, float ctl, float ctr, float cbl, float cbr)
Add a rounded rectangle to the current path, with independent corner roundness.
static IColor GetRandomColor(bool randomAlpha=false)
Get a random IColor.
double GetValue(int valIdx=0) const
Get the control's value.
float L
Left side of the rectangle (X)
static IPattern CreateLinearGradient(float x1, float y1, float x2, float y2, const std::initializer_list< IColorStop > &stops={})
Create a linear gradient IPattern.
IRECT GetPadded(float padding) const
Get a copy of this IRECT with each value padded by padding N.B.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Used to store pattern information for gradients.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.