iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IControl Class Referenceabstract

The lowest level base class of an IGraphics control. More...

#include <IControl.h>

Inheritance diagram for IControl:
[legend]

Public Member Functions

 IControl (const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
 Constructor. More...
 
 IControl (const IRECT &bounds, const std::initializer_list< int > &params, IActionFunction actionFunc=nullptr)
 Constructor (range of parameters) More...
 
 IControl (const IRECT &bounds, IActionFunction actionFunc)
 Constructor (no paramIdx) More...
 
 IControl (const IControl &)=delete
 
void operator= (const IControl &)=delete
 
virtual ~IControl ()
 Destructor. More...
 
virtual void OnMouseDown (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse down event on this control. More...
 
virtual void OnMouseUp (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse up event on this control. More...
 
virtual void OnMouseDrag (float x, float y, float dX, float dY, const IMouseMod &mod)
 Implement this method to respond to a mouse drag event on this control. More...
 
virtual void OnMouseDblClick (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse double click event on this control. More...
 
virtual void OnMouseWheel (float x, float y, const IMouseMod &mod, float d)
 Implement this method to respond to a mouse wheel event on this control. More...
 
virtual bool OnKeyDown (float x, float y, const IKeyPress &key)
 Implement this method to respond to a key down event on this control. More...
 
virtual bool OnKeyUp (float x, float y, const IKeyPress &key)
 Implement this method to respond to a key up event on this control. More...
 
virtual void OnMouseOver (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouseover event on this control. More...
 
virtual void OnMouseOut ()
 Implement this method to respond to a mouseout event on this control. More...
 
virtual void OnTouchCancelled (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a touch cancel event on this control. More...
 
virtual void OnDrop (const char *str)
 Implement to do something when something was drag 'n dropped onto this control. More...
 
virtual void OnDropMultiple (const std::vector< const char * > &paths)
 Implement to handle multiple items drag 'n dropped onto this control. More...
 
virtual void OnRescale ()
 Implement to do something when graphics is scaled globally (e.g. More...
 
virtual void OnResize ()
 Called when IControl is constructed or resized using SetRect(). More...
 
virtual void OnInit ()
 Called just prior to when the control is attached, after its delegate and graphics member variable set. More...
 
virtual void OnAttached ()
 Called after the control has been attached, and its delegate and graphics member variable set. More...
 
virtual void OnMsgFromDelegate (int msgTag, int dataSize, const void *pData)
 Implement to receive messages sent to the control, see IEditorDelegate:SendControlMsgFromDelegate() More...
 
virtual void OnMidi (const IMidiMsg &msg)
 Implement to receive MIDI messages sent to the control if mWantsMidi == true, see IEditorDelegate:SendMidiMsgFromDelegate() More...
 
virtual bool OnGesture (const IGestureInfo &info)
 
virtual void CreateContextMenu (IPopupMenu &contextMenu)
 Called by default when the user right clicks a control. More...
 
virtual void OnPopupMenuSelection (IPopupMenu *pSelectedMenu, int valIdx)
 Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput. More...
 
virtual void OnTextEntryCompletion (const char *str, int valIdx)
 Implement this method to handle text input after IGraphics::CreateTextEntry/IControlPromptUserInput. More...
 
virtual void OnContextSelection (int itemSelected)
 Implement this to respond to a menu selection from CreateContextMenu();. More...
 
virtual void Draw (IGraphics &g)=0
 Draw the control to the graphics context. More...
 
virtual void DrawPTHighlight (IGraphics &g)
 Implement this to customise how a colored highlight is drawn on the control in ProTools (AAX format only), when a control is linked to a parameter that is automated. More...
 
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, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter) More...
 
void PromptUserInput (const IRECT &bounds, int valIdx=0)
 Create a text entry box so the user can enter a value, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter) specifying the bounds. More...
 
IControlSetActionFunction (IActionFunction actionFunc)
 Set an Action Function for this control. More...
 
IControlSetAnimationEndActionFunction (IActionFunction actionFunc)
 Set an Action Function to be called at the end of an animation. More...
 
IControlSetTooltip (const char *str)
 Set a tooltip for the control. More...
 
const char * GetTooltip () const
 
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 single parameter or no parameter but some may be linked to multiple parameters. More...
 
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 reuse a control for multiple parameters, you probably want to call IEditorDelegate::SendCurrentParamValuesFromDelegate() afterward, to update the control values. More...
 
int LinkedToParam (int paramIdx) const
 Check if the control is linked to a particular parameter. More...
 
int NVals () const
 
virtual int GetValIdxForPos (float x, float y) const
 Check to see which of the control's values relates to this x and y coordinate. More...
 
const IParamGetParam (int valIdx=0) const
 Get a const pointer to the IParam object (owned by the editor delegate class), associated with this control. More...
 
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 IEditorDelegate interface in order to update a control's value members and set it to be marked dirty for redraw. More...
 
virtual void SetValueFromUserInput (double value, int valIdx=0)
 Set the control's value after user input. More...
 
virtual void SetValueToDefault (int valIdx=kNoValIdx)
 Set one or all of the control's values to the default value of the associated parameter. More...
 
virtual void SetValue (double value, int valIdx=0)
 Set one of the control's values. More...
 
double GetValue (int valIdx=0) const
 Get the control's value. More...
 
void SetGroup (const char *groupName)
 Assign the control to a control group. More...
 
const char * GetGroup () const
 Get the group that the control belongs to, if any. More...
 
const ITextGetText () const
 Get the Text object for the control. More...
 
virtual void SetText (const IText &txt)
 Set the Text object typically used to determine font/layout/size etc of the main text in a control. More...
 
void SetBlend (const IBlend &blend)
 Set the Blend for this control. More...
 
IBlend GetBlend () const
 Get the Blend for this control. More...
 
int GetTextEntryLength () const
 Get the max number of characters that are allowed in text entry. More...
 
void SetTextEntryLength (int len)
 Set the max number of characters that are allowed in text entry. More...
 
const IRECTGetRECT () const
 Get the rectangular draw area for this control, within the graphics context. More...
 
void SetRECT (const IRECT &bounds)
 Set the rectangular draw area for this control, within the graphics context. More...
 
const IRECTGetTargetRECT () const
 Get the rectangular mouse tracking target area, within the graphics context for this control. More...
 
void SetTargetRECT (const IRECT &bounds)
 Set the rectangular mouse tracking target area, within the graphics context for this control. More...
 
void SetTargetAndDrawRECTs (const IRECT &bounds)
 Set BOTH the draw rect and the target area, within the graphics context for this control. More...
 
virtual void SetPosition (float x, float y)
 Set the position of the control, preserving the width and height. More...
 
virtual void SetSize (float w, float h)
 Set the size of the control, preserving the current position. More...
 
void SetPTParameterHighlight (bool isHighlighted, int color)
 Used internally by the AAX wrapper view interface to set the control parmeter highlight. More...
 
bool GetMouseDblAsSingleClick () const
 Get double click as single click By default, mouse double click has its own handler. More...
 
virtual void Hide (bool hide)
 Shows or hides the IControl. More...
 
bool IsHidden () const
 
virtual void SetDisabled (bool disable)
 Sets disabled mode for the control, the default implementation modifies the mBlend member. More...
 
bool IsDisabled () const
 
void SetMouseOverWhenDisabled (bool allow)
 Specify whether the control should respond to mouse overs when disabled. More...
 
void SetMouseEventsWhenDisabled (bool allow)
 Specify whether the control should respond to other mouse events when disabled. More...
 
bool GetMouseOverWhenDisabled () const
 
bool GetMouseEventsWhenDisabled () const
 
bool GetIgnoreMouse () const
 
virtual void SetIgnoreMouse (bool ignore)
 Specify whether the control should respond to mouse events. More...
 
bool GetPromptShowsParamLabel () const
 
void SetPromptShowsParamLabel (bool enable)
 Set if the control should show parameter labels/units e.g. More...
 
virtual bool IsHit (float x, float y) const
 Hit test the control. More...
 
virtual void SetDirty (bool triggerAction=true, int valIdx=kNoValIdx)
 Mark the control as dirty, i.e. More...
 
virtual void SetClean ()
 
void Animate ()
 
virtual bool IsDirty ()
 Called at each display refresh by the IGraphics draw loop, after IControl::Animate(), to determine if the control is marked as dirty. More...
 
void DisablePrompt (bool disable)
 Disable/enable default prompt for user input. More...
 
virtual void OnGUIIdle ()
 This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined. More...
 
int GetTag () const
 Get the control's tag. More...
 
void SetWantsMidi (bool enable=true)
 Specify whether this control wants to know about MIDI messages sent to the UI. More...
 
bool GetWantsMidi () const
 
void SetWantsMultiTouch (bool enable=true)
 Specify whether this control supports multiple touches. More...
 
bool GetWantsMultiTouch () const
 
IControlAttachGestureRecognizer (EGestureType type, IGestureFunc func)
 Add a IGestureFunc that should be triggered in response to a certain type of gesture. More...
 
virtual bool GetWantsGestures () const
 
EGestureType GetLastGesture () const
 
IGEditorDelegateGetDelegate ()
 Gets a pointer to the class implementing the IEditorDelegate interface that handles parameter changes from this IGraphics instance. More...
 
void SetDelegate (IGEditorDelegate &dlg)
 Used internally to set the mDelegate (and mGraphics) variables. More...
 
IContainerBaseGetParent () const
 
void SetParent (IContainerBase *pParent)
 
IGraphicsGetUI ()
 
const IGraphicsGetUI () const
 
bool GetMouseIsOver () const
 This can be used in IControl::Draw() to check if the mouse is over the control, without implementing mouse over methods. More...
 
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. More...
 
virtual void OnEndAnimation ()
 
void StartAnimation (int duration)
 
void SetAnimation (IAnimationFunction func)
 Set the animation function. More...
 
void SetAnimation (IAnimationFunction func, int duration)
 Set the animation function and starts it. More...
 
IAnimationFunction GetAnimationFunction ()
 Get the control's animation function, if it exists. More...
 
IActionFunction GetActionFunction ()
 Get the control's action function, if it exists. More...
 
double GetAnimationProgress () const
 Get the progress in a control's animation, in the range 0-1. More...
 
Milliseconds GetAnimationDuration () const
 Get the duration of animations applied to the control. More...
 
template<class T >
T * As ()
 Helper function to dynamic cast an IControl to a subclass. More...
 

Protected Member Functions

template<typename T , typename... Args>
void ForValIdx (int valIdx, T func, Args... args)
 A helper template function to call a method for an individual value, or for all values. More...
 
void SetNVals (int nVals)
 

Protected Attributes

IRECT mRECT
 
IRECT mTargetRECT
 
WDL_String mGroup
 Controls can be grouped for hiding and showing panels. More...
 
IText mText
 
IBlend mBlend
 
int mTextEntryLength = DEFAULT_TEXT_ENTRY_LEN
 
bool mDirty = true
 
bool mHide = false
 
bool mDisabled = false
 
bool mDisablePrompt = true
 
bool mDblAsSingleClick = false
 
bool mMouseOverWhenDisabled = false
 
bool mMouseEventsWhenDisabled = false
 
bool mIgnoreMouse = false
 
bool mWantsMidi = false
 
bool mWantsMultiTouch = false
 
bool mPromptShowsParamLabel = false
 
bool mMouseIsOver = false
 if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control. More...
 
WDL_String mTooltip
 
IColor mPTHighlightColor = COLOR_RED
 
bool mPTisHighlighted = false
 

Detailed Description

The lowest level base class of an IGraphics control.

A control is anything on the GUI

Definition at line 44 of file IControl.h.

Constructor & Destructor Documentation

◆ IControl() [1/3]

IControl::IControl ( const IRECT bounds,
int  paramIdx = kNoParameter,
IActionFunction  actionFunc = nullptr 
)

Constructor.

Creates an IControl NOTE: An IControl does not know about the delegate or graphics context to which it belongs in the constructor If you need to do something once those things are known, see IControl::OnInit()

Parameters
boundsThe rectangular area that the control occupies
paramIdxIf this is > -1 (kNoParameter) this control will be associated with a plugin parameter
actionFuncpass in a lambda function to provide custom functionality when the control "action" happens (usually mouse down).

Definition at line 83 of file IControl.cpp.

◆ IControl() [2/3]

IControl::IControl ( const IRECT bounds,
const std::initializer_list< int > &  params,
IActionFunction  actionFunc = nullptr 
)

Constructor (range of parameters)

Creates an IControl which is linked to multiple parameters NOTE: An IControl does not know about the delegate or graphics context to which it belongs in the constructor If you need to do something once those things are known, see IControl::OnInit()

Parameters
boundsThe rectangular area that the control occupies
paramsAn initializer list of valid integer parameter indexes
actionFuncpass in a lambda function to provide custom functionality when the control "action" happens (usually mouse down).

Definition at line 91 of file IControl.cpp.

◆ IControl() [3/3]

IControl::IControl ( const IRECT bounds,
IActionFunction  actionFunc 
)

Constructor (no paramIdx)

Creates an IControl which is not linked to a parameter NOTE: An IControl does not know about the delegate or graphics context to which it belongs in the constructor If you need to do something once those things are known, see IControl::OnInit()

Parameters
boundsThe rectangular area that the control occupies
actionFuncpass in a lambda function to provide custom functionality when the control "action" happens (usually mouse down).

Definition at line 102 of file IControl.cpp.

◆ ~IControl()

virtual IControl::~IControl ( )
inlinevirtual

Destructor.

Clean up any resources that your control owns.

Definition at line 81 of file IControl.h.

Member Function Documentation

◆ Animate()

void IControl::Animate ( )

Definition at line 225 of file IControl.cpp.

◆ As()

template<class T >
T * IControl::As ( )
inline

Helper function to dynamic cast an IControl to a subclass.

Definition at line 513 of file IControl.h.

Referenced by IVTabPage::IVTabPage(), IVTabPage::OnStyleChanged(), IVTabbedPagesControl::OnStyleChanged(), SplashAnimationFunc(), and SplashClickActionFunc().

◆ AttachGestureRecognizer()

IControl * IControl::AttachGestureRecognizer ( EGestureType  type,
IGestureFunc  func 
)

Add a IGestureFunc that should be triggered in response to a certain type of gesture.

Parameters
typeThe type of gesture to recognize on this control
functhe function to trigger

Definition at line 311 of file IControl.cpp.

References IGraphics::AttachGestureRecognizer(), and GetUI().

Referenced by TestGesturesControl::OnInit().

◆ CreateContextMenu()

virtual void IControl::CreateContextMenu ( IPopupMenu contextMenu)
inlinevirtual

Called by default when the user right clicks a control.

If IGRAPHICS_NO_CONTEXT_MENU is enabled as a preprocessor macro right clicking control will mean IControl::CreateContextMenu() and IControl::OnContextSelection() do not function on right clicking control. VST3 provides contextual menu support which is hard wired to right click controls by default. You can add custom items to the menu by implementing IControl::CreateContextMenu() and handle them in IControl::OnContextSelection(). In non-VST 3 hosts right clicking will still create the menu, but it will not feature entries added by the host.

Definition at line 171 of file IControl.h.

Referenced by IGraphics::PopupHostContextMenuForParam().

◆ DisablePrompt()

void IControl::DisablePrompt ( bool  disable)
inline

Disable/enable default prompt for user input.

Parameters
disableSet true to disable prompt

Definition at line 415 of file IControl.h.

◆ Draw()

virtual void IControl::Draw ( IGraphics g)
pure virtual

Draw the control to the graphics context.

Parameters
gThe graphics context to which this control belongs.

Implemented in IBubbleControl, IColorPickerControl, IVLabelControl, IVButtonControl, IVSwitchControl, IVSlideSwitchControl, IVTabSwitchControl, IVKnobControl, IVSliderControl, IVRangeSliderControl, IVXYPadControl, IVPlotControl, IVGroupControl, IVPanelControl, IVColorSwatchControl, ISVGKnobControl, ISVGButtonControl, ISVGToggleControl, ISVGSwitchControl, ISVGSliderControl, IBButtonControl, IBSwitchControl, IBKnobControl, IBKnobRotaterControl, IBSliderControl, IBTextControl, IBMeterControl, ICornerResizerControl, IFPSDisplayControl, ILEDControl, IPlatformViewControl, IPopupMenuControl, IShaderControl, ITextEntryControl, IVDisplayControl, IVKeyboardControl, IWheelControl, IVMeterControl< MAXNC >, IVMeterControl< MAXNC >, IVMeterControl< 1 >, IVMultiSliderControl< MAXNC >, IVMultiSliderControl< 1 >, IVNumberBoxControl, IVBakedPresetManagerControl, IVDiskPresetManagerControl, IVScopeControl< MAXNC, MAXBUF >, IVTabPage, IVTabbedPagesControl, IWebViewControl, ISkLottieControl, ISkParagraphControl, TestAnimationControl, TestArcControl, TestBezierControl, TestBlendControl, TestColorControl, TestCursorControl, TestCustomShaderControl, TestDirBrowseControl, TestDragAndDropControl, TestDrawContextControl, TestDropShadowControl, TestFlexBoxControl, TestFontControl, TestGesturesControl, GFXLabelControl, TestGradientControl, TestImageControl, TestKeyboardControl, TestLayerControl, TestMaskControl, TestMPSControl, TestMultiPathControl, TestMTControl, TestPolyControl, TestShadowGradientControl, TestSizeControl, TestSVGControl, TestTextControl, TestTextOrientationControl, TestTextSizeControl, IContainerBase, IPanelControl, ILambdaControl, IBitmapControl, ISVGControl, ITextControl, IMultiLineTextControl, IURLControl, ICaptionControl, PlaceHolder, and IGraphicsLiveEdit.

◆ DrawPTHighlight()

void IControl::DrawPTHighlight ( IGraphics g)
virtual

Implement this to customise how a colored highlight is drawn on the control in ProTools (AAX format only), when a control is linked to a parameter that is automated.

Parameters
gThe graphics context to which this control belongs.

Definition at line 389 of file IControl.cpp.

References IGraphics::FillCircle().

◆ ForValIdx()

template<typename T , typename... Args>
void IControl::ForValIdx ( int  valIdx,
func,
Args...  args 
)
inlineprotected

A helper template function to call a method for an individual value, or for all values.

Parameters
valIdxIf this is > kNoValIdx execute the function for an individual value. If equal to kNoValIdx call the function for all values
funcA function that takes a single integer argument, the value index
argsArguments to the function

Definition at line 527 of file IControl.h.

References NVals().

Referenced by SetDirty(), SetValueToDefault(), and SnapToMouse().

◆ GetActionFunction()

IActionFunction IControl::GetActionFunction ( )
inline

Get the control's action function, if it exists.

Definition at line 503 of file IControl.h.

◆ GetAnimationDuration()

Milliseconds IControl::GetAnimationDuration ( ) const
inline

Get the duration of animations applied to the control.

Definition at line 509 of file IControl.h.

◆ GetAnimationFunction()

IAnimationFunction IControl::GetAnimationFunction ( )
inline

◆ GetAnimationProgress()

double IControl::GetAnimationProgress ( ) const

Get the progress in a control's animation, in the range 0-1.

Definition at line 431 of file IControl.cpp.

Referenced by DefaultAnimationFunc(), IPopupMenuControl::IPopupMenuControl(), IWheelControl::OnMouseUp(), and SplashAnimationFunc().

◆ GetBlend()

IBlend IControl::GetBlend ( ) const
inline

◆ GetDelegate()

IGEditorDelegate * IControl::GetDelegate ( )
inline

Gets a pointer to the class implementing the IEditorDelegate interface that handles parameter changes from this IGraphics instance.

If you need to call other methods on that class, you can use static_cast<PLUG_CLASS_NAME>(GetDelegate();

Returns
The class implementing the IEditorDelegate interface that handles communication to/from from this IGraphics instance.

Definition at line 449 of file IControl.h.

Referenced by IWheelControl::IWheelControl(), IVNumberBoxControl::OnMouseDown(), IVNumberBoxControl::OnMouseUp(), IVBakedPresetManagerControl::OnPopupMenuSelection(), IWheelControl::OnPopupMenuSelection(), SetDirty(), and IVTrackControlBase::SetParamsByGroup().

◆ GetGroup()

const char * IControl::GetGroup ( ) const
inline

Get the group that the control belongs to, if any.

Returns
A CString indicating the control group that this control belongs to (may be empty)

Definition at line 284 of file IControl.h.

References mGroup.

Referenced by IGraphics::ForControlInGroup(), and IVMenuButtonControl::IVMenuButtonControl().

◆ GetIgnoreMouse()

bool IControl::GetIgnoreMouse ( ) const
inline
Returns
true if the control ignores mouse events

Definition at line 379 of file IControl.h.

◆ GetLastGesture()

EGestureType IControl::GetLastGesture ( ) const
inline
Returns
the last recognized gesture

Definition at line 444 of file IControl.h.

◆ GetMouseDblAsSingleClick()

bool IControl::GetMouseDblAsSingleClick ( ) const
inline

Get double click as single click By default, mouse double click has its own handler.

A control can set mDblAsSingleClick to true which maps double click to single click for this control (and also causes the mouse to be captured by the control on double click).

Returns
/c true if double clicks should be mapped to single clicks

Definition at line 348 of file IControl.h.

Referenced by IGraphics::OnMouseDblClick().

◆ GetMouseEventsWhenDisabled()

bool IControl::GetMouseEventsWhenDisabled ( ) const
inline
Returns
true if the control responds to other mouse events when disabled

Definition at line 376 of file IControl.h.

◆ GetMouseIsOver()

bool IControl::GetMouseIsOver ( ) const
inline

This can be used in IControl::Draw() to check if the mouse is over the control, without implementing mouse over methods.

Note that this method is only enabled if IGraphics::EnableMouseOver() is set to true

Returns
\true if the mouse is over this control.

Definition at line 474 of file IControl.h.

References mMouseIsOver.

Referenced by ICornerResizerControl::Draw(), and ICaptionControl::Draw().

◆ GetMouseOverWhenDisabled()

bool IControl::GetMouseOverWhenDisabled ( ) const
inline
Returns
true if the control responds to mouse overs when disabled

Definition at line 373 of file IControl.h.

◆ GetParam()

const IParam * IControl::GetParam ( int  valIdx = 0) const

◆ GetParamIdx()

int IControl::GetParamIdx ( int  valIdx = 0) const

Get the index of a parameter that the control is linked to Normaly controls are either linked to a single parameter or no parameter but some may be linked to multiple parameters.

Parameters
valIdxAn index to choose which of the control's linked parameters to retrieve. NOTE: since controls usually have only 1 parameter you can omit this argument and use the default index of 0
Returns
Parameter index, or kNoParameter if there is no parameter linked with this control at valIdx

Definition at line 109 of file IControl.cpp.

References NVals().

Referenced by IGraphics::CreateTextEntry(), GetParam(), IGraphics::GetParamIdxForPTAutomation(), ISwitchControlBase::OnInit(), IGraphics::OnMouseDown(), IVNumberBoxControl::OnMouseDown(), IGraphics::OnMouseUp(), IVNumberBoxControl::OnMouseUp(), OnPopupMenuSelection(), PromptUserInput(), IGEditorDelegate::SendParameterValueFromDelegate(), IGraphics::SetControlValueAfterPopupMenu(), SetDirty(), and IGraphics::UpdatePeers().

◆ GetParent()

IContainerBase * IControl::GetParent ( ) const
inline
Returns
A pointer to the parent container, if the control is a sub control

Definition at line 462 of file IControl.h.

Referenced by IGraphicsLiveEdit::Draw(), and IGraphics::IsDirty().

◆ GetPromptShowsParamLabel()

bool IControl::GetPromptShowsParamLabel ( ) const
inline
Returns
true if the control should show parameter labels/units e.g. "Hz" in text entry prompts

Definition at line 386 of file IControl.h.

Referenced by IGraphics::PromptUserInput().

◆ GetRECT()

const IRECT & IControl::GetRECT ( ) const
inline

◆ GetTag()

int IControl::GetTag ( ) const
inline

Get the control's tag.

See also
Control Tags

Definition at line 421 of file IControl.h.

References IGraphics::GetControlTag(), and GetUI().

Referenced by IWheelControl::OnPopupMenuSelection(), IGraphics::RemoveControl(), and IGraphics::RemoveControls().

◆ GetTargetRECT()

const IRECT & IControl::GetTargetRECT ( ) const
inline

Get the rectangular mouse tracking target area, within the graphics context for this control.

Returns
The control's target bounds within the graphics context

Definition at line 319 of file IControl.h.

Referenced by IGraphicsLiveEdit::OnMouseDown().

◆ GetText()

const IText & IControl::GetText ( ) const
inline

Get the Text object for the control.

Returns
const IText& The control's mText object, typically used to determine font/layout/size etc of the main text in a control.

Definition at line 288 of file IControl.h.

Referenced by IGraphics::PromptUserInput().

◆ GetTextEntryLength()

int IControl::GetTextEntryLength ( ) const
inline

Get the max number of characters that are allowed in text entry.

Returns
int The max number of characters allowed in text entry

Definition at line 303 of file IControl.h.

Referenced by IGraphics::CreateTextEntry().

◆ GetTooltip()

const char * IControl::GetTooltip ( ) const
inline
Returns
Currently set tooltip text

Definition at line 219 of file IControl.h.

◆ GetUI() [1/2]

IGraphics * IControl::GetUI ( )
inline
Returns
A pointer to the IGraphics context that owns this control

Definition at line 467 of file IControl.h.

Referenced by AttachGestureRecognizer(), IPopupMenuControl::CreatePopupMenu(), ICornerResizerControl::Draw(), GetTag(), IPlatformViewControl::Hide(), IWebViewControl::Hide(), IBubbleControl::IBubbleControl(), IVectorBase::MakeRects(), IPlatformViewControl::OnAttached(), IWebViewControl::OnAttached(), TestDropShadowControl::OnDrop(), TestSVGControl::OnDrop(), IGraphicsLiveEdit::OnInit(), ITextEntryControl::OnKeyDown(), IGraphicsLiveEdit::OnKeyDown(), ICornerResizerControl::OnMouseDblClick(), IVNumberBoxControl::OnMouseDblClick(), TestTextControl::OnMouseDblClick(), PlaceHolder::OnMouseDblClick(), IVXYPadControl::OnMouseDown(), IVColorSwatchControl::OnMouseDown(), ICornerResizerControl::OnMouseDown(), ITextEntryControl::OnMouseDown(), IWheelControl::OnMouseDown(), IVNumberBoxControl::OnMouseDown(), ISkLottieControl::OnMouseDown(), TestArcControl::OnMouseDown(), TestCursorControl::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), TestFlexBoxControl::OnMouseDown(), TestImageControl::OnMouseDown(), TestPolyControl::OnMouseDown(), TestSVGControl::OnMouseDown(), IKnobControlBase::OnMouseDown(), ISliderControlBase::OnMouseDown(), IEditableTextControl::OnMouseDown(), IURLControl::OnMouseDown(), IGraphicsLiveEdit::OnMouseDown(), IGraphicsLiveEdit::OnMouseDrag(), ICornerResizerControl::OnMouseOut(), TestCursorControl::OnMouseOut(), IURLControl::OnMouseOut(), ICornerResizerControl::OnMouseOver(), IURLControl::OnMouseOver(), IGraphicsLiveEdit::OnMouseOver(), IVXYPadControl::OnMouseUp(), IVNumberBoxControl::OnMouseUp(), TestArcControl::OnMouseUp(), TestPolyControl::OnMouseUp(), IKnobControlBase::OnMouseUp(), ISliderControlBase::OnMouseUp(), IGraphicsLiveEdit::OnMouseUp(), IGraphicsLiveEdit::OnPopupMenuSelection(), IBButtonControl::OnRescale(), IBSwitchControl::OnRescale(), IBKnobControl::OnRescale(), IBSliderControl::OnRescale(), IBTextControl::OnRescale(), IBMeterControl::OnRescale(), ICornerResizerControl::OnRescale(), IBitmapControl::OnRescale(), TestSizeControl::OnResize(), IGraphicsLiveEdit::OnResize(), PromptUserInput(), IVGroupControl::SetBoundsBasedOnGroup(), ITextControl::SetBoundsBasedOnStr(), SetDirty(), SetValueFromDelegate(), ShowBubbleHorizontalActionFunc(), ShowBubbleVerticalActionFunc(), and SplashClickActionFunc().

◆ GetUI() [2/2]

const IGraphics * IControl::GetUI ( ) const
inline
Returns
A const pointer to the IGraphics context that owns this control

Definition at line 470 of file IControl.h.

◆ GetValIdxForPos()

virtual int IControl::GetValIdxForPos ( float  x,
float  y 
) const
inlinevirtual

Check to see which of the control's values relates to this x and y coordinate.

Parameters
xx coordinate to check
yx coordinate to check
Returns
An integer specifying which value matches the x, y coordinates, or kNoValIdx if the position is not linked to a value.

Reimplemented in IVTrackControlBase.

Definition at line 245 of file IControl.h.

Referenced by OnMouseDblClick(), IVKnobControl::OnMouseDblClick(), IVSliderControl::OnMouseDblClick(), IGraphics::OnMouseDown(), and OnMouseDown().

◆ GetValue()

double IControl::GetValue ( int  valIdx = 0) const

◆ GetWantsGestures()

virtual bool IControl::GetWantsGestures ( ) const
inlinevirtual
Returns
/c true if this control supports gestures (override if you are not calling IControl::AttachGestureRecognizer but are overriding OnGesture())

Definition at line 441 of file IControl.h.

Referenced by IGraphics::OnGestureRecognized(), and IGraphics::RespondsToGesture().

◆ GetWantsMidi()

bool IControl::GetWantsMidi ( ) const
inline
Returns
/c true if this control wants to know about MIDI messages send to the UI. See OnMIDIMsg()

Definition at line 427 of file IControl.h.

Referenced by IGEditorDelegate::SendMidiMsgFromDelegate().

◆ GetWantsMultiTouch()

bool IControl::GetWantsMultiTouch ( ) const
inline
Returns
/c true if this control supports multiple touches

Definition at line 433 of file IControl.h.

◆ Hide()

void IControl::Hide ( bool  hide)
virtual

◆ IsDirty()

bool IControl::IsDirty ( )
virtual

Called at each display refresh by the IGraphics draw loop, after IControl::Animate(), to determine if the control is marked as dirty.

Returns
true if the control is marked dirty.

Reimplemented in IFPSDisplayControl, TestMTControl, and IGraphicsLiveEdit.

Definition at line 231 of file IControl.cpp.

References GetAnimationFunction().

Referenced by TestMTControl::IsDirty(), and IGraphics::IsDirty().

◆ IsDisabled()

bool IControl::IsDisabled ( ) const
inline

◆ IsHidden()

bool IControl::IsHidden ( ) const
inline
Returns
true if the control is hidden.

Definition at line 355 of file IControl.h.

Referenced by IGraphicsLiveEdit::Draw(), IGraphics::SetControlBounds(), IGraphics::SetControlPosition(), and IGraphics::SetControlSize().

◆ IsHit()

virtual bool IControl::IsHit ( float  x,
float  y 
) const
inlinevirtual

Hit test the control.

Override this method if you want the control to be hit only if a visible part of it is hit, or whatever.

Parameters
xThe X coordinate within the control to test
yThe y coordinate within the control to test
Returns
Return true if the control was hit.

Reimplemented in IVButtonControl, IVSwitchControl, IVTabSwitchControl, IVKnobControl, and IVSliderControl.

Definition at line 395 of file IControl.h.

References IRECT::Contains().

◆ LinkedToParam()

int IControl::LinkedToParam ( int  paramIdx) const

Check if the control is linked to a particular parameter.

Parameters
paramIdxThe paramIdx to test
Returns
the valIdx if linked, or kNoValIdx if not

Definition at line 132 of file IControl.cpp.

References NVals().

Referenced by IGraphics::ForControlWithParam(), and IGraphics::GetControlWithParamIdx().

◆ NVals()

int IControl::NVals ( ) const
inline

◆ OnAttached()

virtual void IControl::OnAttached ( )
inlinevirtual

Called after the control has been attached, and its delegate and graphics member variable set.

Use this method for controls that might need to attach sub controls that should be above their parent in the stack

Reimplemented in IVPanelControl, IPlatformViewControl, IVNumberBoxControl, IVBakedPresetManagerControl, IVDiskPresetManagerControl, IVTabbedPagesControl, IWebViewControl, and IContainerBase.

Definition at line 159 of file IControl.h.

Referenced by IGraphics::AttachControl().

◆ OnContextSelection()

virtual void IControl::OnContextSelection ( int  itemSelected)
inlinevirtual

Implement this to respond to a menu selection from CreateContextMenu();.

See also
CreateContextMenu()

Definition at line 184 of file IControl.h.

Referenced by IGraphics::SetControlValueAfterPopupMenu().

◆ OnDrop()

virtual void IControl::OnDrop ( const char *  str)
inlinevirtual

Implement to do something when something was drag 'n dropped onto this control.

Reimplemented in TestDragAndDropControl, TestDropShadowControl, TestImageControl, and TestSVGControl.

Definition at line 144 of file IControl.h.

Referenced by IGraphics::OnDrop(), and OnDropMultiple().

◆ OnDropMultiple()

virtual void IControl::OnDropMultiple ( const std::vector< const char * > &  paths)
inlinevirtual

Implement to handle multiple items drag 'n dropped onto this control.

Reimplemented in TestDragAndDropControl.

Definition at line 147 of file IControl.h.

References OnDrop().

Referenced by IGraphics::OnDropMultiple().

◆ OnEndAnimation()

void IControl::OnEndAnimation ( )
virtual

Definition at line 416 of file IControl.cpp.

◆ OnGesture()

bool IControl::OnGesture ( const IGestureInfo info)
virtual
Returns
true if supports this gesture

Definition at line 320 of file IControl.cpp.

Referenced by IGraphics::OnGestureRecognized().

◆ OnGUIIdle()

virtual void IControl::OnGUIIdle ( )
inlinevirtual

This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined.

Definition at line 418 of file IControl.h.

Referenced by IGraphics::OnGUIIdle().

◆ OnInit()

virtual void IControl::OnInit ( )
inlinevirtual

Called just prior to when the control is attached, after its delegate and graphics member variable set.

Reimplemented in IVSwitchControl, IVTabSwitchControl, IVKnobControl, IVSliderControl, IVGroupControl, IVNumberBoxControl, TestGesturesControl, ISwitchControlBase, ITextControl, and IGraphicsLiveEdit.

Definition at line 156 of file IControl.h.

Referenced by SetDelegate().

◆ OnKeyDown()

virtual bool IControl::OnKeyDown ( float  x,
float  y,
const IKeyPress key 
)
inlinevirtual

Implement this method to respond to a key down event on this control.

Parameters
xThe X coordinate of the mouse at the time of this key down event
yThe Y coordinate of the mouse at the time of this key down event
keyInfo about the keypress

Reimplemented in IAboutBoxControl, ITextEntryControl, TestKeyboardControl, and IGraphicsLiveEdit.

Definition at line 120 of file IControl.h.

Referenced by IGraphics::OnKeyDown().

◆ OnKeyUp()

virtual bool IControl::OnKeyUp ( float  x,
float  y,
const IKeyPress key 
)
inlinevirtual

Implement this method to respond to a key up event on this control.

Parameters
xThe X coordinate of the mouse at the time of this key down event
yThe Y coordinate of the mouse at the time of this key down event
keyInfo about the keypress

Definition at line 126 of file IControl.h.

Referenced by IGraphics::OnKeyUp().

◆ OnMidi()

virtual void IControl::OnMidi ( const IMidiMsg msg)
inlinevirtual

Implement to receive MIDI messages sent to the control if mWantsMidi == true, see IEditorDelegate:SendMidiMsgFromDelegate()

Reimplemented in IVKeyboardControl, and IWheelControl.

Definition at line 165 of file IControl.h.

Referenced by IGEditorDelegate::SendMidiMsgFromDelegate().

◆ OnMouseDblClick()

void IControl::OnMouseDblClick ( float  x,
float  y,
const IMouseMod mod 
)
virtual

Implement this method to respond to a mouse double click event on this control.

Parameters
xThe X coordinate of the mouse event
yThe Y coordinate of the mouse event
modA struct indicating which modifier keys are held for the event

Reimplemented in IVKnobControl, IVSliderControl, ICornerResizerControl, ITextEntryControl, IVNumberBoxControl, TestTextControl, PlaceHolder, and IGraphicsLiveEdit.

Definition at line 258 of file IControl.cpp.

References GetValIdxForPos(), PromptUserInput(), and SetValueToDefault().

Referenced by IGraphics::OnMouseDblClick().

◆ OnMouseDown()

void IControl::OnMouseDown ( float  x,
float  y,
const IMouseMod mod 
)
virtual

◆ OnMouseDrag()

virtual void IControl::OnMouseDrag ( float  x,
float  y,
float  dX,
float  dY,
const IMouseMod mod 
)
inlinevirtual

Implement this method to respond to a mouse drag event on this control.

Parameters
xThe X coordinate of the mouse event
yThe Y coordinate of the mouse event
dXThe X delta (difference) since the last event
dYThe Y delta (difference) since the last event
modA struct indicating which modifier keys are held for the event

Reimplemented in IVRangeSliderControl, IVXYPadControl, IPopupMenuControl, IShaderControl, ITextEntryControl, IVKeyboardControl, IVMultiSliderControl< MAXNC >, IVMultiSliderControl< 1 >, IVNumberBoxControl, TestMTControl, TestTextOrientationControl, TestTextSizeControl, IKnobControlBase, ISliderControlBase, ILambdaControl, IGraphicsLiveEdit, and TestBezierControl.

Definition at line 101 of file IControl.h.

Referenced by IGraphics::OnMouseDrag().

◆ OnMouseOut()

void IControl::OnMouseOut ( )
virtual

◆ OnMouseOver()

void IControl::OnMouseOver ( float  x,
float  y,
const IMouseMod mod 
)
virtual

Implement this method to respond to a mouseover event on this control.

Implementations should call base class, if you wish to use mMouseIsOver.

Parameters
xThe X coordinate of the mouse event
yThe Y coordinate of the mouse event
modA struct indicating which modifier keys are held for the event

Reimplemented in IVTabSwitchControl, IVKnobControl, IVSliderControl, IVRangeSliderControl, IVColorSwatchControl, ICornerResizerControl, IPopupMenuControl, IVKeyboardControl, TestBezierControl, IVTrackControlBase, IURLControl, and IGraphicsLiveEdit.

Definition at line 267 of file IControl.cpp.

References mMouseIsOver, and SetDirty().

Referenced by IGraphics::OnMouseOver(), IVTabSwitchControl::OnMouseOver(), IVKnobControl::OnMouseOver(), IVSliderControl::OnMouseOver(), ICornerResizerControl::OnMouseOver(), and IURLControl::OnMouseOver().

◆ OnMouseUp()

virtual void IControl::OnMouseUp ( float  x,
float  y,
const IMouseMod mod 
)
inlinevirtual

Implement this method to respond to a mouse up event on this control.

Parameters
xThe X coordinate of the mouse event
yThe Y coordinate of the mouse event
modA struct indicating which modifier keys are held for the event

Reimplemented in IVKnobControl, IVSliderControl, IVRangeSliderControl, IVXYPadControl, IShaderControl, ITextEntryControl, IVKeyboardControl, IWheelControl, IVNumberBoxControl, TestArcControl, TestBezierControl, TestKeyboardControl, TestMTControl, TestPolyControl, TestTextOrientationControl, TestTextSizeControl, IKnobControlBase, ISliderControlBase, ISwitchControlBase, ILambdaControl, and IGraphicsLiveEdit.

Definition at line 93 of file IControl.h.

Referenced by IGraphics::OnMouseUp().

◆ OnMouseWheel()

virtual void IControl::OnMouseWheel ( float  x,
float  y,
const IMouseMod mod,
float  d 
)
inlinevirtual

Implement this method to respond to a mouse wheel event on this control.

Parameters
xThe X coordinate of the mouse event
yThe Y coordinate of the mouse event
modA struct indicating which modifier keys are held for the event
dThe delta value (difference) since the last mouse wheel event

Reimplemented in IPopupMenuControl, IWheelControl, IVNumberBoxControl, IKnobControlBase, and ISliderControlBase.

Definition at line 114 of file IControl.h.

Referenced by IGraphics::OnMouseWheel().

◆ OnMsgFromDelegate()

virtual void IControl::OnMsgFromDelegate ( int  msgTag,
int  dataSize,
const void *  pData 
)
inlinevirtual

◆ OnPopupMenuSelection()

void IControl::OnPopupMenuSelection ( IPopupMenu pSelectedMenu,
int  valIdx 
)
virtual

Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput.

Parameters
pSelectedMenuIf pSelectedMenu is invalid it means the user didn't select anything
valIdxAn index that indicates which of the control's vals the menu relates to

Reimplemented in TestDirBrowseControl, IVMenuButtonControl, IVBakedPresetManagerControl, IVDiskPresetManagerControl, IGraphicsLiveEdit, IWheelControl, and TestFlexBoxControl.

Definition at line 283 of file IControl.cpp.

References GetParam(), GetParamIdx(), and SetValueFromUserInput().

Referenced by IVMenuButtonControl::OnPopupMenuSelection(), and IGraphics::SetControlValueAfterPopupMenu().

◆ OnRescale()

virtual void IControl::OnRescale ( )
inlinevirtual

Implement to do something when graphics is scaled globally (e.g.

moves to different DPI screen)

Reimplemented in IBButtonControl, IBSwitchControl, IBKnobControl, IBSliderControl, IBTextControl, IBMeterControl, ICornerResizerControl, IPlatformViewControl, IWebViewControl, TestSizeControl, and IBitmapControl.

Definition at line 150 of file IControl.h.

Referenced by SetDelegate(), and IGraphics::SetScreenScale().

◆ OnResize()

virtual void IControl::OnResize ( )
inlinevirtual

◆ OnTextEntryCompletion()

virtual void IControl::OnTextEntryCompletion ( const char *  str,
int  valIdx 
)
inlinevirtual

Implement this method to handle text input after IGraphics::CreateTextEntry/IControlPromptUserInput.

Parameters
strA CString with the inputted text
valIdxAn index that indicates which of the control's values the text completion relates to

Reimplemented in IVNumberBoxControl, IEditableTextControl, and PlaceHolder.

Definition at line 181 of file IControl.h.

Referenced by IGraphics::SetControlValueAfterTextEdit().

◆ OnTouchCancelled()

virtual void IControl::OnTouchCancelled ( float  x,
float  y,
const IMouseMod mod 
)
inlinevirtual

Implement this method to respond to a touch cancel event on this control.

Parameters
xThe X coordinate of the mouse event
yThe Y coordinate of the mouse event
modA struct indicating which modifier keys are held for the event

Reimplemented in IVKeyboardControl, and TestMTControl.

Definition at line 141 of file IControl.h.

Referenced by IGraphics::OnTouchCancelled().

◆ PromptUserInput() [1/2]

void IControl::PromptUserInput ( const IRECT bounds,
int  valIdx = 0 
)

Create a text entry box so the user can enter a value, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter) specifying the bounds.

Parameters
boundsThe rectangle for the text entry. Pop-up menu's will appear below the rectangle.
valIdxAn index to choose which of the control's linked parameters to retrieve. NOTE: since controls usually have only 1 parameter you can omit this argument and use the default index of 0

Definition at line 357 of file IControl.cpp.

References GetParamIdx(), GetUI(), and IGraphics::PromptUserInput().

◆ PromptUserInput() [2/2]

void IControl::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, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter)

Parameters
valIdxAn index to choose which of the control's linked parameters to retrieve. NOTE: since controls usually have only 1 parameter you can omit this argument and use the default index of 0

Definition at line 334 of file IControl.cpp.

References GetParam(), GetParamIdx(), GetUI(), IRECT::MH(), IRECT::MW(), IGraphics::PromptUserInput(), and SetDirty().

Referenced by IVMenuButtonControl::IVMenuButtonControl(), OnMouseDblClick(), IVKnobControl::OnMouseDblClick(), IVSliderControl::OnMouseDblClick(), OnMouseDown(), IVKnobControl::OnMouseDown(), IVSliderControl::OnMouseDown(), and ICaptionControl::OnMouseDown().

◆ SetActionFunction()

IControl * IControl::SetActionFunction ( IActionFunction  actionFunc)
inline

Set an Action Function for this control.

Parameters
actionFuncA std::function conforming to IActionFunction
Returns
Ptr to this control, for chaining

Definition at line 206 of file IControl.h.

Referenced by IBubbleControl::IBubbleControl(), IPopupMenuControl::IPopupMenuControl(), and IWheelControl::IWheelControl().

◆ SetAnimation() [1/2]

void IControl::SetAnimation ( IAnimationFunction  func)
inline

Set the animation function.

Parameters
funcA std::function conforming to IAnimationFunction

Definition at line 492 of file IControl.h.

Referenced by DefaultClickActionFunc(), IBubbleControl::IBubbleControl(), IPopupMenuControl::IPopupMenuControl(), ILambdaControl::OnMouseDown(), IWheelControl::OnMouseUp(), and SplashClickActionFunc().

◆ SetAnimation() [2/2]

void IControl::SetAnimation ( IAnimationFunction  func,
int  duration 
)
inline

Set the animation function and starts it.

Parameters
funcA std::function conforming to IAnimationFunction
durationDuration in milliseconds for the animation

Definition at line 497 of file IControl.h.

References StartAnimation().

◆ SetAnimationEndActionFunction()

IControl * IControl::SetAnimationEndActionFunction ( IActionFunction  actionFunc)
inline

Set an Action Function to be called at the end of an animation.

Parameters
actionFuncA std::function conforming to IActionFunction
Returns
Ptr to this control, for chaining

Definition at line 211 of file IControl.h.

Referenced by IBubbleControl::IBubbleControl(), IVMenuButtonControl::IVMenuButtonControl(), IVNumberBoxControl::OnAttached(), IVBakedPresetManagerControl::OnAttached(), and IVDiskPresetManagerControl::OnAttached().

◆ SetBlend()

void IControl::SetBlend ( const IBlend blend)
inline

Set the Blend for this control.

This can be used differently by different controls, or not at all. By default it is used to change the opacity of controls when they are disabled

Definition at line 296 of file IControl.h.

◆ SetClean()

virtual void IControl::SetClean ( )
inlinevirtual

Definition at line 404 of file IControl.h.

◆ SetDelegate()

void IControl::SetDelegate ( IGEditorDelegate dlg)
inline

◆ SetDirty()

void IControl::SetDirty ( bool  triggerAction = true,
int  valIdx = kNoValIdx 
)
virtual

Mark the control as dirty, i.e.

it should be redrawn on the next display refresh

Parameters
triggerActionIf this is true and the control is linked to a parameter notify the class implementing the IEditorDelegate interface that the parameter changed. If this control has an ActionFunction, that can also be triggered. NOTE: it is easy to forget that this method always sets the control dirty, the argument refers to whether a consecutive action should be performed

Reimplemented in ITextToggleControl, IVSwitchControl, IVSlideSwitchControl, IVKnobControl, and IVSliderControl.

Definition at line 198 of file IControl.cpp.

References Clip(), ForValIdx(), GetDelegate(), GetParamIdx(), GetUI(), GetValue(), NVals(), IEditorDelegate::SendParameterValueFromUI(), SetValue(), and IGraphics::UpdatePeers().

Referenced by IVPlotControl::AddPlotFunc(), IPopupMenuControl::CalculateMenuPanels(), IGraphics::CreateTextEntry(), Hide(), IBubbleControl::IBubbleControl(), TestDragAndDropControl::OnDrop(), TestDropShadowControl::OnDrop(), TestSVGControl::OnDrop(), TestDragAndDropControl::OnDropMultiple(), TestGesturesControl::OnInit(), IVKeyboardControl::OnMidi(), IWheelControl::OnMidi(), TestTextControl::OnMouseDblClick(), IVTabSwitchControl::OnMouseDown(), IBSwitchControl::OnMouseDown(), IVKeyboardControl::OnMouseDown(), IVMultiSliderControl< MAXNC >::OnMouseDown(), ISkLottieControl::OnMouseDown(), TestAnimationControl::OnMouseDown(), TestCursorControl::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), TestFontControl::OnMouseDown(), TestGradientControl::OnMouseDown(), TestLayerControl::OnMouseDown(), TestMultiPathControl::OnMouseDown(), TestSVGControl::OnMouseDown(), TestTextControl::OnMouseDown(), IButtonControlBase::OnMouseDown(), ISwitchControlBase::OnMouseDown(), IVXYPadControl::OnMouseDrag(), IPopupMenuControl::OnMouseDrag(), IShaderControl::OnMouseDrag(), IVKeyboardControl::OnMouseDrag(), TestMTControl::OnMouseDrag(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), ILambdaControl::OnMouseDrag(), TestBezierControl::OnMouseDrag(), OnMouseOut(), IVTabSwitchControl::OnMouseOut(), IVColorSwatchControl::OnMouseOut(), IVKeyboardControl::OnMouseOut(), IVTrackControlBase::OnMouseOut(), OnMouseOver(), IVTabSwitchControl::OnMouseOver(), IVRangeSliderControl::OnMouseOver(), IVColorSwatchControl::OnMouseOver(), IPopupMenuControl::OnMouseOver(), IVKeyboardControl::OnMouseOver(), TestBezierControl::OnMouseOver(), IVTrackControlBase::OnMouseOver(), IVXYPadControl::OnMouseUp(), IShaderControl::OnMouseUp(), ITextEntryControl::OnMouseUp(), IVKeyboardControl::OnMouseUp(), IVNumberBoxControl::OnMouseUp(), TestMTControl::OnMouseUp(), TestTextOrientationControl::OnMouseUp(), TestTextSizeControl::OnMouseUp(), IKnobControlBase::OnMouseUp(), ISliderControlBase::OnMouseUp(), ISwitchControlBase::OnMouseUp(), ILambdaControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), IBMeterControl::OnMsgFromDelegate(), IRTTextControl< MAXNC, T >::OnMsgFromDelegate(), IVDisplayControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVPeakAvgMeterControl< MAXNC >::OnMsgFromDelegate(), IVScopeControl< MAXNC, MAXBUF >::OnMsgFromDelegate(), TestDirBrowseControl::OnPopupMenuSelection(), TestFlexBoxControl::OnPopupMenuSelection(), IVButtonControl::OnResize(), IVTabSwitchControl::OnResize(), IVXYPadControl::OnResize(), IVPlotControl::OnResize(), IVGroupControl::OnResize(), IVColorSwatchControl::OnResize(), ISVGSliderControl::OnResize(), IBSliderControl::OnResize(), IVDisplayControl::OnResize(), IVKeyboardControl::OnResize(), IVScopeControl< MAXNC, MAXBUF >::OnResize(), ISliderControlBase::OnResize(), IVTrackControlBase::OnResize(), IEditableTextControl::OnTextEntryCompletion(), IVKeyboardControl::OnTouchCancelled(), PromptUserInput(), IGraphics::SetAllControlsDirty(), IURLControl::SetCLColor(), IVectorBase::SetColor(), ITextToggleControl::SetDirty(), IVSwitchControl::SetDirty(), IVKnobControl::SetDirty(), IVSliderControl::SetDirty(), SetDisabled(), IURLControl::SetMOColor(), SetParamIdx(), SetPTParameterHighlight(), ITextControl::SetStr(), ITextControl::SetStrFmt(), SetValueFromDelegate(), IVMenuButtonControl::SetValueFromUserInput(), SetValueFromUserInput(), SetValueToDefault(), SnapToMouse(), IVMultiSliderControl< MAXNC >::SnapToMouse(), and SplashAnimationFunc().

◆ SetDisabled()

void IControl::SetDisabled ( bool  disable)
virtual

Sets disabled mode for the control, the default implementation modifies the mBlend member.

Parameters
disabletrue for disabled

Reimplemented in IContainerBase.

Definition at line 245 of file IControl.cpp.

References SetDirty().

Referenced by IGraphics::DisableControl(), and IContainerBase::SetDisabled().

◆ SetGroup()

void IControl::SetGroup ( const char *  groupName)
inline

Assign the control to a control group.

See also
Control Groups
Parameters
groupNameA CString indicating the control group that this control should belong to

Definition at line 280 of file IControl.h.

References mGroup.

Referenced by IGraphics::AttachControl().

◆ SetIgnoreMouse()

virtual void IControl::SetIgnoreMouse ( bool  ignore)
inlinevirtual

Specify whether the control should respond to mouse events.

Parameters
ignoretrue if it should ignore mouse events

Reimplemented in IWebViewControl.

Definition at line 383 of file IControl.h.

◆ SetMouseEventsWhenDisabled()

void IControl::SetMouseEventsWhenDisabled ( bool  allow)
inline

Specify whether the control should respond to other mouse events when disabled.

Parameters
allowtrue if it should respond to other mouse events when disabled (false by default)

Definition at line 370 of file IControl.h.

◆ SetMouseOverWhenDisabled()

void IControl::SetMouseOverWhenDisabled ( bool  allow)
inline

Specify whether the control should respond to mouse overs when disabled.

Parameters
allowtrue if it should respond to mouse overs when disabled (false by default)

Definition at line 366 of file IControl.h.

◆ SetNVals()

void IControl::SetNVals ( int  nVals)
inlineprotected

Definition at line 566 of file IControl.h.

◆ SetParamIdx()

void IControl::SetParamIdx ( int  paramIdx,
int  valIdx = 0 
)
virtual

Set the index of a parameter that the control is linked to If you are calling this "manually" to reuse a control for multiple parameters, you probably want to call IEditorDelegate::SendCurrentParamValuesFromDelegate() afterward, to update the control values.

Parameters
paramIdxParameter index, or kNoParameter if there is no parameter linked with this control at valIdx
valIdxAn index to choose which of the control's values to set

Definition at line 115 of file IControl.cpp.

References NVals(), and SetDirty().

Referenced by ICaptionControl::ICaptionControl(), and IVTrackControlBase::SetParams().

◆ SetParent()

void IControl::SetParent ( IContainerBase pParent)
inline

Definition at line 464 of file IControl.h.

◆ SetPosition()

void IControl::SetPosition ( float  x,
float  y 
)
virtual

Set the position of the control, preserving the width and height.

This may need to be overriden if you maintain custom positioning data in your control

Parameters
xthe new x coordinate of the top left corner of the control
ythe new y coordinate of the top left corner of the control

Definition at line 291 of file IControl.cpp.

References IRECT::H(), SetRECT(), SetTargetRECT(), and IRECT::W().

Referenced by IGraphics::SetControlPosition().

◆ SetPromptShowsParamLabel()

void IControl::SetPromptShowsParamLabel ( bool  enable)
inline

Set if the control should show parameter labels/units e.g.

"Hz" in text entry prompts

Definition at line 389 of file IControl.h.

◆ SetPTParameterHighlight()

void IControl::SetPTParameterHighlight ( bool  isHighlighted,
int  color 
)

Used internally by the AAX wrapper view interface to set the control parmeter highlight.

Parameters
isHighlighted/c true if the control should be highlighted
colorAn integer representing one of three colors that ProTools assigns automated controls

Definition at line 365 of file IControl.cpp.

References SetDirty().

Referenced by IGraphics::SetPTParameterHighlight().

◆ SetRECT()

void IControl::SetRECT ( const IRECT bounds)
inline

Set the rectangular draw area for this control, within the graphics context.

Parameters
boundsThe control's bounds

Definition at line 315 of file IControl.h.

References mMouseIsOver, and OnResize().

Referenced by IPopupMenuControl::CalculateMenuPanels(), IGraphicsLiveEdit::OnMouseUp(), and SetPosition().

◆ SetSize()

void IControl::SetSize ( float  w,
float  h 
)
virtual

Set the size of the control, preserving the current position.

This may need to be overriden if you maintain custom positioning data in your control, or if your TargetRECT is not the same as the main RECT.

Parameters
wthe new width of the control
hthe new height of the control

Definition at line 303 of file IControl.cpp.

References SetTargetAndDrawRECTs().

Referenced by IGraphics::SetControlSize().

◆ SetTargetAndDrawRECTs()

void IControl::SetTargetAndDrawRECTs ( const IRECT bounds)
inline

Set BOTH the draw rect and the target area, within the graphics context for this control.

Parameters
boundsThe control's new draw and target bounds within the graphics context

Definition at line 327 of file IControl.h.

References mMouseIsOver, and OnResize().

Referenced by IVMenuButtonControl::IVMenuButtonControl(), IVTabbedPagesControl::OnAttached(), ICornerResizerControl::OnRescale(), IVNumberBoxControl::OnResize(), IVBakedPresetManagerControl::OnResize(), IVDiskPresetManagerControl::OnResize(), IVTabbedPagesControl::OnResize(), IBubbleControl::ResetBounds(), ITextControl::SetBoundsBasedOnStr(), IGraphics::SetControlBounds(), and SetSize().

◆ SetTargetRECT()

void IControl::SetTargetRECT ( const IRECT bounds)
inline

◆ SetText()

virtual void IControl::SetText ( const IText txt)
inlinevirtual

Set the Text object typically used to determine font/layout/size etc of the main text in a control.

Parameters
txtAn IText struct with the desired formatting

Reimplemented in IURLControl.

Definition at line 292 of file IControl.h.

◆ SetTextEntryLength()

void IControl::SetTextEntryLength ( int  len)
inline

Set the max number of characters that are allowed in text entry.

Parameters
lenThe max number of characters allowed in text entry

Definition at line 307 of file IControl.h.

◆ SetTooltip()

IControl * IControl::SetTooltip ( const char *  str)
inline

Set a tooltip for the control.

Parameters
strCString tooltip to be displayed
Returns
Ptr to this control, for chaining

Definition at line 216 of file IControl.h.

◆ SetValue()

void IControl::SetValue ( double  value,
int  valIdx = 0 
)
virtual

◆ SetValueFromDelegate()

void IControl::SetValueFromDelegate ( double  value,
int  valIdx = 0 
)
virtual

Set the control's value from the delegate This method is called from the class implementing the IEditorDelegate interface in order to update a control's value members and set it to be marked dirty for redraw.

Parameters
valueNormalised incoming value
valIdxThe index of the value to set, which should be between 0 and NVals()

Reimplemented in IVMenuButtonControl, and IVNumberBoxControl.

Definition at line 159 of file IControl.cpp.

References GetUI(), GetValue(), SetDirty(), and SetValue().

Referenced by IGEditorDelegate::SendControlValueFromDelegate(), IGEditorDelegate::SendParameterValueFromDelegate(), IVMenuButtonControl::SetValueFromDelegate(), and IVNumberBoxControl::SetValueFromDelegate().

◆ SetValueFromUserInput()

void IControl::SetValueFromUserInput ( double  value,
int  valIdx = 0 
)
virtual

Set the control's value after user input.

This method is called after a text entry or popup menu prompt triggered by PromptUserInput(), calling SetDirty(true), which will mean that the new value gets sent back to the delegate

Parameters
valuethe normalised value after user input via text entry or pop-up menu
valIdxAn index to choose which of the control's linked parameters to retrieve. NOTE: since controls usually have only 1 parameter you can omit this argument and use the default index of 0

Reimplemented in IVMenuButtonControl, and IVNumberBoxControl.

Definition at line 174 of file IControl.cpp.

References GetValue(), SetDirty(), and SetValue().

Referenced by OnPopupMenuSelection(), IGraphics::SetControlValueAfterTextEdit(), and IVNumberBoxControl::SetValueFromUserInput().

◆ SetValueToDefault()

void IControl::SetValueToDefault ( int  valIdx = kNoValIdx)
virtual

Set one or all of the control's values to the default value of the associated parameter.

Parameters
valIdxeither an integer > -1 (kNoValIdx) in order to set an individual value to the default value of the associated parameter, or kNoValIdx to default all values This method will call through to SetDirty(true, valIdx), which will mean that the new value gets sent back to the delegate

Definition at line 183 of file IControl.cpp.

References ForValIdx(), IParam::GetDefault(), GetParam(), NVals(), SetDirty(), and SetValue().

Referenced by OnMouseDblClick(), IVKnobControl::OnMouseDblClick(), and IVSliderControl::OnMouseDblClick().

◆ SetWantsMidi()

void IControl::SetWantsMidi ( bool  enable = true)
inline

Specify whether this control wants to know about MIDI messages sent to the UI.

See OnMIDIMsg()

Definition at line 424 of file IControl.h.

Referenced by IWheelControl::IWheelControl().

◆ SetWantsMultiTouch()

void IControl::SetWantsMultiTouch ( bool  enable = true)
inline

Specify whether this control supports multiple touches.

Definition at line 430 of file IControl.h.

◆ SnapToMouse()

void IControl::SnapToMouse ( float  x,
float  y,
EDirection  direction,
const IRECT bounds,
int  valIdx = -1,
double  minClip = 0.,
double  maxClip = 1. 
)
virtual

Set control value based on x, y position within a rectangle.

Commonly used for slider/fader controls.

Parameters
xThe X coordinate for snapping
yThe Y coordinate for snapping
directionThe direction of the control's travel- horizontal or vertical fader
boundsThe area in which the track of e.g. a slider should be snapped
valIdxThe value that the current mouse gesture should snap

Reimplemented in IVMultiSliderControl< MAXNC >, and IVMultiSliderControl< 1 >.

Definition at line 397 of file IControl.cpp.

References Clip(), IRECT::Constrain(), ForValIdx(), IRECT::H(), SetDirty(), SetValue(), and IRECT::W().

Referenced by ISliderControlBase::OnMouseDown(), IVRangeSliderControl::OnMouseDrag(), and ISliderControlBase::OnMouseDrag().

◆ StartAnimation()

void IControl::StartAnimation ( int  duration)
Parameters
durationDuration in milliseconds for the animation

Definition at line 425 of file IControl.cpp.

Referenced by SetAnimation().

Member Data Documentation

◆ mBlend

IBlend IControl::mBlend
protected

Definition at line 546 of file IControl.h.

◆ mDblAsSingleClick

bool IControl::mDblAsSingleClick = false
protected

Definition at line 552 of file IControl.h.

◆ mDirty

bool IControl::mDirty = true
protected

Definition at line 548 of file IControl.h.

◆ mDisabled

bool IControl::mDisabled = false
protected

Definition at line 550 of file IControl.h.

◆ mDisablePrompt

bool IControl::mDisablePrompt = true
protected

Definition at line 551 of file IControl.h.

◆ mGroup

WDL_String IControl::mGroup
protected

Controls can be grouped for hiding and showing panels.

Definition at line 543 of file IControl.h.

Referenced by GetGroup(), and SetGroup().

◆ mHide

bool IControl::mHide = false
protected

Definition at line 549 of file IControl.h.

◆ mIgnoreMouse

bool IControl::mIgnoreMouse = false
protected

Definition at line 555 of file IControl.h.

◆ mMouseEventsWhenDisabled

bool IControl::mMouseEventsWhenDisabled = false
protected

Definition at line 554 of file IControl.h.

◆ mMouseIsOver

bool IControl::mMouseIsOver = false
protected

◆ mMouseOverWhenDisabled

bool IControl::mMouseOverWhenDisabled = false
protected

Definition at line 553 of file IControl.h.

◆ mPromptShowsParamLabel

bool IControl::mPromptShowsParamLabel = false
protected

Definition at line 558 of file IControl.h.

◆ mPTHighlightColor

IColor IControl::mPTHighlightColor = COLOR_RED
protected

Definition at line 563 of file IControl.h.

◆ mPTisHighlighted

bool IControl::mPTisHighlighted = false
protected

Definition at line 564 of file IControl.h.

◆ mRECT

IRECT IControl::mRECT
protected

Definition at line 539 of file IControl.h.

◆ mTargetRECT

IRECT IControl::mTargetRECT
protected

Definition at line 540 of file IControl.h.

◆ mText

IText IControl::mText
protected

Definition at line 545 of file IControl.h.

◆ mTextEntryLength

int IControl::mTextEntryLength = DEFAULT_TEXT_ENTRY_LEN
protected

Definition at line 547 of file IControl.h.

◆ mTooltip

WDL_String IControl::mTooltip
protected

Definition at line 561 of file IControl.h.

◆ mWantsMidi

bool IControl::mWantsMidi = false
protected

Definition at line 556 of file IControl.h.

◆ mWantsMultiTouch

bool IControl::mWantsMultiTouch = false
protected

Definition at line 557 of file IControl.h.


The documentation for this class was generated from the following files: