iPlug2 - C++ Audio Plug-in Framework
|
A base interface to be combined with IControl for vectorial controls "IVControls", in order for them to share a common style If you need more flexibility, you're on your own! More...
#include <IControl.h>
Public Member Functions | |
IVectorBase (const IVStyle &style, bool labelInWidget=false, bool valueInWidget=false) | |
IVectorBase Constructor. More... | |
void | AttachIControl (IControl *pControl, const char *label) |
Call in the constructor of your IVControl to link the IVectorBase and IControl. More... | |
virtual void | OnStyleChanged () |
Implement if extra changes are required in response to style changing. More... | |
void | SetColor (EVColor colorIdx, const IColor &color) |
Set one of the IVColors that style the IVControl. More... | |
void | SetColors (const IVColorSpec &spec) |
Set the colors of this IVControl. More... | |
const IColor & | GetColor (EVColor color) const |
Get value of a specific EVColor in the IVControl. More... | |
void | SetLabelStr (const char *label) |
const char * | GetLabelStr () const |
void | SetValueStr (const char *value) |
void | SetWidgetFrac (float frac) |
void | SetAngle (float angle) |
void | SetShowLabel (bool show) |
void | SetShowValue (bool show) |
void | SetRoundness (float roundness) |
void | SetDrawFrame (bool draw) |
void | SetDrawShadows (bool draw) |
void | SetEmboss (bool draw) |
void | SetShadowOffset (float offset) |
void | SetFrameThickness (float thickness) |
void | SetSplashRadius (float radius) |
void | SetSplashPoint (float x, float y) |
void | SetShape (EVShape shape) |
virtual void | SetStyle (const IVStyle &style) |
Set the Style of this IVControl. More... | |
IVStyle | GetStyle () const |
Get the style of this IVControl. More... | |
IRECT | GetAdjustedHandleBounds (IRECT handleBounds) const |
Get the adjusted bounds for the widget handle, based on the style settings. More... | |
float | GetRoundedCornerRadius (const IRECT &bounds) const |
Get the radius of rounded corners for a rectangle, based on the style roundness factor. More... | |
IRECT | GetWidgetBounds () const |
IRECT | GetLabelBounds () const |
IRECT | GetValueBounds () const |
void | DrawSplash (IGraphics &g, const IRECT &clipRegion=IRECT()) |
Draw a splash effect when a widget handle is clicked (via SplashClickAnimationFunc) More... | |
virtual void | DrawBackground (IGraphics &g, const IRECT &rect) |
Draw the IVControl background (usually transparent) More... | |
virtual void | DrawWidget (IGraphics &g) |
Draw the IVControl main widget (override) More... | |
virtual void | DrawLabel (IGraphics &g) |
Draw the IVControl label text. More... | |
virtual void | DrawValue (IGraphics &g, bool mouseOver) |
Draw the IVControl value text. More... | |
virtual void | DrawPressableShape (IGraphics &g, EVShape shape, const IRECT &bounds, bool pressed, bool mouseOver, bool disabled) |
Call one of the DrawPressableShape methods. More... | |
void | DrawPressableEllipse (IGraphics &g, const IRECT &bounds, bool pressed, bool mouseOver, bool disabled) |
Draw an ellipse-shaped vector button. More... | |
IRECT | DrawPressableRectangle (IGraphics &g, const IRECT &bounds, bool pressed, bool mouseOver, bool disabled, bool rtl=true, bool rtr=true, bool rbl=true, bool rbr=true) |
Draw a rectangle-shaped vector button. More... | |
IRECT | DrawPressableTriangle (IGraphics &g, const IRECT &bounds, bool pressed, bool mouseOver, float angle, bool disabled) |
Draw a triangle-shaped vector button. More... | |
IRECT | MakeRects (const IRECT &parent, bool hasHandle=false) |
Calculate the rectangles for the various areas, depending on the style. More... | |
Protected Attributes | |
IControl * | mControl = nullptr |
IVStyle | mStyle |
bool | mLabelInWidget = false |
bool | mValueInWidget = false |
float | mSplashRadius = 0.f |
IVec2 | mSplashPoint = {0.f, 0.f} |
float | mMaxSplashRadius = 50.f |
float | mTrackSize = 2.f |
float | mValueDisplayFrac = 0.66f |
IRECT | mWidgetBounds |
IRECT | mLabelBounds |
IRECT | mValueBounds |
WDL_String | mLabelStr |
WDL_String | mValueStr |
EVShape | mShape = EVShape::Rectangle |
A base interface to be combined with IControl for vectorial controls "IVControls", in order for them to share a common style If you need more flexibility, you're on your own!
Definition at line 761 of file IControl.h.
|
inline |
IVectorBase Constructor.
style | the IVStyle for this control |
labelInWidget | Set true If the label should be drawn inside the widget bounds |
valueInWidget | Set true If the value should be drawn inside the widget bounds |
Definition at line 768 of file IControl.h.
References SetStyle().
|
inlinevirtual |
Definition at line 775 of file IControl.h.
|
inline |
Call in the constructor of your IVControl to link the IVectorBase and IControl.
pControl | Ptr to the control |
label | CString for the IVControl label |
Definition at line 780 of file IControl.h.
Referenced by IVButtonControl::IVButtonControl(), IVGroupControl::IVGroupControl(), IVMenuButtonControl::IVMenuButtonControl(), IVPlotControl::IVPlotControl(), IVScopeControl< MAXNC, MAXBUF >::IVScopeControl(), and IVTabSwitchControl::IVTabSwitchControl().
Draw the IVControl background (usually transparent)
Reimplemented in IVTrackControlBase.
Definition at line 881 of file IControl.h.
References IGraphics::FillRect(), IControl::GetBlend(), and GetColor().
Referenced by IVLabelControl::Draw(), IVButtonControl::Draw(), IVSwitchControl::Draw(), IVSlideSwitchControl::Draw(), IVTabSwitchControl::Draw(), IVKnobControl::Draw(), IVSliderControl::Draw(), IVXYPadControl::Draw(), IVPlotControl::Draw(), IVPanelControl::Draw(), IVDisplayControl::Draw(), IVScopeControl< MAXNC, MAXBUF >::Draw(), and IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::Draw().
|
inlinevirtual |
Draw the IVControl label text.
Definition at line 894 of file IControl.h.
References IGraphics::DrawText(), IControl::GetBlend(), and IRECT::H().
Referenced by IVButtonControl::Draw(), IVSwitchControl::Draw(), IVSlideSwitchControl::Draw(), IVTabSwitchControl::Draw(), IVKnobControl::Draw(), IVSliderControl::Draw(), IVRangeSliderControl::Draw(), IVXYPadControl::Draw(), IVPlotControl::Draw(), IVGroupControl::Draw(), IVPanelControl::Draw(), IVColorSwatchControl::Draw(), IVDisplayControl::Draw(), IVMeterControl< MAXNC >::Draw(), IVMultiSliderControl< MAXNC >::Draw(), IVNumberBoxControl::Draw(), IVBakedPresetManagerControl::Draw(), IVDiskPresetManagerControl::Draw(), IVScopeControl< MAXNC, MAXBUF >::Draw(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::Draw(), and IVTabbedPagesControl::Draw().
|
inline |
Draw an ellipse-shaped vector button.
g | The IGraphics context |
bounds | The bounds in which to draw the shape |
pressed | /c true if shape is pressed |
mouseOver | /c true if the mouse is over the bounds |
disabled | /c true if the shape should be drawn disabled |
Definition at line 953 of file IControl.h.
References IGraphics::DrawEllipse(), DrawSplash(), IGraphics::FillEllipse(), IControl::GetAnimationFunction(), IControl::GetBlend(), GetColor(), IRECT::GetPadded(), IRECT::GetTranslated(), IRECT::ReduceFromBottom(), and IRECT::ReduceFromRight().
Referenced by DrawPressableShape().
|
inline |
Draw a rectangle-shaped vector button.
g | The IGraphics context |
bounds | The bounds in which to draw the shape |
pressed | /c true if shape is pressed |
mouseOver | /c true if the mouse is over the bounds |
disabled | /c true if the shape should be drawn disabled |
Definition at line 1025 of file IControl.h.
References IGraphics::DrawRoundRect(), DrawSplash(), IGraphics::FillRoundRect(), GetAdjustedHandleBounds(), IControl::GetAnimationFunction(), IControl::GetBlend(), GetColor(), IRECT::GetPadded(), GetRoundedCornerRadius(), IRECT::GetTranslated(), IRECT::ReduceFromBottom(), and IRECT::ReduceFromRight().
Referenced by DrawPressableShape(), and IVPanelControl::DrawWidget().
|
inlinevirtual |
Call one of the DrawPressableShape methods.
g | The IGraphics context |
shape | The shape to draw |
bounds | The bounds in which to draw the shape |
pressed | /c true if shape is pressed |
mouseOver | /c true if the mouse is over the bounds |
disabled | /c true if the shape should be drawn disabled |
Definition at line 923 of file IControl.h.
References DrawPressableEllipse(), DrawPressableRectangle(), and DrawPressableTriangle().
Referenced by IVButtonControl::DrawWidget(), IVSwitchControl::DrawWidget(), and IVToggleControl::DrawWidget().
|
inline |
Draw a triangle-shaped vector button.
g | The IGraphics context used for drawing |
bounds | Where to draw the button |
pressed | Whether to draw the button pressed or unpressed |
mouseOver | Whether mouse is currently hovering on control |
Definition at line 1108 of file IControl.h.
References DrawSplash(), IGraphics::DrawTriangle(), IGraphics::FillTriangle(), GetAdjustedHandleBounds(), IControl::GetAnimationFunction(), IControl::GetBlend(), GetColor(), IRECT::GetTranslated(), IRECT::H(), IRECT::MW(), and IRECT::W().
Referenced by DrawPressableShape().
Draw a splash effect when a widget handle is clicked (via SplashClickAnimationFunc)
g | The graphics context |
clipRegion | Optional clip region for the splash |
Definition at line 873 of file IControl.h.
References IGraphics::FillCircle(), GetColor(), and IGraphics::PathClipRegion().
Referenced by DrawPressableEllipse(), DrawPressableRectangle(), and DrawPressableTriangle().
|
inlinevirtual |
Draw the IVControl value text.
Reimplemented in IVToggleControl.
Definition at line 904 of file IControl.h.
References IGraphics::DrawText(), IGraphics::FillRect(), and IControl::GetBlend().
Referenced by IVButtonControl::Draw(), IVSwitchControl::Draw(), IVSlideSwitchControl::Draw(), IVKnobControl::Draw(), IVSliderControl::Draw(), and IVPanelControl::Draw().
|
inlinevirtual |
Draw the IVControl main widget (override)
Reimplemented in IVButtonControl, IVSwitchControl, IVToggleControl, IVSlideSwitchControl, IVTabSwitchControl, IVRadioButtonControl, IVKnobControl, IVSliderControl, IVRangeSliderControl, IVXYPadControl, IVGroupControl, IVPanelControl, IVColorSwatchControl, IVDisplayControl, IVScopeControl< MAXNC, MAXBUF >, and IVTrackControlBase.
Definition at line 888 of file IControl.h.
Get the adjusted bounds for the widget handle, based on the style settings.
handleBounds | The initial bounds |
Definition at line 844 of file IControl.h.
References IRECT::Offset(), and IRECT::Pad().
Referenced by DrawPressableRectangle(), DrawPressableTriangle(), and MakeRects().
|
inline |
Get value of a specific EVColor in the IVControl.
Definition at line 806 of file IControl.h.
References IVColorSpec::GetColor().
Referenced by IVLabelControl::Draw(), IVXYPadControl::Draw(), IVPlotControl::Draw(), IFPSDisplayControl::Draw(), IVDisplayControl::Draw(), IVMeterControl< MAXNC >::Draw(), IVMultiSliderControl< MAXNC >::Draw(), IVNumberBoxControl::Draw(), IVScopeControl< MAXNC, MAXBUF >::Draw(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::Draw(), IVTabbedPagesControl::Draw(), IVTrackControlBase::DrawBackground(), DrawBackground(), DrawPressableEllipse(), DrawPressableRectangle(), DrawPressableTriangle(), DrawSplash(), IVTrackControlBase::DrawTrackHandle(), IVToggleControl::DrawValue(), IVRadioButtonControl::DrawWidget(), IVRangeSliderControl::DrawWidget(), IVGroupControl::DrawWidget(), IVColorSwatchControl::DrawWidget(), IVDisplayControl::DrawWidget(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), and IVColorSwatchControl::OnMouseDown().
|
inline |
Definition at line 867 of file IControl.h.
|
inline |
Definition at line 812 of file IControl.h.
|
inline |
Get the radius of rounded corners for a rectangle, based on the style roundness factor.
bounds | The rectangle |
Definition at line 858 of file IControl.h.
References IRECT::H(), and IRECT::W().
Referenced by IVTabbedPagesControl::Draw(), DrawPressableRectangle(), IVGroupControl::DrawWidget(), and IVGroupControl::OnResize().
|
inline |
Get the style of this IVControl.
Definition at line 839 of file IControl.h.
Referenced by IVTabbedPagesControl::OnAttached(), and IVTabbedPagesControl::OnStyleChanged().
|
inline |
Definition at line 868 of file IControl.h.
|
inline |
Definition at line 866 of file IControl.h.
Calculate the rectangles for the various areas, depending on the style.
parent | The parent rectangle to divide up |
hasHandle | Set /c true for a button control to adjust for pressing |
Definition at line 1163 of file IControl.h.
References IRECT::Empty(), GetAdjustedHandleBounds(), IRECT::GetCentredInside(), IRECT::GetFromBottom(), IRECT::GetFromLeft(), IRECT::GetFromRight(), IRECT::GetFromTop(), IRECT::GetMidHPadded(), IRECT::GetMidVPadded(), IRECT::GetReducedFromBottom(), IRECT::GetReducedFromLeft(), IRECT::GetReducedFromRight(), IRECT::GetReducedFromTop(), IRECT::GetScaledAboutCentre(), IControl::GetUI(), IRECT::H(), IGraphics::MeasureText(), and IRECT::W().
Referenced by IVButtonControl::OnResize(), IVSwitchControl::OnResize(), IVTabSwitchControl::OnResize(), IVKnobControl::OnResize(), IVSliderControl::OnResize(), IVXYPadControl::OnResize(), IVPlotControl::OnResize(), IVGroupControl::OnResize(), IVPanelControl::OnResize(), IVColorSwatchControl::OnResize(), IVDisplayControl::OnResize(), IVNumberBoxControl::OnResize(), IVBakedPresetManagerControl::OnResize(), IVDiskPresetManagerControl::OnResize(), IVScopeControl< MAXNC, MAXBUF >::OnResize(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnResize(), IVTabbedPagesControl::OnResize(), and IVTrackControlBase::OnResize().
|
inlinevirtual |
Implement if extra changes are required in response to style changing.
Reimplemented in IVTabPage, and IVTabbedPagesControl.
Definition at line 787 of file IControl.h.
Referenced by SetStyle().
|
inline |
Definition at line 815 of file IControl.h.
|
inline |
Set one of the IVColors that style the IVControl.
colorIdx | The index of the color to set |
color | The new color |
Definition at line 792 of file IControl.h.
References IControl::SetDirty().
Referenced by IVColorSwatchControl::OnMouseDown().
|
inline |
Set the colors of this IVControl.
spec | The new color spec |
Definition at line 800 of file IControl.h.
Referenced by SetStyle().
|
inline |
Definition at line 819 of file IControl.h.
|
inline |
Definition at line 820 of file IControl.h.
|
inline |
Definition at line 821 of file IControl.h.
|
inline |
Definition at line 823 of file IControl.h.
|
inline |
Definition at line 811 of file IControl.h.
|
inline |
Definition at line 818 of file IControl.h.
|
inline |
Definition at line 822 of file IControl.h.
|
inline |
Definition at line 826 of file IControl.h.
|
inline |
Definition at line 816 of file IControl.h.
|
inline |
Definition at line 817 of file IControl.h.
|
inline |
Definition at line 825 of file IControl.h.
|
inline |
Definition at line 824 of file IControl.h.
|
inlinevirtual |
Set the Style of this IVControl.
style |
Reimplemented in IVMenuButtonControl, and IVNumberBoxControl.
Definition at line 830 of file IControl.h.
References OnStyleChanged(), and SetColors().
Referenced by IVectorBase(), IVTabbedPagesControl::OnStyleChanged(), IVMenuButtonControl::SetStyle(), IVNumberBoxControl::SetStyle(), and IGraphics::StyleAllVectorControls().
|
inline |
Definition at line 813 of file IControl.h.
|
inline |
Definition at line 814 of file IControl.h.
|
protected |
Definition at line 1260 of file IControl.h.
|
protected |
Definition at line 1270 of file IControl.h.
|
protected |
Definition at line 1262 of file IControl.h.
|
protected |
Definition at line 1272 of file IControl.h.
|
protected |
Definition at line 1266 of file IControl.h.
|
protected |
Definition at line 1274 of file IControl.h.
|
protected |
Definition at line 1265 of file IControl.h.
|
protected |
Definition at line 1264 of file IControl.h.
|
protected |
Definition at line 1261 of file IControl.h.
|
protected |
Definition at line 1267 of file IControl.h.
|
protected |
Definition at line 1271 of file IControl.h.
|
protected |
Definition at line 1268 of file IControl.h.
|
protected |
Definition at line 1263 of file IControl.h.
|
protected |
Definition at line 1273 of file IControl.h.
|
protected |
Definition at line 1269 of file IControl.h.