20BEGIN_IGRAPHICS_NAMESPACE
25 pCaller->OnEndAnimation();
35 pCaller->OnEndAnimation();
39 pCaller->
As<
IVectorBase>()->SetSplashRadius((
float) progress);
59 assert(pParam &&
"ShowBubbleHorizontalActionFunc requires a parameter");
63 pGraphics->ShowBubbleControl(pCaller, bounds.R, bounds.
MH(), display.Get(), EDirection::Horizontal,
IRECT(0, 0, 50, 30));
70 assert(pParam &&
"ShowBubbleVerticalActionFunc requires a parameter");
74 pGraphics->ShowBubbleControl(pCaller, bounds.
MW(), bounds.T, display.Get(), EDirection::Vertical,
IRECT(0, 0, 50, 30));
77END_IGRAPHICS_NAMESPACE
81using namespace igraphics;
88 mVals[0].idx = paramIdx;
97 for (
auto& paramIdx : params) {
98 mVals.push_back({paramIdx, 0.});
111 assert(valIdx > kNoValIdx && valIdx <
NVals());
112 return mVals[valIdx].idx;
117 assert(valIdx > kNoValIdx && valIdx <
NVals());
118 mVals.at(valIdx).idx = paramIdx;
126 if(paramIdx > kNoParameter)
127 return mDelegate->
GetParam(paramIdx);
134 const int nVals =
NVals();
136 for (
int v = 0; v < nVals; v++)
138 if(mVals[v].idx == paramIdx)
149 assert(valIdx > kNoValIdx && valIdx <
NVals());
150 mVals[valIdx].value = value;
155 assert(valIdx > kNoValIdx && valIdx <
NVals());
156 return mVals[valIdx].value;
164 if (!
GetUI()->ControlIsCaptured(
this))
185 valIdx = (
NVals() == 1) ? 0 : valIdx;
187 auto paramDefault = [
this](
int v)
200 valIdx = (
NVals() == 1) ? 0 : valIdx;
209 auto paramUpdate = [
this](
int v)
225void IControl::Animate()
228 mAnimationFunc(
this);
247 mBlend.mWeight = (disable ? GRAYED_ALPHA : 1.0f);
285 if (pSelectedMenu && valIdx > kNoValIdx &&
GetParamIdx(valIdx) > kNoParameter && !mDisablePrompt)
293 if (x < 0.f) x = 0.f;
294 if (y < 0.f) y = 0.f;
296 float tX = x + (mTargetRECT.L - mRECT.L);
297 float tY = y + (mTargetRECT.T - mRECT.T);
299 SetRECT({x, y, x + mRECT.
W(), y + mRECT.
H()});
305 if (w < 0.f) w = 0.f;
306 if (h < 0.f) h = 0.f;
313 mGestureFuncs.insert(std::make_pair(type, func));
322 auto itr = mGestureFuncs.find(info.type);
324 if(itr != mGestureFuncs.end())
326 mLastGesture = info.type;
327 itr->second(
this, info);
336 if (valIdx > kNoValIdx &&
GetParamIdx(valIdx) > kNoParameter && !mDisablePrompt)
338 if (
GetParam(valIdx)->NDisplayTexts())
344 float cX = mRECT.
MW();
345 float cY = mRECT.
MH();
346 float halfW = PARAM_EDIT_W/2.f;
347 float halfH = PARAM_EDIT_H/2.f;
349 IRECT txtRECT =
IRECT(cX - halfW, cY - halfH, cX + halfW,cY + halfH);
359 if (valIdx > kNoValIdx &&
GetParamIdx(valIdx) > kNoParameter && !mDisablePrompt)
370 mPTHighlightColor = COLOR_RED;
373 mPTHighlightColor = COLOR_BLUE;
376 mPTHighlightColor = COLOR_GREEN;
379 mPTHighlightColor = COLOR_YELLOW;
385 mPTisHighlighted = isHighlighted;
391 if (mPTisHighlighted)
393 g.
FillCircle(mPTHighlightColor, mTargetRECT.R-5, mTargetRECT.T+5, 2);
403 if(direction == EDirection::Vertical)
404 val = 1.f - (y-bounds.T) / bounds.
H();
406 val = (x-bounds.L) / bounds.
W();
408 auto valFunc = [&](
int valIdx) {
409 SetValue(
Clip(std::round(val / 0.001 ) * 0.001, minClip, maxClip), valIdx);
416void IControl::OnEndAnimation()
418 mAnimationFunc =
nullptr;
421 if(mAnimationEndActionFunc)
422 mAnimationEndActionFunc(
this);
427 mAnimationStartTime = std::chrono::high_resolution_clock::now();
428 mAnimationDuration = Milliseconds(duration);
436 auto elapsed = Milliseconds(std::chrono::high_resolution_clock::now() - mAnimationStartTime);
437 return elapsed.count() / mAnimationDuration.count();
440ITextControl::ITextControl(
const IRECT& bounds,
const char* str,
const IText& text,
const IColor& BGColor,
bool setBoundsBasedOnStr)
444, mSetBoundsBasedOnStr(setBoundsBasedOnStr)
452 if(mSetBoundsBasedOnStr)
458 if (strcmp(mStr.Get(), str))
462 if(mSetBoundsBasedOnStr)
472 va_start(arglist, fmt);
473 mStr.SetAppendFormattedArgs(
false, maxlen, fmt, arglist);
481 g.
FillRect(mBGColor, mRECT, &mBlend);
484 g.
DrawText(mText, mStr.Get(), mRECT, &mBlend);
494IURLControl::IURLControl(
const IRECT& bounds,
const char* str,
const char* urlStr,
const IText& text,
const IColor& BGColor,
const IColor& MOColor,
const IColor& CLColor)
497, mOriginalColor(text.mFGColor)
501 mIgnoreMouse =
false;
506 g.
FillRect(mBGColor, mRECT, &mBlend);
509 mText.mFGColor = mMOColor;
511 mText.mFGColor = mClicked ? mCLColor : mOriginalColor;
513 if (mStr.GetLength())
518 float linePosY = 0.f;
519 float linePosL = 0.f;
520 float linePosR = 0.f;
522 if(mText.mVAlign == EVAlign::Middle)
523 linePosY = mRECT.
MH() + textDims.B;
524 else if(mText.mVAlign == EVAlign::Bottom)
526 else if(mText.mVAlign == EVAlign::Top)
527 linePosY = mRECT.T - textDims.
H();
529 if(mText.mAlign == EAlign::Center)
531 linePosL = mRECT.
MW() + textDims.L;
532 linePosR = mRECT.
MW() + textDims.R;
534 else if(mText.mAlign == EAlign::Near)
537 linePosR = mRECT.L + textDims.
W();
539 else if(mText.mAlign == EAlign::Far)
541 linePosL = mRECT.R - textDims.
W();
545 g.
DrawLine(mText.mFGColor, linePosL, linePosY, linePosR, linePosY, &mBlend);
546 g.
DrawText(mText, mStr.Get(), mRECT, &mBlend);
560 mOriginalColor = txt.mFGColor;
563ITextToggleControl::ITextToggleControl(
const IRECT& bounds,
int paramIdx,
const char* offText,
const char* onText,
const IText& text,
const IColor& bgColor)
570 mIgnoreMouse =
false;
571 mDblAsSingleClick =
true;
574ITextToggleControl::ITextToggleControl(
const IRECT& bounds, IActionFunction aF,
const char* offText,
const char* onText,
const IText& text,
const IColor& bgColor)
580 mDblAsSingleClick =
true;
581 mIgnoreMouse =
false;
607, mShowParamLabel(showParamLabel)
610 mDblAsSingleClick =
true;
611 mDisablePrompt =
false;
612 mIgnoreMouse =
false;
649 if(pParam && pParam->
Type() == IParam::kTypeEnum)
655PlaceHolder::PlaceHolder(
const IRECT& bounds,
const char* str)
658 mBGColor = COLOR_WHITE;
659 mDisablePrompt =
false;
660 mDblAsSingleClick =
false;
661 mIgnoreMouse =
false;
667 g.
DrawLine(COLOR_RED, mRECT.L, mRECT.T, mRECT.R, mRECT.B, &BLEND_50, 2.f);
668 g.
DrawLine(COLOR_RED, mRECT.L, mRECT.B, mRECT.R, mRECT.T, &BLEND_50, 2.f);
673 g.
DrawText(mHeightText, mHeightStr.Get(), mRECT.L + mInset, mRECT.
MH());
678 g.
DrawText(mWidthText, mWidthStr.Get(), mRECT.
MW(), mRECT.T + mInset);
683 g.
DrawText(mTLGCText, mTLHCStr.Get(), mRECT.L + mInset, mRECT.T + mInset);
685 if (mStr.GetLength())
692 mCentreLabelBounds = r;
698 mTLHCStr.SetFormatted(32,
"%0.1f, %0.1f", mRECT.L, mRECT.T);
699 mWidthStr.SetFormatted(32,
"%0.1f", mRECT.
W());
700 mHeightStr.SetFormatted(32,
"%0.1f", mRECT.
H());
703IButtonControlBase::IButtonControlBase(
const IRECT& bounds, IActionFunction aF)
706 mDblAsSingleClick =
true;
715void IButtonControlBase::OnEndAnimation()
718 IControl::OnEndAnimation();
721ISwitchControlBase::ISwitchControlBase(
const IRECT& bounds,
int paramIdx, IActionFunction aF,
int numStates)
723, mNumStates(numStates)
725 mDisabledState.Resize(numStates);
726 SetAllStatesDisabled(
false);
727 mDblAsSingleClick =
true;
730void ISwitchControlBase::SetAllStatesDisabled(
bool disabled)
732 for(
int i=0; i<mNumStates; i++)
734 SetStateDisabled(i, disabled);
739void ISwitchControlBase::SetStateDisabled(
int stateIdx,
bool disabled)
741 if(stateIdx >= 0 && stateIdx < mNumStates && mDisabledState.GetSize())
742 mDisabledState.Get()[stateIdx] = disabled;
747bool ISwitchControlBase::GetStateDisabled(
int stateIdx)
const
749 if(stateIdx >= 0 && stateIdx < mNumStates && mDisabledState.GetSize())
750 return mDisabledState.Get()[stateIdx];
759 assert(mNumStates > 1);
768 const double step = 1.0 / (double(mNumStates-1));
771 if (val > (1.0 + std::numeric_limits<double>::epsilon()))
786bool IKnobControlBase::IsFineControl(
const IMouseMod& mod,
bool wheel)
const
792 return wheel ? mod.C : mod.R;
795 return (mod.C || mod.S);
804 if (mHideCursorOnDrag)
812 if (mHideCursorOnDrag)
821 double gearing = IsFineControl(mod,
false) ? mGearing * 10.0 : mGearing;
825 if (mDirection == EDirection::Vertical)
826 mMouseDragValue +=
static_cast<double>(dY /
static_cast<double>(dragBounds.T - dragBounds.B) / gearing);
828 mMouseDragValue +=
static_cast<double>(dX /
static_cast<double>(dragBounds.R - dragBounds.L) / gearing);
830 mMouseDragValue =
Clip(mMouseDragValue, 0., 1.);
832 double v = mMouseDragValue;
844 const double gearing = IsFineControl(mod,
true) ? 0.001 : 0.01;
845 double newValue = 0.0;
853 const double step = pParam->
GetStep();
855 v += d > 0 ? step : -step;
865 newValue = oldValue + gearing * d;
872ISliderControlBase::ISliderControlBase(
const IRECT& bounds,
int paramIdx, EDirection dir,
double gearing,
float handleSize)
875, mHandleSize(handleSize)
880 ISliderControlBase::ISliderControlBase(
const IRECT& bounds, IActionFunction aF, EDirection dir,
double gearing,
float handleSize)
883, mHandleSize(handleSize)
891 mTrackBounds = mRECT;
909 if (mHideCursorOnDrag)
917 if (mHideCursorOnDrag)
928 if(mod.touchID || !mHideCursorOnDrag)
946 double gearing = IsFineControl(mod,
false) ? mGearing * 10.0 : mGearing;
948 if (mDirection == EDirection::Vertical)
949 mMouseDragValue +=
static_cast<double>(dY /
static_cast<double>(mTrackBounds.T - mTrackBounds.B) / gearing);
951 mMouseDragValue +=
static_cast<double>(dX /
static_cast<double>(mTrackBounds.R - mTrackBounds.L) / gearing);
953 mMouseDragValue =
Clip(mMouseDragValue, 0., 1.);
955 double v = mMouseDragValue;
966 const double gearing = IsFineControl(mod,
true) ? 0.001 : 0.01;
967 double newValue = 0.0;
975 const double step = pParam->
GetStep();
977 v += d > 0 ? step : -step;
987 newValue = oldValue + gearing * d;
994bool ISliderControlBase::IsFineControl(
const IMouseMod& mod,
bool wheel)
const
1000 return wheel ? mod.C : mod.R;
1003 return (mod.C || mod.S);
1008IDirBrowseControlBase::~IDirBrowseControlBase()
1013int IDirBrowseControlBase::NItems()
const
1015 return mItems.GetSize();
1020 assert(strlen(path));
1022 mPaths.Add(
new WDL_String(path));
1023 mPathLabels.Add(
new WDL_String(label));
1026void IDirBrowseControlBase::CollectSortedItems(
IPopupMenu* pMenu)
1028 int nItems = pMenu->NItems();
1030 for (
int i = 0; i < nItems; i++)
1034 if (pItem->GetSubmenu())
1035 CollectSortedItems(pItem->GetSubmenu());
1044 mItems.Empty(
false);
1047 mSelectedItemIndex = -1;
1051 if (mPaths.GetSize() == 1)
1053 ScanDirectory(mPaths.Get(0)->Get(), mMainMenu);
1057 for (
int p = 0; p<mPaths.GetSize(); p++)
1060 mMainMenu.AddItem(mPathLabels.Get(p)->Get(), idx++, pNewMenu);
1061 ScanDirectory(mPaths.Get(p)->Get(), *pNewMenu);
1065 CollectSortedItems(&mMainMenu);
1071 mPathLabels.Empty(
true);
1073 mItems.Empty(
false);
1078 for (
auto fileIdx = 0; fileIdx < mFiles.GetSize(); fileIdx ++)
1080 if (strcmp(mFiles.Get(fileIdx)->Get(), filePath) == 0)
1082 for (
auto itemIdx = 0; itemIdx < mItems.GetSize(); itemIdx++)
1086 if (pItem->GetTag() == fileIdx)
1088 mSelectedItemIndex = itemIdx;
1095 mSelectedItemIndex = -1;
1100 if (mSelectedItemIndex > -1)
1103 path.Set(mFiles.Get(pItem->GetTag()));
1113 if (mSelectedItemIndex > -1)
1116 mMainMenu.CheckItemAlone(pItem);
1120void IDirBrowseControlBase::ScanDirectory(
const char* path,
IPopupMenu& menuToAddTo)
1128 const char* f = d.GetCurrentFN();
1129 if (f && f[0] !=
'.')
1131 if (mScanRecursively && d.GetCurrentIsDirectory())
1134 d.GetCurrentFullFN(&subdir);
1136 menuToAddTo.AddItem(d.GetCurrentFN(), pNewMenu, -2);
1137 ScanDirectory(subdir.Get(), *pNewMenu);
1145 auto strrstr = [](
const char* str1,
const char* str2) ->
const char* {
1149 const char* result =
nullptr;
1151 while (*str1 !=
'\0') {
1152 if (std::strncmp(str1, str2, std::strlen(str2)) == 0)
1161 const char* a = strrstr(f, mExtension.Get());
1162 if (a && a > f && strlen(a) == strlen(mExtension.Get()))
1164 WDL_String menuEntry {f};
1166 if (!mShowFileExtensions)
1167 menuEntry.Set(f, (
int) (a - f) - 1);
1170 menuToAddTo.AddItem(pItem, -2 );
1171 WDL_String* pFullPath =
new WDL_String(
"");
1172 d.GetCurrentFullFN(pFullPath);
1173 mFiles.Add(pFullPath);
1177 }
while (!d.Next());
1180 if (!mShowEmptySubmenus)
1181 menuToAddTo.RemoveEmptySubmenus();
This file contains the base IControl implementation, along with some base classes for specific types ...
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
ICaptionControl(const IRECT &bounds, int paramIdx, const IText &text=DEFAULT_TEXT, const IColor &BGColor=DEFAULT_BGCOLOR, bool showParamLabel=true)
Creates an ICaptionControl.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
void Draw(IGraphics &g) override
Draw the control to the graphics context.
The lowest level base class of an IGraphics control.
bool GetMouseIsOver() const
This can be used in IControl::Draw() to check if the mouse is over the control, without implementing ...
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
virtual void OnMouseOut()
Implement this method to respond to a mouseout event on this control.
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
virtual void OnMouseOver(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouseover event on this control.
virtual void SetPosition(float x, float y)
Set the position of the control, preserving the width and height.
virtual void SetValueFromDelegate(double value, int valIdx=0)
Set the control's value from the delegate This method is called from the class implementing the IEdit...
virtual void OnPopupMenuSelection(IPopupMenu *pSelectedMenu, int valIdx)
Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptU...
virtual void OnMouseDown(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouse down event on this control.
virtual void SetValueFromUserInput(double value, int valIdx=0)
Set the control's value after user input.
virtual bool IsDirty()
Called at each display refresh by the IGraphics draw loop, after IControl::Animate(),...
virtual void Hide(bool hide)
Shows or hides the IControl.
IControl * AttachGestureRecognizer(EGestureType type, IGestureFunc func)
Add a IGestureFunc that should be triggered in response to a certain type of gesture.
int GetParamIdx(int valIdx=0) const
Get the index of a parameter that the control is linked to Normaly controls are either linked to a si...
const IRECT & GetRECT() const
Get the rectangular draw area for this control, within the graphics context.
int LinkedToParam(int paramIdx) const
Check if the control is linked to a particular parameter.
void SetTargetRECT(const IRECT &bounds)
Set the rectangular mouse tracking target area, within the graphics context for this control.
IGEditorDelegate * GetDelegate()
Gets a pointer to the class implementing the IEditorDelegate interface that handles parameter changes...
virtual void OnMouseDblClick(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouse double click event on this control.
double GetAnimationProgress() const
Get the progress in a control's animation, in the range 0-1.
void PromptUserInput(int valIdx=0)
Call this method in response to a mouse event to create an edit box so the user can enter a value,...
virtual void SnapToMouse(float x, float y, EDirection direction, const IRECT &bounds, int valIdx=-1, double minClip=0., double maxClip=1.)
Set control value based on x, y position within a rectangle.
virtual void DrawPTHighlight(IGraphics &g)
Implement this to customise how a colored highlight is drawn on the control in ProTools (AAX format o...
virtual void SetValueToDefault(int valIdx=kNoValIdx)
Set one or all of the control's values to the default value of the associated parameter.
virtual void SetParamIdx(int paramIdx, int valIdx=0)
Set the index of a parameter that the control is linked to If you are calling this "manually" to reus...
virtual bool OnGesture(const IGestureInfo &info)
const IParam * GetParam(int valIdx=0) const
Get a const pointer to the IParam object (owned by the editor delegate class), associated with this c...
void ForValIdx(int valIdx, T func, Args... args)
A helper template function to call a method for an individual value, or for all values.
T * As()
Helper function to dynamic cast an IControl to a subclass.
virtual void SetSize(float w, float h)
Set the size of the control, preserving the current position.
void SetPTParameterHighlight(bool isHighlighted, int color)
Used internally by the AAX wrapper view interface to set the control parmeter highlight.
void SetRECT(const IRECT &bounds)
Set the rectangular draw area for this control, within the graphics context.
void StartAnimation(int duration)
virtual void SetDisabled(bool disable)
Sets disabled mode for the control, the default implementation modifies the mBlend member.
virtual void SetValue(double value, int valIdx=0)
Set one of the control's values.
double GetValue(int valIdx=0) const
Get the control's value.
void SetTargetAndDrawRECTs(const IRECT &bounds)
Set BOTH the draw rect and the target area, within the graphics context for this control.
virtual int GetValIdxForPos(float x, float y) const
Check to see which of the control's values relates to this x and y coordinate.
IAnimationFunction GetAnimationFunction()
Get the control's animation function, if it exists.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
IControl * SetActionFunction(IActionFunction actionFunc)
Set an Action Function for this control.
void SetAnimation(IAnimationFunction func)
Set the animation function.
void ClearPathList()
Clear the menu.
void CheckSelectedItem()
Check the currently selected menu item.
void SetupMenu()
Call after adding one or more paths, to populate the menu.
void GetSelectedFile(WDL_String &path) const
Get the full path to the file if something has been selected in the menu.
void SetSelectedFile(const char *filePath)
Set the selected file based on a file path.
void AddPath(const char *path, const char *displayText)
Used to add a path to scan for files.
IParam * GetParam(int paramIdx)
Get a pointer to one of the delegate's IParam objects.
virtual void SendParameterValueFromUI(int paramIdx, double normalizedValue)
SPVFUI Called by the UI during a parameter change gesture, in order to notify the host of the new val...
The lowest level base class of an IGraphics context.
virtual bool OpenURL(const char *url, const char *msgWindowTitle=0, const char *confirmMsg=0, const char *errMsgOnFailure=0)=0
Open a URL in the platform’s default browser.
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.
void UpdatePeers(IControl *pCaller, int callerValIdx)
This method is called after interacting with a control, so that any other controls linked to the same...
virtual void AttachGestureRecognizer(EGestureType type)
Registers a gesture recognizer with the graphics context.
void ReleaseMouseCapture()
Used to tell the graphics context to stop tracking mouse interaction with a control.
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
virtual void DrawLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f)
Draw a line to the graphics context.
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
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.
IControl * GetControlInTextEntry()
void PromptUserInput(IControl &control, const IRECT &bounds, int valIdx=0)
Prompt for user input either using a text entry or pop up menu.
virtual void HideMouseCursor(bool hide=true, bool lock=true)=0
Call to hide/show the mouse cursor.
virtual void FillCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0)
Fill a circle with a color.
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod) override
Implement this method to respond to a mouse drag event on this control.
void OnMouseWheel(float x, float y, const IMouseMod &mod, float d) override
Implement this method to respond to a mouse wheel event on this control.
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
virtual IRECT GetKnobDragBounds()
Get the area for which mouse deltas will be used to calculate the amount dragging changes the control...
double GetStep() const
Returns the parameter's step size.
double GetDefault(bool normalized=false) const
Returns the parameter's default value.
EParamType Type() const
Get the parameter's type.
double ToNormalized(double nonNormalizedValue) const
Convert a real value to normalized value for this parameter.
double ConstrainNormalized(double normalizedValue) const
Constrains a normalised input value similarly to Constrain()
void GetDisplay(WDL_String &display, bool withDisplayText=true) const
Get the current textual display for the current parameter value.
const char * GetLabel() const
Returns the parameter's label.
double FromNormalized(double normalizedValue) const
Convert a normalized value to real value for this parameter.
void GetDisplayWithLabel(WDL_String &display, bool withDisplayText=true) const
Fills the WDL_String the value of the parameter along with the label, e.g.
double GetRange() const
Returns the parameter's range.
void OnMouseWheel(float x, float y, const IMouseMod &mod, float d) override
Implement this method to respond to a mouse wheel event on this control.
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod) override
Implement this method to respond to a mouse drag event on this control.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void OnInit() override
Called just prior to when the control is attached, after its delegate and graphics member variable se...
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
A basic control to display some text.
virtual void SetStrFmt(int maxlen, const char *fmt,...)
Set the text to display, using a printf-like format string.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnInit() override
Called just prior to when the control is attached, after its delegate and graphics member variable se...
void SetBoundsBasedOnStr()
Measures the bounds of the text that the control displays and compacts/expands the control's bounds t...
virtual void SetStr(const char *str)
Set the text to display.
void SetDirty(bool push, int valIdx=0) override
Mark the control as dirty, i.e.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void SetText(const IText &) override
Set the Text object typically used to determine font/layout/size etc of the main text in a control.
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.
A base interface to be combined with IControl for vectorial controls "IVControls",...
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
BEGIN_IPLUG_NAMESPACE BEGIN_IGRAPHICS_NAMESPACE void DefaultAnimationFunc(IControl *pCaller)
An animation function that just calls the caller control's OnEndAnimation() method at the end of the ...
void EmptyClickActionFunc(IControl *pCaller)
A click action function that does nothing.
void DefaultClickActionFunc(IControl *pCaller)
A click action function that triggers the default animation function for DEFAULT_ANIMATION_DURATION.
void SplashClickActionFunc(IControl *pCaller)
The splash click action function is used by IVControls to start SplashAnimationFunc.
void SplashAnimationFunc(IControl *pCaller)
The splash animation function is used by IVControls to animate the splash.
void ShowBubbleVerticalActionFunc(IControl *pCaller)
Use with a param-linked control to popup the bubble control vertically.
void ShowBubbleHorizontalActionFunc(IControl *pCaller)
Use with a param-linked control to popup the bubble control horizontally.
Used to describe a particular gesture.
BEGIN_IPLUG_NAMESPACE T Clip(T x, T lo, T hi)
Clips the value x between lo and hi.
Used to manage color data, independent of draw class/platform.
Used to manage mouse modifiers i.e.
Used to manage a rectangular area, independent of draw class/platform.
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.
IRECT GetTranslated(float x, float y) const
Get a translated copy of this rectangle.
IRECT FracRectHorizontal(float frac, bool rhs=false) const
Returns a new IRECT with a width that is multiplied by frac.
void Constrain(float &x, float &y) const
Ensure the point (x,y) is inside this IRECT.
IText is used to manage font and text/text entry style for a piece of text on the UI,...