iPlug 2: IControl Class Reference
The lowest level base class of an IGraphics control. More...
#include <IControl.h>
Inherited by GFXLabelControl, IBitmapControl, IBubbleControl, IButtonControlBase, IColorPickerControl, IContainerBase, ICornerResizerControl, IFPSDisplayControl, IGraphicsLiveEdit, IKnobControlBase, ILEDControl, ILambdaControl, IPlatformViewControl, IPopupMenuControl, ISVGControl, IShaderControl, ISkLottieControl, ISkParagraphControl, ISliderControlBase, ISwitchControlBase, ITextControl, ITextEntryControl, IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVColorSwatchControl, IVDisplayControl, IVKeyboardControl, IVPlotControl, IVScopeControl< MAXNC, MAXBUF >, IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVTrackControlBase, IVXYPadControl, IWebViewControl, TestAnimationControl, TestBezierControl, TestColorControl, TestCursorControl, TestCustomShaderControl, TestDragAndDropControl, TestDrawContextControl, TestDropShadowControl, TestFlexBoxControl, TestFontControl, TestImageControl, TestKeyboardControl, TestMPSControl, TestMTControl, TestSVGControl, TestShadowGradientControl, TestSizeControl, and TestTextControl.
Public Member Functions | |
| IControl (const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr) | |
| Constructor. More... | |
| IControl (const IRECT &bounds, const std::initializer_list< int > ¶ms, 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 | OnDeleteFromPopupMenu (IPopupMenu *pMenu, int itemIdx) |
| Implement this method to handle popup menu deletion interactions (on IOS) 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... | |
| IControl * | SetActionFunction (IActionFunction actionFunc) |
| Set an Action Function for this control. More... | |
| IControl * | SetAnimationEndActionFunction (IActionFunction actionFunc) |
| Set an Action Function to be called at the end of an animation. More... | |
| IControl * | SetTooltip (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 IParam * | GetParam (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 IText & | GetText () 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 IRECT & | GetRECT () 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 IRECT & | GetTargetRECT () 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 |
| IControl * | AttachGestureRecognizer (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 |
| IGEditorDelegate * | GetDelegate () |
| 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... | |
| IContainerBase * | GetParent () const |
| void | SetParent (IContainerBase *pParent) |
| IGraphics * | GetUI () |
| const IGraphics * | GetUI () 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 |
The lowest level base class of an IGraphics control.
A control is anything on the GUI
Definition at line 44 of file IControl.h.
◆ 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
-
bounds The rectangular area that the control occupies paramIdx If this is > -1 (kNoParameter) this control will be associated with a plugin parameter actionFunc pass 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::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
-
bounds The rectangular area that the control occupies params An initializer list of valid integer parameter indexes actionFunc pass 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
-
bounds The rectangular area that the control occupies actionFunc pass 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()
|
inlinevirtual |
Destructor.
Clean up any resources that your control owns.
Definition at line 81 of file IControl.h.
◆ Animate()
| void IControl::Animate | ( | ) |
◆ As()
template<class T >
|
inline |
◆ AttachGestureRecognizer()
| IControl * IControl::AttachGestureRecognizer | ( | EGestureType | type, |
| IGestureFunc | func | ||
| ) |
◆ CreateContextMenu()
|
inlinevirtual |
◆ DisablePrompt()
|
inline |
Disable/enable default prompt for user input.
- Parameters
-
disable Set true to disable prompt
Definition at line 420 of file IControl.h.
◆ Draw()
|
pure virtual |
Draw the control to the graphics context.
- Parameters
-
g The 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, IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVDisplayControl, IVKeyboardControl, IWheelControl, IVMeterControl< MAXNC >, IVMeterControl< MAXNC >, IVMeterControl< 1 >, IVMultiSliderControl< MAXNC >, IVMultiSliderControl< 1 >, IVNumberBoxControl, IVBakedPresetManagerControl, IVDiskPresetManagerControl, IVScopeControl< MAXNC, MAXBUF >, IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, 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()
|
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
-
g The graphics context to which this control belongs.
Definition at line 389 of file IControl.cpp.
References IGraphics::FillCircle().
◆ ForValIdx()
template<typename T , typename... Args>
|
inlineprotected |
A helper template function to call a method for an individual value, or for all values.
- Parameters
-
valIdx If this is > kNoValIdx execute the function for an individual value. If equal to kNoValIdx call the function for all values func A function that takes a single integer argument, the value index args Arguments to the function
Definition at line 532 of file IControl.h.
References NVals().
Referenced by SetDirty(), SetValueToDefault(), and SnapToMouse().
◆ GetActionFunction()
|
inline |
Get the control's action function, if it exists.
Definition at line 508 of file IControl.h.
◆ GetAnimationDuration()
|
inline |
Get the duration of animations applied to the control.
Definition at line 514 of file IControl.h.
◆ GetAnimationFunction()
|
inline |
◆ GetAnimationProgress()
| double IControl::GetAnimationProgress | ( | ) | const |
◆ GetBlend()
|
inline |
◆ GetDelegate()
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 454 of file IControl.h.
Referenced by IWheelControl::IWheelControl(), IVNumberBoxControl::OnMouseDown(), IVNumberBoxControl::OnMouseUp(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnPopupMenuSelection(), IVBakedPresetManagerControl::OnPopupMenuSelection(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnPopupMenuSelection(), IWheelControl::OnPopupMenuSelection(), SetDirty(), and IVTrackControlBase::SetParamsByGroup().
◆ GetGroup()
|
inline |
◆ GetIgnoreMouse()
|
inline |
- Returns
trueif the control ignores mouse events
Definition at line 384 of file IControl.h.
◆ GetLastGesture()
|
inline |
- Returns
- the last recognized gesture
Definition at line 449 of file IControl.h.
◆ GetMouseDblAsSingleClick()
|
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 353 of file IControl.h.
Referenced by IGraphics::OnMouseDblClick().
◆ GetMouseEventsWhenDisabled()
|
inline |
- Returns
trueif the control responds to other mouse events when disabled
Definition at line 381 of file IControl.h.
◆ GetMouseIsOver()
|
inline |
◆ GetMouseOverWhenDisabled()
|
inline |
- Returns
trueif the control responds to mouse overs when disabled
Definition at line 378 of file IControl.h.
◆ GetParam()
| const IParam * IControl::GetParam | ( | int | valIdx = 0 | ) | const |
Get a const pointer to the IParam object (owned by the editor delegate class), associated with this control.
- Returns
- const pointer to an IParam or nullptr if the control is not associated with a parameter
Definition at line 122 of file IControl.cpp.
References IEditorDelegate::GetParam(), and GetParamIdx().
Referenced by ICaptionControl::Draw(), IVMenuButtonControl::IVMenuButtonControl(), IVSwitchControl::OnInit(), IVTabSwitchControl::OnInit(), IVKnobControl::OnInit(), IVSliderControl::OnInit(), IVNumberBoxControl::OnInit(), ISwitchControlBase::OnInit(), ITextEntryControl::OnKeyDown(), IVNumberBoxControl::OnMouseDown(), ISliderControlBase::OnMouseDown(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), IVNumberBoxControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), OnPopupMenuSelection(), ICaptionControl::OnResize(), IGraphics::PromptUserInput(), PromptUserInput(), IGraphics::SetControlValueAfterTextEdit(), IVSwitchControl::SetDirty(), IVKnobControl::SetDirty(), IVSliderControl::SetDirty(), IVTrackControlBase::SetParams(), IVMenuButtonControl::SetValueFromDelegate(), IVNumberBoxControl::SetValueFromDelegate(), IVMenuButtonControl::SetValueFromUserInput(), IVNumberBoxControl::SetValueFromUserInput(), SetValueToDefault(), ShowBubbleHorizontalActionFunc(), and ShowBubbleVerticalActionFunc().
◆ 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
-
valIdx An 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()
◆ GetPromptShowsParamLabel()
|
inline |
◆ GetRECT()
|
inline |
Get the rectangular draw area for this control, within the graphics context.
- Returns
- The control's bounds
Definition at line 316 of file IControl.h.
Referenced by IVNumberBoxControl::Draw(), IGraphicsLiveEdit::Draw(), IBitmapBase::DrawBitmap(), IGraphics::IsDirty(), IVNumberBoxControl::OnMouseDblClick(), IGraphicsLiveEdit::OnMouseDown(), IGraphicsLiveEdit::OnMouseDrag(), IGraphicsLiveEdit::OnMouseOver(), IGraphicsLiveEdit::OnMouseUp(), IVNumberBoxControl::OnResize(), ShowBubbleHorizontalActionFunc(), ShowBubbleVerticalActionFunc(), and IGraphics::StartLayer().
◆ GetTag()
|
inline |
◆ GetTargetRECT()
|
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 324 of file IControl.h.
Referenced by IGraphicsLiveEdit::OnMouseDown().
◆ GetText()
|
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 293 of file IControl.h.
Referenced by IGraphics::PromptUserInput().
◆ GetTextEntryLength()
|
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 308 of file IControl.h.
Referenced by IGraphics::CreateTextEntry().
◆ GetTooltip()
|
inline |
- Returns
- Currently set tooltip text
Definition at line 224 of file IControl.h.
◆ GetUI() [1/2]
- Returns
- A pointer to the IGraphics context that owns this control
Definition at line 472 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(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMouseDown(), IWheelControl::OnMouseDown(), IVNumberBoxControl::OnMouseDown(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::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]
|
inline |
- Returns
- A const pointer to the IGraphics context that owns this control
Definition at line 475 of file IControl.h.
◆ GetValIdxForPos()
|
inlinevirtual |
◆ GetValue()
| double IControl::GetValue | ( | int | valIdx = 0 | ) | const |
Get the control's value.
- Returns
- Value of the control, normalized in the range 0-1
- Parameters
-
valIdx The index of the value to set, which should be between 0 and NVals()
Definition at line 153 of file IControl.cpp.
References NVals().
Referenced by ISVGKnobControl::Draw(), ISVGButtonControl::Draw(), ISVGToggleControl::Draw(), ISVGSliderControl::Draw(), IBKnobRotaterControl::Draw(), ILEDControl::Draw(), IWheelControl::Draw(), TestArcControl::Draw(), TestBlendControl::Draw(), TestGradientControl::Draw(), TestLayerControl::Draw(), TestMultiPathControl::Draw(), TestPolyControl::Draw(), TestTextOrientationControl::Draw(), TestTextSizeControl::Draw(), IBitmapBase::DrawBitmap(), IVToggleControl::DrawValue(), IVButtonControl::DrawWidget(), IVToggleControl::DrawWidget(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), IVRangeSliderControl::DrawWidget(), IVXYPadControl::DrawWidget(), IWheelControl::IWheelControl(), IBSwitchControl::OnMouseDown(), IVMultiSliderControl< MAXNC >::OnMouseDown(), IKnobControlBase::OnMouseDown(), ISliderControlBase::OnMouseDown(), ISwitchControlBase::OnMouseDown(), ITextToggleControl::OnMouseDown(), IVRangeSliderControl::OnMouseDrag(), IWheelControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), ITextToggleControl::SetDirty(), SetDirty(), SetValueFromDelegate(), IVMenuButtonControl::SetValueFromUserInput(), SetValueFromUserInput(), IVMultiSliderControl< MAXNC >::SnapToMouse(), and IGraphics::UpdatePeers().
◆ GetWantsGestures()
|
inlinevirtual |
◆ GetWantsMidi()
|
inline |
◆ GetWantsMultiTouch()
|
inline |
- Returns
- /c true if this control supports multiple touches
Definition at line 438 of file IControl.h.
◆ Hide()
|
virtual |
◆ IsDirty()
|
virtual |
◆ IsDisabled()
|
inline |
- Returns
trueif the control is disabled
Definition at line 367 of file IControl.h.
Referenced by IVLabelControl::Draw(), IVKeyboardControl::Draw(), IGraphicsLiveEdit::Draw(), IVButtonControl::DrawWidget(), IVSwitchControl::DrawWidget(), IVToggleControl::DrawWidget(), IVTabSwitchControl::DrawWidget(), IVRadioButtonControl::DrawWidget(), IVNumberBoxControl::OnMouseDblClick(), IBMeterControl::OnMsgFromDelegate(), IRTTextControl< MAXNC, T >::OnMsgFromDelegate(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMsgFromDelegate(), IVDisplayControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVPeakAvgMeterControl< MAXNC >::OnMsgFromDelegate(), IVMultiSliderControl< MAXNC >::OnMsgFromDelegate(), IVScopeControl< MAXNC, MAXBUF >::OnMsgFromDelegate(), and IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMsgFromDelegate().
◆ IsHidden()
|
inline |
◆ IsHit()
|
inlinevirtual |
◆ LinkedToParam()
| int IControl::LinkedToParam | ( | int | paramIdx | ) | const |
◆ NVals()
|
inline |
- Returns
- The number of values for this control
Definition at line 244 of file IControl.h.
Referenced by IVRangeSliderControl::DrawWidget(), IVTrackControlBase::DrawWidget(), ForValIdx(), GetParamIdx(), IVTrackControlBase::GetValIdxForPos(), GetValue(), LinkedToParam(), IGraphics::OnMouseDown(), IVRangeSliderControl::OnMouseDrag(), IVRangeSliderControl::OnMouseOver(), IGraphics::OnMouseUp(), IGEditorDelegate::SendParameterValueFromDelegate(), IGraphics::SetControlValueAfterPopupMenu(), SetDirty(), SetParamIdx(), SetValue(), SetValueToDefault(), and IVMultiSliderControl< MAXNC >::SnapToMouse().
◆ OnAttached()
|
inlinevirtual |
◆ OnContextSelection()
|
inlinevirtual |
◆ OnDeleteFromPopupMenu()
|
inlinevirtual |
◆ OnDrop()
|
inlinevirtual |
◆ OnDropMultiple()
|
inlinevirtual |
◆ OnEndAnimation()
|
virtual |
◆ OnGesture()
|
virtual |
◆ OnGUIIdle()
|
inlinevirtual |
◆ 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()
|
inlinevirtual |
◆ OnKeyUp()
|
inlinevirtual |
Implement this method to respond to a key up event on this control.
- Parameters
-
x The X coordinate of the mouse at the time of this key down event y The Y coordinate of the mouse at the time of this key down event key Info about the keypress
Definition at line 126 of file IControl.h.
Referenced by IGraphics::OnKeyUp().
◆ OnMidi()
|
inlinevirtual |
◆ OnMouseDblClick()
|
virtual |
◆ OnMouseDown()
|
virtual |
Implement this method to respond to a mouse down event on this control.
- Parameters
-
x The X coordinate of the mouse event y The Y coordinate of the mouse event mod A struct indicating which modifier keys are held for the event
Reimplemented in IAboutBoxControl, IColorPickerControl, IVTabSwitchControl, IVKnobControl, IVSliderControl, IVRangeSliderControl, IVXYPadControl, IVColorSwatchControl, IBSwitchControl, ICornerResizerControl, IFPSDisplayControl, IPlatformViewControl, IPopupMenuControl, IShaderControl, ITextEntryControl, IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVKeyboardControl, IWheelControl, IVMultiSliderControl< MAXNC >, IVMultiSliderControl< 1 >, IVNumberBoxControl, IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, ISkLottieControl, TestAnimationControl, TestArcControl, TestBezierControl, TestCursorControl, TestDirBrowseControl, TestFlexBoxControl, TestFontControl, TestGradientControl, TestImageControl, TestKeyboardControl, TestLayerControl, TestMultiPathControl, TestMTControl, TestPolyControl, TestSVGControl, TestTextControl, TestTextOrientationControl, TestTextSizeControl, IKnobControlBase, ISliderControlBase, IButtonControlBase, ISwitchControlBase, ILambdaControl, IEditableTextControl, IURLControl, ITextToggleControl, ICaptionControl, and IGraphicsLiveEdit.
Definition at line 252 of file IControl.cpp.
References GetValIdxForPos(), and PromptUserInput().
Referenced by IGraphics::OnMouseDown(), IPopupMenuControl::OnMouseDown(), IKnobControlBase::OnMouseDown(), and ISliderControlBase::OnMouseDown().
◆ OnMouseDrag()
|
inlinevirtual |
Implement this method to respond to a mouse drag event on this control.
- Parameters
-
x The X coordinate of the mouse event y The Y coordinate of the mouse event dX The X delta (difference) since the last event dY The Y delta (difference) since the last event mod A 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()
|
virtual |
Implement this method to respond to a mouseout event on this control.
Implementations should call base class, if you wish to use mMouseIsOver.
Reimplemented in IVSwitchControl, IVTabSwitchControl, IVKnobControl, IVSliderControl, IVRangeSliderControl, IVColorSwatchControl, ICornerResizerControl, IPopupMenuControl, IVKeyboardControl, TestCursorControl, IVTrackControlBase, and IURLControl.
Definition at line 275 of file IControl.cpp.
References mMouseIsOver, and SetDirty().
Referenced by IGraphics::OnMouseOut(), IVSwitchControl::OnMouseOut(), IVTabSwitchControl::OnMouseOut(), IVKnobControl::OnMouseOut(), IVSliderControl::OnMouseOut(), ICornerResizerControl::OnMouseOut(), TestCursorControl::OnMouseOut(), IURLControl::OnMouseOut(), and IGraphics::OnMouseOver().
◆ OnMouseOver()
|
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
-
x The X coordinate of the mouse event y The Y coordinate of the mouse event mod A struct indicating which modifier keys are held for the event
Reimplemented in IVTabSwitchControl, IVKnobControl, IVSliderControl, IVRangeSliderControl, IVColorSwatchControl, ICornerResizerControl, IPopupMenuControl, IVKeyboardControl, IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, 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()
|
inlinevirtual |
Implement this method to respond to a mouse up event on this control.
- Parameters
-
x The X coordinate of the mouse event y The Y coordinate of the mouse event mod A 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()
|
inlinevirtual |
◆ OnMsgFromDelegate()
|
inlinevirtual |
Implement to receive messages sent to the control, see IEditorDelegate:SendControlMsgFromDelegate()
Reimplemented in IBMeterControl, IRTTextControl< MAXNC, T >, IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVDisplayControl, IVMeterControl< MAXNC >, IVMeterControl< MAXNC >, IVMeterControl< 1 >, IVPeakAvgMeterControl< MAXNC >, IVPeakAvgMeterControl< 1 >, IVMultiSliderControl< MAXNC >, IVMultiSliderControl< 1 >, IVScopeControl< MAXNC, MAXBUF >, and IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >.
Definition at line 162 of file IControl.h.
Referenced by IGEditorDelegate::SendControlMsgFromDelegate().
◆ OnPopupMenuSelection()
|
virtual |
Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput.
- Parameters
-
pSelectedMenu If pSelectedMenu is invalid it means the user didn't select anything valIdx An index that indicates which of the control's vals the menu relates to
Reimplemented in TestDirBrowseControl, IVMenuButtonControl, IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVBakedPresetManagerControl, IVDiskPresetManagerControl, IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, 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()
|
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()
|
inlinevirtual |
Called when IControl is constructed or resized using SetRect().
NOTE: if you call SetDirty() in this method, you should call SetDirty(false) to avoid triggering parameter changes
Reimplemented in IVButtonControl, IVSwitchControl, IVSlideSwitchControl, IVTabSwitchControl, IVKnobControl, IVSliderControl, IVXYPadControl, IVPlotControl, IVGroupControl, IVPanelControl, IVColorSwatchControl, ISVGSliderControl, IBSliderControl, IPlatformViewControl, IShaderControl, IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVDisplayControl, IVKeyboardControl, IVNumberBoxControl, IVBakedPresetManagerControl, IVDiskPresetManagerControl, IVScopeControl< MAXNC, MAXBUF >, IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >, IVTabbedPagesControl, IWebViewControl, TestColorControl, TestDirBrowseControl, TestFlexBoxControl, TestGradientControl, TestSizeControl, IContainerBase, ISliderControlBase, IVTrackControlBase, ICaptionControl, PlaceHolder, and IGraphicsLiveEdit.
Definition at line 153 of file IControl.h.
Referenced by IGraphics::Resize(), SetDelegate(), SetRECT(), and SetTargetAndDrawRECTs().
◆ OnTextEntryCompletion()
|
inlinevirtual |
◆ OnTouchCancelled()
|
inlinevirtual |
Implement this method to respond to a touch cancel event on this control.
- Parameters
-
x The X coordinate of the mouse event y The Y coordinate of the mouse event mod A 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
-
bounds The rectangle for the text entry. Pop-up menu's will appear below the rectangle. valIdx An 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
-
valIdx An 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()
|
inline |
◆ SetAnimation() [1/2]
|
inline |
◆ SetAnimation() [2/2]
|
inline |
Set the animation function and starts it.
- Parameters
-
func A std::function conforming to IAnimationFunction duration Duration in milliseconds for the animation
Definition at line 502 of file IControl.h.
References StartAnimation().
◆ SetAnimationEndActionFunction()
|
inline |
◆ SetBlend()
|
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 301 of file IControl.h.
◆ SetClean()
|
inlinevirtual |
◆ SetDelegate()
◆ SetDirty()
|
virtual |
Mark the control as dirty, i.e.
it should be redrawn on the next display refresh
- Parameters
-
triggerAction If 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(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnResize(), IVDisplayControl::OnResize(), IVKeyboardControl::OnResize(), IVScopeControl< MAXNC, MAXBUF >::OnResize(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnResize(), ISliderControlBase::OnResize(), IVTrackControlBase::OnResize(), IEditableTextControl::OnTextEntryCompletion(), IVKeyboardControl::OnTouchCancelled(), PromptUserInput(), IGraphics::SetAllControlsDirty(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetBarPattern(), IURLControl::SetCLColor(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetClipIndicator(), 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()
|
virtual |
◆ SetGroup()
|
inline |
Assign the control to a control group.
- See also
- Control Groups
- Parameters
-
groupName A CString indicating the control group that this control should belong to
Definition at line 285 of file IControl.h.
References mGroup.
Referenced by IGraphics::AttachControl().
◆ SetIgnoreMouse()
|
inlinevirtual |
Specify whether the control should respond to mouse events.
- Parameters
-
ignore trueif it should ignore mouse events
Reimplemented in IWebViewControl.
Definition at line 388 of file IControl.h.
◆ SetMouseEventsWhenDisabled()
|
inline |
Specify whether the control should respond to other mouse events when disabled.
- Parameters
-
allow trueif it should respond to other mouse events when disabled (false by default)
Definition at line 375 of file IControl.h.
◆ SetMouseOverWhenDisabled()
|
inline |
Specify whether the control should respond to mouse overs when disabled.
- Parameters
-
allow trueif it should respond to mouse overs when disabled (false by default)
Definition at line 371 of file IControl.h.
◆ SetNVals()
|
inlineprotected |
◆ SetParamIdx()
|
virtual |
◆ SetParent()
◆ SetPosition()
|
virtual |
◆ SetPromptShowsParamLabel()
|
inline |
Set if the control should show parameter labels/units e.g.
"Hz" in text entry prompts
Definition at line 394 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 color An 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()
|
inline |
◆ SetSize()
|
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
-
w the new width of the control h the new height of the control
Definition at line 303 of file IControl.cpp.
References SetTargetAndDrawRECTs().
Referenced by IGraphics::SetControlSize().
◆ SetTargetAndDrawRECTs()
|
inline |
Set BOTH the draw rect and the target area, within the graphics context for this control.
- Parameters
-
bounds The control's new draw and target bounds within the graphics context
Definition at line 332 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()
|
inline |
Set the rectangular mouse tracking target area, within the graphics context for this control.
- Parameters
-
bounds The control's new target bounds within the graphics context
Definition at line 328 of file IControl.h.
References mMouseIsOver.
Referenced by IPopupMenuControl::CalculateMenuPanels(), IGraphicsLiveEdit::OnMouseUp(), IVButtonControl::OnResize(), IVSwitchControl::OnResize(), IVTabSwitchControl::OnResize(), IVKnobControl::OnResize(), IVSliderControl::OnResize(), IVXYPadControl::OnResize(), IVPlotControl::OnResize(), IVGroupControl::OnResize(), IVPanelControl::OnResize(), IVColorSwatchControl::OnResize(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnResize(), IVDisplayControl::OnResize(), IVNumberBoxControl::OnResize(), IVScopeControl< MAXNC, MAXBUF >::OnResize(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnResize(), IVTabbedPagesControl::OnResize(), ISliderControlBase::OnResize(), IVTrackControlBase::OnResize(), IGraphicsLiveEdit::OnResize(), and SetPosition().
◆ SetText()
|
inlinevirtual |
Set the Text object typically used to determine font/layout/size etc of the main text in a control.
- Parameters
-
txt An IText struct with the desired formatting
Reimplemented in IURLControl.
Definition at line 297 of file IControl.h.
◆ SetTextEntryLength()
|
inline |
Set the max number of characters that are allowed in text entry.
- Parameters
-
len The max number of characters allowed in text entry
Definition at line 312 of file IControl.h.
◆ SetTooltip()
|
inline |
Set a tooltip for the control.
- Parameters
-
str CString tooltip to be displayed
- Returns
- Ptr to this control, for chaining
Definition at line 221 of file IControl.h.
◆ SetValue()
|
virtual |
Set one of the control's values.
- Parameters
-
value The normalized 0-1 value valIdx The index of the value to set, which should be between 0 and NVals()
Definition at line 147 of file IControl.cpp.
References NVals().
Referenced by IVSlideSwitchControl::IVSlideSwitchControl(), IWheelControl::IWheelControl(), IWheelControl::OnMidi(), IVTabSwitchControl::OnMouseDown(), IBSwitchControl::OnMouseDown(), IVMultiSliderControl< MAXNC >::OnMouseDown(), IButtonControlBase::OnMouseDown(), ISwitchControlBase::OnMouseDown(), ITextToggleControl::OnMouseDown(), IVXYPadControl::OnMouseDrag(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), IWheelControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), IBMeterControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVPeakAvgMeterControl< MAXNC >::OnMsgFromDelegate(), SetDirty(), SetValueFromDelegate(), IVMenuButtonControl::SetValueFromUserInput(), SetValueFromUserInput(), SetValueToDefault(), SnapToMouse(), and IVMultiSliderControl< MAXNC >::SnapToMouse().
◆ SetValueFromDelegate()
|
virtual |
◆ SetValueFromUserInput()
|
virtual |
◆ SetValueToDefault()
|
virtual |
Set one or all of the control's values to the default value of the associated parameter.
- Parameters
-
valIdx either 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()
|
inline |
◆ SetWantsMultiTouch()
|
inline |
Specify whether this control supports multiple touches.
Definition at line 435 of file IControl.h.
◆ SnapToMouse()
|
virtual |
Set control value based on x, y position within a rectangle.
Commonly used for slider/fader controls.
- Parameters
-
x The X coordinate for snapping y The Y coordinate for snapping direction The direction of the control's travel- horizontal or vertical fader bounds The area in which the track of e.g. a slider should be snapped valIdx The 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 | ) |
◆ mBlend
◆ mDblAsSingleClick
|
bool IControl::mDblAsSingleClick = false |
protected |
◆ mDirty
|
bool IControl::mDirty = true |
protected |
◆ mDisabled
|
bool IControl::mDisabled = false |
protected |
◆ mDisablePrompt
|
bool IControl::mDisablePrompt = true |
protected |
◆ mGroup
|
WDL_String IControl::mGroup |
protected |
◆ mHide
|
bool IControl::mHide = false |
protected |
◆ mIgnoreMouse
|
bool IControl::mIgnoreMouse = false |
protected |
◆ mMouseEventsWhenDisabled
|
bool IControl::mMouseEventsWhenDisabled = false |
protected |
◆ mMouseIsOver
|
bool IControl::mMouseIsOver = false |
protected |
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
If you need finer grained control of mouseovers, you can override OnMouseOver() and OnMouseOut()
Definition at line 565 of file IControl.h.
Referenced by IVPanelControl::Draw(), ISVGButtonControl::Draw(), ISVGToggleControl::Draw(), IVNumberBoxControl::Draw(), TestAnimationControl::Draw(), TestCursorControl::Draw(), TestDirBrowseControl::Draw(), TestDragAndDropControl::Draw(), TestImageControl::Draw(), TestSVGControl::Draw(), IURLControl::Draw(), ICaptionControl::Draw(), IVButtonControl::DrawWidget(), IVSwitchControl::DrawWidget(), IVToggleControl::DrawWidget(), GetMouseIsOver(), OnMouseOut(), OnMouseOver(), SetRECT(), SetTargetAndDrawRECTs(), and SetTargetRECT().
◆ mMouseOverWhenDisabled
|
bool IControl::mMouseOverWhenDisabled = false |
protected |
◆ mPromptShowsParamLabel
|
bool IControl::mPromptShowsParamLabel = false |
protected |
◆ mPTHighlightColor
|
IColor IControl::mPTHighlightColor = COLOR_RED |
protected |
◆ mPTisHighlighted
|
bool IControl::mPTisHighlighted = false |
protected |
◆ mRECT
◆ mTargetRECT
|
IRECT IControl::mTargetRECT |
protected |
◆ mText
◆ mTextEntryLength
|
int IControl::mTextEntryLength = DEFAULT_TEXT_ENTRY_LEN |
protected |
◆ mTooltip
|
WDL_String IControl::mTooltip |
protected |
◆ mWantsMidi
|
bool IControl::mWantsMidi = false |
protected |
◆ mWantsMultiTouch
|
bool IControl::mWantsMultiTouch = false |
protected |
The documentation for this class was generated from the following files: