iPlug2 - C++ Audio Plug-in Framework
|
The lowest level base class of an IGraphics control. More...
#include <IControl.h>
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::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()
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()
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::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()
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.
|
inlinevirtual |
Destructor.
Clean up any resources that your control owns.
Definition at line 81 of file IControl.h.
void IControl::Animate | ( | ) |
Definition at line 225 of file IControl.cpp.
|
inline |
Helper function to dynamic cast an IControl to a subclass.
Definition at line 518 of file IControl.h.
Referenced by IVTabPage::IVTabPage(), IVTabPage::OnStyleChanged(), IVTabbedPagesControl::OnStyleChanged(), SplashAnimationFunc(), and SplashClickActionFunc().
IControl * IControl::AttachGestureRecognizer | ( | EGestureType | type, |
IGestureFunc | func | ||
) |
Add a IGestureFunc that should be triggered in response to a certain type of gesture.
type | The type of gesture to recognize on this control |
func | the function to trigger |
Definition at line 311 of file IControl.cpp.
References IGraphics::AttachGestureRecognizer(), and GetUI().
Referenced by TestGesturesControl::OnInit().
|
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().
|
inline |
Disable/enable default prompt for user input.
disable | Set true to disable prompt |
Definition at line 420 of file IControl.h.
|
pure virtual |
Draw the control to the graphics context.
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, 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.
|
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.
g | The graphics context to which this control belongs. |
Definition at line 389 of file IControl.cpp.
References IGraphics::FillCircle().
|
inlineprotected |
A helper template function to call a method for an individual value, or for all values.
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().
|
inline |
Get the control's action function, if it exists.
Definition at line 508 of file IControl.h.
|
inline |
Get the duration of animations applied to the control.
Definition at line 514 of file IControl.h.
|
inline |
Get the control's animation function, if it exists.
Definition at line 505 of file IControl.h.
Referenced by IVSlideSwitchControl::Draw(), ISkLottieControl::Draw(), TestKeyboardControl::Draw(), IVectorBase::DrawPressableEllipse(), IVectorBase::DrawPressableRectangle(), IVectorBase::DrawPressableTriangle(), IsDirty(), and IVSlideSwitchControl::SetDirty().
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(), IVSlideSwitchControl::IVSlideSwitchControl(), IWheelControl::OnMouseUp(), and SplashAnimationFunc().
|
inline |
Get the Blend for this control.
Definition at line 304 of file IControl.h.
Referenced by IVectorBase::DrawBackground(), IBitmapBase::DrawBitmap(), IVectorBase::DrawLabel(), IVectorBase::DrawPressableEllipse(), IVectorBase::DrawPressableRectangle(), IVectorBase::DrawPressableTriangle(), and IVectorBase::DrawValue().
|
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();
Definition at line 454 of file IControl.h.
Referenced by IWheelControl::IWheelControl(), IVNumberBoxControl::OnMouseDown(), IVNumberBoxControl::OnMouseUp(), IVBakedPresetManagerControl::OnPopupMenuSelection(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnPopupMenuSelection(), IWheelControl::OnPopupMenuSelection(), SetDirty(), and IVTrackControlBase::SetParamsByGroup().
|
inline |
Get the group that the control belongs to, if any.
Definition at line 289 of file IControl.h.
References mGroup.
Referenced by IGraphics::ForControlInGroup(), and IVMenuButtonControl::IVMenuButtonControl().
|
inline |
true
if the control ignores mouse events Definition at line 384 of file IControl.h.
|
inline |
Definition at line 449 of file IControl.h.
|
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).
Definition at line 353 of file IControl.h.
Referenced by IGraphics::OnMouseDblClick().
|
inline |
true
if the control responds to other mouse events when disabled Definition at line 381 of file IControl.h.
|
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
Definition at line 479 of file IControl.h.
References mMouseIsOver.
Referenced by ICornerResizerControl::Draw(), and ICaptionControl::Draw().
|
inline |
true
if the control responds to mouse overs when disabled Definition at line 378 of file IControl.h.
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.
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().
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.
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 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().
|
inline |
Definition at line 467 of file IControl.h.
Referenced by IGraphicsLiveEdit::Draw(), and IGraphics::IsDirty().
|
inline |
true
if the control should show parameter labels/units e.g. "Hz" in text entry prompts Definition at line 391 of file IControl.h.
Referenced by IGraphics::PromptUserInput().
|
inline |
Get the rectangular draw area for this control, within the graphics context.
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().
|
inline |
Get the control's tag.
Definition at line 426 of file IControl.h.
References IGraphics::GetControlTag(), and GetUI().
Referenced by IWheelControl::OnPopupMenuSelection(), IGraphics::RemoveControl(), and IGraphics::RemoveControls().
|
inline |
Get the rectangular mouse tracking target area, within the graphics context for this control.
Definition at line 324 of file IControl.h.
Referenced by IGraphicsLiveEdit::OnMouseDown().
|
inline |
Get the Text object for the control.
Definition at line 293 of file IControl.h.
Referenced by IGraphics::PromptUserInput().
|
inline |
Get the max number of characters that are allowed in text entry.
Definition at line 308 of file IControl.h.
Referenced by IGraphics::CreateTextEntry().
|
inline |
Definition at line 224 of file IControl.h.
|
inline |
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(), 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().
|
inline |
Definition at line 475 of file IControl.h.
|
inlinevirtual |
Check to see which of the control's values relates to this x and y coordinate.
x | x coordinate to check |
y | x coordinate to check |
Reimplemented in IVTrackControlBase.
Definition at line 250 of file IControl.h.
Referenced by OnMouseDblClick(), IVKnobControl::OnMouseDblClick(), IVSliderControl::OnMouseDblClick(), IGraphics::OnMouseDown(), and OnMouseDown().
double IControl::GetValue | ( | int | valIdx = 0 | ) | const |
Get the control's value.
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().
|
inlinevirtual |
Definition at line 446 of file IControl.h.
Referenced by IGraphics::OnGestureRecognized(), and IGraphics::RespondsToGesture().
|
inline |
Definition at line 432 of file IControl.h.
Referenced by IGEditorDelegate::SendMidiMsgFromDelegate().
|
inline |
Definition at line 438 of file IControl.h.
|
virtual |
Shows or hides the IControl.
hide | Set to true to hide the control |
Reimplemented in IPlatformViewControl, IVTabbedPagesControl, IWebViewControl, and IContainerBase.
Definition at line 239 of file IControl.cpp.
References SetDirty().
Referenced by IPlatformViewControl::Hide(), IVTabbedPagesControl::Hide(), IWebViewControl::Hide(), IContainerBase::Hide(), IGraphics::HideControl(), IBubbleControl::IBubbleControl(), and IVTabbedPagesControl::OnAttached().
|
virtual |
Called at each display refresh by the IGraphics draw loop, after IControl::Animate(), to determine if the control is marked as dirty.
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().
|
inline |
true
if 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(), IVDisplayControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVPeakAvgMeterControl< MAXNC >::OnMsgFromDelegate(), IVMultiSliderControl< MAXNC >::OnMsgFromDelegate(), IVScopeControl< MAXNC, MAXBUF >::OnMsgFromDelegate(), and IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMsgFromDelegate().
|
inline |
true
if the control is hidden. Definition at line 360 of file IControl.h.
Referenced by IGraphicsLiveEdit::Draw(), IGraphics::SetControlBounds(), IGraphics::SetControlPosition(), and IGraphics::SetControlSize().
|
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.
x | The X coordinate within the control to test |
y | The y coordinate within the control to test |
Return
true if the control was hit. Reimplemented in IVButtonControl, IVSwitchControl, IVTabSwitchControl, IVKnobControl, and IVSliderControl.
Definition at line 400 of file IControl.h.
References IRECT::Contains().
int IControl::LinkedToParam | ( | int | paramIdx | ) | const |
Check if the control is linked to a particular parameter.
paramIdx | The paramIdx to test |
Definition at line 132 of file IControl.cpp.
References NVals().
Referenced by IGraphics::ForControlWithParam(), and IGraphics::GetControlWithParamIdx().
|
inline |
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().
|
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().
|
inlinevirtual |
Implement this to respond to a menu selection from CreateContextMenu();.
Definition at line 189 of file IControl.h.
Referenced by IGraphics::SetControlValueAfterPopupMenu().
|
inlinevirtual |
Implement this method to handle popup menu deletion interactions (on IOS) after IGraphics::CreatePopupMenu/IControlPromptUserInput.
pMenu | The menu in which an item was deleted |
itemIdx | An index that indicates which of the items was deleted |
Definition at line 181 of file IControl.h.
Referenced by IGraphics::DeleteFromPopupMenu().
|
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().
|
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().
|
virtual |
Definition at line 416 of file IControl.cpp.
|
virtual |
Definition at line 320 of file IControl.cpp.
Referenced by IGraphics::OnGestureRecognized().
|
inlinevirtual |
This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined.
Definition at line 423 of file IControl.h.
Referenced by IGraphics::OnGUIIdle().
|
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().
|
inlinevirtual |
Implement this method to respond to a key down event on this control.
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 |
Reimplemented in IAboutBoxControl, ITextEntryControl, TestKeyboardControl, and IGraphicsLiveEdit.
Definition at line 120 of file IControl.h.
Referenced by IGraphics::OnKeyDown().
|
inlinevirtual |
Implement this method to respond to a key up event on this control.
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().
|
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().
|
virtual |
Implement this method to respond to a mouse double click event on this control.
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, ICornerResizerControl, ITextEntryControl, IVNumberBoxControl, TestTextControl, PlaceHolder, and IGraphicsLiveEdit.
Definition at line 258 of file IControl.cpp.
References GetValIdxForPos(), PromptUserInput(), and SetValueToDefault().
Referenced by IGraphics::OnMouseDblClick().
|
virtual |
Implement this method to respond to a mouse down event on this control.
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, 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().
|
inlinevirtual |
Implement this method to respond to a mouse drag event on this control.
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().
|
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().
|
virtual |
Implement this method to respond to a mouseover event on this control.
Implementations should call base class, if you wish to use mMouseIsOver.
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().
|
inlinevirtual |
Implement this method to respond to a mouse up event on this control.
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().
|
inlinevirtual |
Implement this method to respond to a mouse wheel event on this control.
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 |
d | The 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().
|
inlinevirtual |
Implement to receive messages sent to the control, see IEditorDelegate:SendControlMsgFromDelegate()
Reimplemented in IBMeterControl, IRTTextControl< MAXNC, T >, 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().
|
virtual |
Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput.
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, 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().
|
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().
|
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, 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().
|
inlinevirtual |
Implement this method to handle text input after IGraphics::CreateTextEntry/IControlPromptUserInput.
str | A CString with the inputted text |
valIdx | An index that indicates which of the control's values the text completion relates to |
Reimplemented in IVNumberBoxControl, IEditableTextControl, and PlaceHolder.
Definition at line 186 of file IControl.h.
Referenced by IGraphics::SetControlValueAfterTextEdit().
|
inlinevirtual |
Implement this method to respond to a touch cancel event on this control.
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().
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.
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().
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)
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().
|
inline |
Set an Action Function for this control.
actionFunc | A std::function conforming to IActionFunction |
Definition at line 211 of file IControl.h.
Referenced by IBubbleControl::IBubbleControl(), IPopupMenuControl::IPopupMenuControl(), IVSlideSwitchControl::IVSlideSwitchControl(), and IWheelControl::IWheelControl().
|
inline |
Set the animation function.
func | A std::function conforming to IAnimationFunction |
Definition at line 497 of file IControl.h.
Referenced by DefaultClickActionFunc(), IBubbleControl::IBubbleControl(), IPopupMenuControl::IPopupMenuControl(), IVSlideSwitchControl::IVSlideSwitchControl(), ILambdaControl::OnMouseDown(), IWheelControl::OnMouseUp(), and SplashClickActionFunc().
|
inline |
Set the animation function and starts it.
func | A std::function conforming to IAnimationFunction |
duration | Duration in milliseconds for the animation |
Definition at line 502 of file IControl.h.
References StartAnimation().
|
inline |
Set an Action Function to be called at the end of an animation.
actionFunc | A std::function conforming to IActionFunction |
Definition at line 216 of file IControl.h.
Referenced by IBubbleControl::IBubbleControl(), IVMenuButtonControl::IVMenuButtonControl(), IVSlideSwitchControl::IVSlideSwitchControl(), IVNumberBoxControl::OnAttached(), IVBakedPresetManagerControl::OnAttached(), and IVDiskPresetManagerControl::OnAttached().
|
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.
|
inlinevirtual |
Definition at line 409 of file IControl.h.
|
inline |
Used internally to set the mDelegate (and mGraphics) variables.
Definition at line 457 of file IControl.h.
References IGEditorDelegate::GetUI(), OnInit(), OnRescale(), and OnResize().
Referenced by IGraphics::AttachBackground(), IGraphics::AttachBubbleControl(), IGraphics::AttachControl(), IGraphics::AttachPanelBackground(), and IGraphics::AttachSVGBackground().
|
virtual |
Mark the control as dirty, i.e.
it should be redrawn on the next display refresh
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(), 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(), 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().
|
virtual |
Sets disabled mode for the control, the default implementation modifies the mBlend member.
disable | true for disabled |
Reimplemented in IContainerBase.
Definition at line 245 of file IControl.cpp.
References SetDirty().
Referenced by IGraphics::DisableControl(), and IContainerBase::SetDisabled().
|
inline |
Assign the control to a control group.
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().
|
inlinevirtual |
Specify whether the control should respond to mouse events.
ignore | true if it should ignore mouse events |
Reimplemented in IWebViewControl.
Definition at line 388 of file IControl.h.
|
inline |
Specify whether the control should respond to other mouse events when disabled.
allow | true if it should respond to other mouse events when disabled (false by default) |
Definition at line 375 of file IControl.h.
|
inline |
Specify whether the control should respond to mouse overs when disabled.
allow | true if it should respond to mouse overs when disabled (false by default) |
Definition at line 371 of file IControl.h.
|
inlineprotected |
Definition at line 571 of file IControl.h.
|
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.
paramIdx | Parameter index, or kNoParameter if there is no parameter linked with this control at valIdx |
valIdx | An 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().
|
inline |
Definition at line 469 of file IControl.h.
|
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
x | the new x coordinate of the top left corner of the control |
y | the 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().
|
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.
void IControl::SetPTParameterHighlight | ( | bool | isHighlighted, |
int | color | ||
) |
Used internally by the AAX wrapper view interface to set the control parmeter highlight.
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().
|
inline |
Set the rectangular draw area for this control, within the graphics context.
bounds | The control's bounds |
Definition at line 320 of file IControl.h.
References mMouseIsOver, and OnResize().
Referenced by IPopupMenuControl::CalculateMenuPanels(), IGraphicsLiveEdit::OnMouseUp(), and SetPosition().
|
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.
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().
|
inline |
Set BOTH the draw rect and the target area, within the graphics context for this control.
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().
|
inline |
Set the rectangular mouse tracking target area, within the graphics context for this control.
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(), IVDisplayControl::OnResize(), IVNumberBoxControl::OnResize(), IVScopeControl< MAXNC, MAXBUF >::OnResize(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnResize(), IVTabbedPagesControl::OnResize(), ISliderControlBase::OnResize(), IVTrackControlBase::OnResize(), IGraphicsLiveEdit::OnResize(), and SetPosition().
|
inlinevirtual |
Set the Text object typically used to determine font/layout/size etc of the main text in a control.
txt | An IText struct with the desired formatting |
Reimplemented in IURLControl.
Definition at line 297 of file IControl.h.
|
inline |
Set the max number of characters that are allowed in text entry.
len | The max number of characters allowed in text entry |
Definition at line 312 of file IControl.h.
|
inline |
Set a tooltip for the control.
str | CString tooltip to be displayed |
Definition at line 221 of file IControl.h.
|
virtual |
Set one of the control's values.
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().
|
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.
value | Normalised incoming value |
valIdx | The 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().
|
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
value | the normalised value after user input via text entry or pop-up menu |
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 |
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().
|
virtual |
Set one or all of the control's values to the default value of the associated parameter.
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().
|
inline |
Specify whether this control wants to know about MIDI messages sent to the UI.
See OnMIDIMsg()
Definition at line 429 of file IControl.h.
Referenced by IWheelControl::IWheelControl().
|
inline |
Specify whether this control supports multiple touches.
Definition at line 435 of file IControl.h.
|
virtual |
Set control value based on x, y position within a rectangle.
Commonly used for slider/fader controls.
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().
void IControl::StartAnimation | ( | int | duration | ) |
duration | Duration in milliseconds for the animation |
Definition at line 425 of file IControl.cpp.
Referenced by SetAnimation().
|
protected |
Definition at line 551 of file IControl.h.
|
protected |
Definition at line 557 of file IControl.h.
|
protected |
Definition at line 553 of file IControl.h.
|
protected |
Definition at line 555 of file IControl.h.
|
protected |
Definition at line 556 of file IControl.h.
|
protected |
Controls can be grouped for hiding and showing panels.
Definition at line 548 of file IControl.h.
Referenced by GetGroup(), and SetGroup().
|
protected |
Definition at line 554 of file IControl.h.
|
protected |
Definition at line 560 of file IControl.h.
|
protected |
Definition at line 559 of file IControl.h.
|
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().
|
protected |
Definition at line 558 of file IControl.h.
|
protected |
Definition at line 563 of file IControl.h.
|
protected |
Definition at line 568 of file IControl.h.
|
protected |
Definition at line 569 of file IControl.h.
|
protected |
Definition at line 544 of file IControl.h.
|
protected |
Definition at line 545 of file IControl.h.
|
protected |
Definition at line 550 of file IControl.h.
|
protected |
Definition at line 552 of file IControl.h.
|
protected |
Definition at line 566 of file IControl.h.
|
protected |
Definition at line 561 of file IControl.h.
|
protected |
Definition at line 562 of file IControl.h.