36 const float value =
static_cast<float>(
GetValue());
38 float r0 = value * (mRECT.
H() / 2.f);
39 float l = mRECT.L + mRECT.
W() * 0.1f;
40 float r = mRECT.L + mRECT.
W() * 0.9f;
41 float t = mRECT.T + mRECT.
H() * 0.1f;
42 float b = mRECT.T + mRECT.
H() * 0.9f;
43 float l0 = mRECT.L + mRECT.
W() * 0.2f;
44 float t0 = mRECT.T + mRECT.
H() * 0.3f;
45 float b0 = mRECT.T + mRECT.
H() * 0.7f;
46 float mx = mRECT.L + mRECT.
W() * 0.43f;
47 float my = mRECT.
MH();
56 float pad1 = (mRECT.
W() / 2.f) * (1.f - value);
57 float pad2 = (mRECT.
H() / 2.f) * (1.f - value);
59 pad1 = (size1.
W() / 2.f) * (1.f - value);
60 pad2 = (size1.
H() / 2.f) * (1.f - value);
67 float pad1 = (mRECT.
W() / 2.f) * (1.f - value);
68 float pad2 = (mRECT.
H() / 2.f) * (1.f - value);
70 pad1 = (size1.
W() / 2.f) * (1.f - value);
71 pad2 = (size1.
H() / 2.f) * (1.f - value);
79 g.
PathCubicBezierTo(mRECT.L + mRECT.
W() * 0.125f, mRECT.T + mRECT.
H() * 0.725f, mRECT.L + mRECT.
W() * 0.25f, mRECT.T + mRECT.
H() * 0.35f, mRECT.
MW(), mRECT.
MH());
105 else if (mShape == 6)
118 else if (mShape == 7)
131 else if (mShape == 8)
133 float centerX = mRECT.
MW();
134 float centerY = mRECT.
MH();
135 float radius = mRECT.
W() * 0.25f;
136 float width = radius * 0.75f;
137 float startAngle = -90.0f;
138 float endAngle = +90.0f;
140 g.
PathArc(centerX, centerY, radius - width * 0.5f, startAngle, endAngle);
141 g.
PathArc(centerX, centerY, radius + width * 0.5f, endAngle, startAngle, EWinding::CCW);
146 float centerX = mRECT.
MW();
147 float centerY = mRECT.
MH();
148 float radius = mRECT.
W() * 0.25f;
149 float width = radius * 0.75f;
150 float startAngle = -90.0f;
151 float endAngle = +90.0f;
153 g.
PathArc(centerX, centerY, radius - width * 0.5f, startAngle, endAngle);
154 g.
PathArc(centerX, centerY, radius + width * 0.5f, endAngle, startAngle, EWinding::CW);
159 fillOptions.mFillRule = value > 0.5 ? EFillRule::EvenOdd : EFillRule::Winding;
160 fillOptions.mPreserve =
true;
162 float dashes[] = { 11, 4, 7 };
163 strokeOptions.mDash.SetDash(dashes, 0.0, 2);
164 g.
PathFill(COLOR_BLACK, fillOptions);
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.
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.
virtual void PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0
Fill the current current path.
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.
virtual void PathClose()=0
Close the path that is being specified.
void PathRect(const IRECT &bounds)
Add a rectangle to the current path.
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.
virtual void PathStroke(const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0
Stroke the current current path.
void PathCircle(float cx, float cy, float r)
Add a circle to the current path.
virtual void PathMoveTo(float x, float y)=0
Move the current point in the current path.
virtual void PathArc(float cx, float cy, float r, float a1, float a2, EWinding winding=EWinding::CW)=0
Add an arc to the current path.
virtual void PathLineTo(float x, float y)=0
Add a line to the current path from the current point to the specified location.
virtual void PathCubicBezierTo(float c1x, float c1y, float c2x, float c2y, float x2, float y2)=0
Add a cubic bezier to the current path from the current point to the specified location.
A base class for knob/dial controls, to handle mouse action and Sender.
Control to test drawing paths in path-based drawing backends.
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 stroke behaviour for path based drawing back ends.
Used to manage fill behaviour.
Used to manage mouse modifiers i.e.
Used to manage a rectangular area, independent of draw class/platform.
IRECT GetPadded(float padding) const
Get a copy of this IRECT with each value padded by padding N.B.