iPlug2 - C++ Audio Plug-in Framework
|
The lowest level base class of an IGraphics control. More...
#include <IControl.h>
Inherited by GFXLabelControl, IBitmapControl, IBubbleControl, IButtonControlBase, IColorPickerControl, ICornerResizerControl, IDirBrowseControlBase, IFPSDisplayControl, IGraphicsLiveEdit, IKnobControlBase, ILambdaControl, ILEDControl, IPanelControl, IPopupMenuControl, IShaderControl, ISkLottieControl, ISkParagraphControl, ISliderControlBase, ISVGControl, ISwitchControlBase, ITextControl, ITextEntryControl, IVBakedPresetManagerControl, IVColorSwatchControl, IVDisplayControl, IVGroupControl, IVKeyboardControl, IVNumberBoxControl, IVPanelControl, IVPlotControl, IVScopeControl< MAXNC, MAXBUF >, IVTrackControlBase, IVXYPadControl, IWebViewControl, TestAnimationControl, TestBezierControl, TestColorControl, TestCursorControl, TestDrawContextControl, TestDropShadowControl, TestFlexBoxControl, TestFontControl, TestGLControl, TestImageControl, TestKeyboardControl, TestMPSControl, TestMTControl, TestShadowGradientControl, TestSizeControl, TestSVGControl, 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. | |
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. | |
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() | |
virtual void | OnMidi (const IMidiMsg &msg) |
Implement to receive MIDI messages sent to the control if mWantsMidi == true, see IEditorDelegate:SendMidiMsgFromDelegate() | |
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/IControl::PromptUserInput. More... | |
virtual void | OnTextEntryCompletion (const char *str, int valIdx) |
Implement this method to handle text input after IGraphics::CreateTextEntry/IControl::PromptUserInput. 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... | |
void | 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. | |
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 |
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. | |
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. | |
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... | |
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. | |
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. | |
IActionFunction | GetActionFunction () |
Get the control's action function, if it exists. | |
double | GetAnimationProgress () const |
Get the progress in a control's animation, in the range 0-1. | |
Milliseconds | GetAnimationDuration () const |
Get the duration of animations applied to the control. | |
template<class T > | |
T * | As () |
Helper function to dynamic cast an IControl to a subclass. | |
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. | |
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 42 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 81 of file IControl.cpp.
Referenced by IVPlotControl::AddPlotFunc(), GetAnimationProgress(), IBitmapControl::IBitmapControl(), IButtonControlBase::OnMouseDown(), IVRangeSliderControl::OnMouseDrag(), IKnobControlBase::OnMouseWheel(), IVGroupControl::OnResize(), and PlaceHolder::OnResize().
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 89 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 100 of file IControl.cpp.
|
inlinevirtual |
Destructor.
Clean up any resources that your control owns.
Definition at line 79 of file IControl.h.
References OnMouseDown().
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 309 of file IControl.cpp.
References IGraphics::AttachGestureRecognizer(), and GetUI().
Referenced by IGraphics::AttachGestureRecognizerToRegion(), GetWantsMultiTouch(), and 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 166 of file IControl.h.
References OnPopupMenuSelection().
Referenced by IGraphics::PopupHostContextMenuForParam().
|
inline |
Disable/enable default prompt for user input.
disable | Set true to disable prompt |
Definition at line 405 of file IControl.h.
Referenced by IVRadioButtonControl::GetButtonForPoint(), and IVKnobControl::OnInit().
|
pure virtual |
Draw the control to the graphics context.
g | The graphics context to which this control belongs. |
Implemented in PlaceHolder, ICaptionControl, IURLControl, ITextControl, ISVGControl, IBitmapControl, ILambdaControl, IPanelControl, IWheelControl, IBTextControl, IBSliderControl, IBKnobRotaterControl, IBKnobControl, IBSwitchControl, IBButtonControl, ISVGSliderControl, ISVGSwitchControl, ISVGButtonControl, ISVGKnobControl, IVColorSwatchControl, IVPanelControl, IVGroupControl, IVPlotControl, IVXYPadControl, IVRangeSliderControl, IVSliderControl, IGraphicsLiveEdit, IVKnobControl, IVKeyboardControl, TestGLControl, IVTabSwitchControl, IVDiskPresetManagerControl, IVLEDMeterControl< MAXNC >, IBubbleControl, IVSlideSwitchControl, TestKeyboardControl, IShaderControl, IVSwitchControl, TestMPSControl, IVMultiSliderControl< MAXNC >, IFPSDisplayControl, IWebViewControl, ISkParagraphControl, IVDisplayControl, IVButtonControl, IPopupMenuControl, IVNumberBoxControl, TestAnimationControl, IVLabelControl, ITextEntryControl, IVScopeControl< MAXNC, MAXBUF >, ISkLottieControl, ILEDControl, TestFlexBoxControl, TestColorControl, TestDirBrowseControl, ICornerResizerControl, IVMeterControl< MAXNC >, IVBakedPresetManagerControl, TestTextSizeControl, IColorPickerControl, TestTextOrientationControl, TestBezierControl, TestFontControl, TestBlendControl, TestGesturesControl, TestArcControl, TestDropShadowControl, TestMTControl, TestSVGControl, TestGradientControl, TestImageControl, TestMultiPathControl, TestSizeControl, TestTextControl, TestCursorControl, TestDrawContextControl, GFXLabelControl, TestLayerControl, TestPolyControl, TestShadowGradientControl, and TestMaskControl.
Referenced by IGraphics::BeginFrame(), and OnContextSelection().
|
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 387 of file IControl.cpp.
References IGraphics::FillCircle(), IRECT::R, and IRECT::T.
Referenced by IGraphics::BeginFrame(), and OnContextSelection().
|
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 valIdx |
args | Arguments to the function |
Definition at line 512 of file IControl.h.
References NVals().
Referenced by SetDirty(), SetValueToDefault(), and SnapToMouse().
|
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 439 of file IControl.h.
Referenced by IGraphics::AttachBackground(), IGraphics::AttachBubbleControl(), IGraphics::AttachControl(), IGraphics::AttachCornerResizer(), IGraphics::AttachPanelBackground(), IGraphics::AttachPopupMenuControl(), IGraphics::AttachSVGBackground(), IGraphics::AttachTextEntryControl(), IVKeyboardControl::Draw(), IGraphics::EnableLiveEdit(), IWheelControl::IWheelControl(), IVNumberBoxControl::OnMouseDown(), IGraphics::OnMouseDown(), IVNumberBoxControl::OnMouseUp(), IGraphics::OnMouseUp(), IVBakedPresetManagerControl::OnPopupMenuSelection(), IWheelControl::OnPopupMenuSelection(), IGraphics::PopupHostContextMenuForParam(), IGraphics::Resize(), IGraphics::SetControlValueAfterPopupMenu(), SetDirty(), IVTrackControlBase::SetParamsByGroup(), IGraphics::SetQwertyMidiKeyHandlerFunc(), IGraphics::SetScreenScale(), and IGraphics::ShowFPSDisplay().
|
inline |
Get the group that the control belongs to, if any.
Definition at line 278 of file IControl.h.
References mGroup.
Referenced by IGraphics::ForControlInGroup().
|
inline |
true
if the control ignores mouse events Definition at line 373 of file IControl.h.
Referenced by IGraphics::ReleaseMouseCapture().
|
inline |
Definition at line 434 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 342 of file IControl.h.
References Hide().
Referenced by IGraphics::OnMouseDblClick().
|
inline |
true
if the control responds to other mouse events when disabled Definition at line 370 of file IControl.h.
Referenced by IGraphics::ReleaseMouseCapture().
|
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 459 of file IControl.h.
References mMouseIsOver, SnapToMouse(), and StartAnimation().
Referenced by ICornerResizerControl::Draw(), and ICaptionControl::Draw().
|
inline |
true
if the control responds to mouse overs when disabled Definition at line 367 of file IControl.h.
Referenced by IGraphics::ReleaseMouseCapture().
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 120 of file IControl.cpp.
References IEditorDelegate::GetParam(), and GetParamIdx().
Referenced by ICaptionControl::Draw(), GetValIdxForPos(), IVNumberBoxControl::OnInit(), IVSwitchControl::OnInit(), IVTabSwitchControl::OnInit(), IVKnobControl::OnInit(), IVSliderControl::OnInit(), ISwitchControlBase::OnInit(), ITextEntryControl::OnKeyDown(), IVNumberBoxControl::OnMouseDown(), ISliderControlBase::OnMouseDown(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), IVNumberBoxControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), OnPopupMenuSelection(), ICaptionControl::OnResize(), PromptUserInput(), IGraphics::PromptUserInput(), IVSwitchControl::SetDirty(), IVKnobControl::SetDirty(), IVSliderControl::SetDirty(), IVTrackControlBase::SetParams(), IVNumberBoxControl::SetStyle(), IVNumberBoxControl::SetValueFromDelegate(), 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 controls 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 107 of file IControl.cpp.
References NVals().
Referenced by IGraphics::CreateTextEntry(), GetParam(), IGraphics::GetParamIdxForPTAutomation(), GetTooltip(), ISwitchControlBase::OnInit(), IVNumberBoxControl::OnMouseDown(), IGraphics::OnMouseDown(), IVNumberBoxControl::OnMouseUp(), IGraphics::OnMouseUp(), OnPopupMenuSelection(), PromptUserInput(), IGEditorDelegate::SendParameterValueFromDelegate(), SetDirty(), and IGraphics::UpdatePeers().
|
inline |
true
if the control should show parameter labels/units e.g. "Hz" in text entry prompts Definition at line 376 of file IControl.h.
Referenced by IGraphics::PromptUserInput().
|
inline |
Get the rectangular draw area for this control, within the graphics context.
Definition at line 305 of file IControl.h.
Referenced by IGraphics::BeginFrame(), IVNumberBoxControl::Draw(), IGraphicsLiveEdit::Draw(), IGraphics::IsDirty(), ITextEntryControl::OnKeyDown(), IVNumberBoxControl::OnMouseDblClick(), IGraphicsLiveEdit::OnMouseDown(), IGraphicsLiveEdit::OnMouseDrag(), IGraphicsLiveEdit::OnMouseOver(), IGraphicsLiveEdit::OnMouseUp(), IVNumberBoxControl::OnResize(), IGraphics::ReleaseMouseCapture(), IBubbleControl::SetStrokeColor(), ShowBubbleHorizontalActionFunc(), ShowBubbleVerticalActionFunc(), and IGraphics::StartLayer().
|
inline |
Get the control's tag.
Definition at line 411 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 313 of file IControl.h.
Referenced by IGraphicsLiveEdit::OnMouseDown().
|
inline |
Get the Text object for the control.
Definition at line 282 of file IControl.h.
Referenced by ITextEntryControl::OnKeyDown(), and IGraphics::PromptUserInput().
|
inline |
Get the max number of characters that are allowed in text entry.
Definition at line 297 of file IControl.h.
Referenced by IGraphics::CreateTextEntry().
|
inline |
Definition at line 213 of file IControl.h.
References GetParamIdx(), LinkedToParam(), and SetParamIdx().
|
inline |
Definition at line 452 of file IControl.h.
Referenced by AttachGestureRecognizer(), IPopupMenuControl::CalculateMenuPanels(), IPopupMenuControl::CreatePopupMenu(), ICornerResizerControl::Draw(), GetTag(), IBubbleControl::IBubbleControl(), IWebViewControl::IWebViewControl(), IVBakedPresetManagerControl::OnAttached(), IWebViewControl::OnAttached(), IVNumberBoxControl::OnAttached(), IVDiskPresetManagerControl::OnAttached(), TestDropShadowControl::OnDrop(), TestImageControl::OnDrop(), TestSVGControl::OnDrop(), IGraphicsLiveEdit::OnInit(), ITextEntryControl::OnKeyDown(), IGraphicsLiveEdit::OnKeyDown(), TestTextControl::OnMouseDblClick(), ICornerResizerControl::OnMouseDblClick(), IVNumberBoxControl::OnMouseDblClick(), PlaceHolder::OnMouseDblClick(), TestCursorControl::OnMouseDown(), TestImageControl::OnMouseDown(), ITextEntryControl::OnMouseDown(), ICornerResizerControl::OnMouseDown(), IGraphicsLiveEdit::OnMouseDown(), TestSVGControl::OnMouseDown(), TestPolyControl::OnMouseDown(), TestArcControl::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), IVNumberBoxControl::OnMouseDown(), TestFlexBoxControl::OnMouseDown(), ISkLottieControl::OnMouseDown(), IVXYPadControl::OnMouseDown(), IVColorSwatchControl::OnMouseDown(), IWheelControl::OnMouseDown(), IKnobControlBase::OnMouseDown(), ISliderControlBase::OnMouseDown(), IEditableTextControl::OnMouseDown(), IURLControl::OnMouseDown(), IGraphicsLiveEdit::OnMouseDrag(), TestCursorControl::OnMouseOut(), ICornerResizerControl::OnMouseOut(), IURLControl::OnMouseOut(), ICornerResizerControl::OnMouseOver(), IGraphicsLiveEdit::OnMouseOver(), IURLControl::OnMouseOver(), TestPolyControl::OnMouseUp(), TestArcControl::OnMouseUp(), IVNumberBoxControl::OnMouseUp(), IGraphicsLiveEdit::OnMouseUp(), IVXYPadControl::OnMouseUp(), IKnobControlBase::OnMouseUp(), ISliderControlBase::OnMouseUp(), IGraphicsLiveEdit::OnPopupMenuSelection(), ICornerResizerControl::OnRescale(), IWebViewControl::OnRescale(), IBButtonControl::OnRescale(), IBSwitchControl::OnRescale(), IBKnobControl::OnRescale(), IBSliderControl::OnRescale(), IBTextControl::OnRescale(), IBitmapControl::OnRescale(), TestSizeControl::OnResize(), IWebViewControl::OnResize(), IGraphicsLiveEdit::OnResize(), IVGroupControl::OnResize(), PromptUserInput(), ITextControl::SetBoundsBasedOnStr(), SetDirty(), IBubbleControl::SetStrokeColor(), SetValueFromDelegate(), ShowBubbleHorizontalActionFunc(), ShowBubbleVerticalActionFunc(), and SplashClickActionFunc().
|
inline |
Definition at line 455 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 239 of file IControl.h.
References GetParam(), GetValue(), SetValue(), SetValueFromDelegate(), SetValueFromUserInput(), and SetValueToDefault().
Referenced by OnMouseDblClick(), IVKnobControl::OnMouseDblClick(), IVSliderControl::OnMouseDblClick(), OnMouseDown(), IGraphics::OnMouseDown(), and IVTrackControlBase::OnMouseOver().
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 151 of file IControl.cpp.
References NVals().
Referenced by TestLayerControl::Draw(), TestPolyControl::Draw(), TestGradientControl::Draw(), TestMultiPathControl::Draw(), TestArcControl::Draw(), TestBlendControl::Draw(), TestTextOrientationControl::Draw(), TestTextSizeControl::Draw(), ILEDControl::Draw(), IVLEDMeterControl< MAXNC >::Draw(), IVRangeSliderControl::Draw(), ISVGKnobControl::Draw(), ISVGButtonControl::Draw(), ISVGSliderControl::Draw(), IBKnobRotaterControl::Draw(), IBSliderControl::Draw(), IWheelControl::Draw(), IVTrackControlBase::DrawBackground(), IVToggleControl::DrawValue(), IVButtonControl::DrawWidget(), IVToggleControl::DrawWidget(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), IVRangeSliderControl::DrawWidget(), IVXYPadControl::DrawWidget(), GetValIdxForPos(), IWheelControl::IWheelControl(), IVMultiSliderControl< MAXNC >::OnMouseDown(), IBSwitchControl::OnMouseDown(), IKnobControlBase::OnMouseDown(), ISliderControlBase::OnMouseDown(), ISwitchControlBase::OnMouseDown(), ITextToggleControl::OnMouseDown(), IVRangeSliderControl::OnMouseDrag(), IWheelControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), ISVGSliderControl::OnResize(), SetDirty(), ITextToggleControl::SetDirty(), SetValueFromDelegate(), SetValueFromUserInput(), IVMultiSliderControl< MAXNC >::SnapToMouse(), and IGraphics::UpdatePeers().
|
inline |
Definition at line 431 of file IControl.h.
Referenced by IGraphics::OnGestureRecognized(), and IGraphics::RespondsToGesture().
|
inline |
Definition at line 417 of file IControl.h.
Referenced by IGEditorDelegate::SendMidiMsgFromDelegate().
|
inline |
Definition at line 423 of file IControl.h.
References AttachGestureRecognizer().
Referenced by IGraphics::ReleaseMouseCapture().
|
virtual |
Shows or hides the IControl.
hide | Set to true to hide the control |
Definition at line 237 of file IControl.cpp.
References SetDirty().
Referenced by IPopupMenuControl::CalculateMenuPanels(), GetMouseDblAsSingleClick(), IGraphics::HideControl(), IBubbleControl::IBubbleControl(), and IBubbleControl::SetStrokeColor().
|
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 IGraphicsLiveEdit, TestMTControl, and IFPSDisplayControl.
Definition at line 229 of file IControl.cpp.
References GetAnimationFunction().
Referenced by TestMTControl::IsDirty(), IGraphics::IsDirty(), and IsHit().
|
inline |
true
if the control is disabled Definition at line 356 of file IControl.h.
Referenced by IVLabelControl::Draw(), IVKeyboardControl::Draw(), IGraphicsLiveEdit::Draw(), IVRangeSliderControl::Draw(), IVButtonControl::DrawWidget(), IVSwitchControl::DrawWidget(), IVToggleControl::DrawWidget(), IVSlideSwitchControl::DrawWidget(), IVTabSwitchControl::DrawWidget(), IVRadioButtonControl::DrawWidget(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), IVXYPadControl::DrawWidget(), IRTTextControl< MAXNC, T >::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVScopeControl< MAXNC, MAXBUF >::OnMsgFromDelegate(), IVDisplayControl::OnMsgFromDelegate(), IVMultiSliderControl< MAXNC >::OnMsgFromDelegate(), and IGraphics::ReleaseMouseCapture().
|
inline |
true
if the control is hidden. Definition at line 349 of file IControl.h.
References SetDisabled().
Referenced by IGraphics::BeginFrame(), IGraphicsLiveEdit::Draw(), IGraphics::ReleaseMouseCapture(), 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 IVSliderControl, IVKnobControl, IVTabSwitchControl, IVSwitchControl, and IVButtonControl.
Definition at line 385 of file IControl.h.
References IRECT::Contains(), IsDirty(), and SetDirty().
Referenced by IVSwitchControl::OnMouseOut(), IVTabSwitchControl::OnMouseOut(), IVKnobControl::OnMouseOut(), IVSliderControl::OnMouseOut(), and IGraphics::ReleaseMouseCapture().
int IControl::LinkedToParam | ( | int | paramIdx | ) | const |
Check if the control is linked to a particular parameter.
paramIdx | The paramIdx to test |
Definition at line 130 of file IControl.cpp.
References NVals().
Referenced by IGraphics::ForControlWithParam(), and GetTooltip().
|
inline |
Definition at line 233 of file IControl.h.
Referenced by IVRangeSliderControl::Draw(), IVTrackControlBase::DrawTrackHandle(), IVRangeSliderControl::DrawWidget(), IVTrackControlBase::DrawWidget(), ForValIdx(), GetParamIdx(), IVTrackControlBase::GetValIdxForPos(), GetValue(), LinkedToParam(), IGraphics::OnMouseDown(), IVRangeSliderControl::OnMouseDrag(), IVRangeSliderControl::OnMouseOver(), IGraphics::OnMouseUp(), IGEditorDelegate::SendParameterValueFromDelegate(), 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 IVDiskPresetManagerControl, IVNumberBoxControl, IVBakedPresetManagerControl, and IWebViewControl.
Definition at line 154 of file IControl.h.
Referenced by IGraphics::AttachControl().
|
inlinevirtual |
Implement this to respond to a menu selection from CreateContextMenu();.
Definition at line 179 of file IControl.h.
References Draw(), DrawPTHighlight(), and PromptUserInput().
Referenced by As().
|
virtual |
Definition at line 318 of file IControl.cpp.
Referenced by IGraphics::OnGestureRecognized(), and OnMidi().
|
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 IGraphicsLiveEdit, TestKeyboardControl, and ITextEntryControl.
Definition at line 118 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 124 of file IControl.h.
References OnMouseOut(), and OnMouseOver().
Referenced by IGraphics::OnKeyUp().
|
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 PlaceHolder, IVSliderControl, IVKnobControl, IGraphicsLiveEdit, IVNumberBoxControl, ICornerResizerControl, ITextEntryControl, and TestTextControl.
Definition at line 256 of file IControl.cpp.
References GetValIdxForPos(), PromptUserInput(), and SetValueToDefault().
Referenced by IGraphics::OnMouseDblClick(), and OnMouseDrag().
|
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 ICaptionControl, ITextToggleControl, IURLControl, IEditableTextControl, ILambdaControl, ISwitchControlBase, IButtonControlBase, ISliderControlBase, IKnobControlBase, IWheelControl, IBSwitchControl, IVColorSwatchControl, IVXYPadControl, IVRangeSliderControl, IVSliderControl, IVKnobControl, IVMultiSliderControl< MAXNC >, TestMultiPathControl, IVTabSwitchControl, IColorPickerControl, TestKeyboardControl, ISkLottieControl, TestFlexBoxControl, IShaderControl, IVKeyboardControl, IVNumberBoxControl, TestDirBrowseControl, TestMTControl, IPopupMenuControl, TestAnimationControl, TestBezierControl, TestArcControl, TestLayerControl, TestPolyControl, IFPSDisplayControl, TestFontControl, TestSVGControl, IGraphicsLiveEdit, TestTextOrientationControl, ICornerResizerControl, TestTextSizeControl, ITextEntryControl, TestGradientControl, TestImageControl, TestTextControl, and TestCursorControl.
Definition at line 250 of file IControl.cpp.
References GetValIdxForPos(), and PromptUserInput().
Referenced by IPopupMenuControl::OnMouseDown(), IKnobControlBase::OnMouseDown(), ISliderControlBase::OnMouseDown(), IGraphics::OnMouseDown(), IVRangeSliderControl::OnMouseOut(), IBSwitchControl::OnRescale(), and ~IControl().
|
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 ILambdaControl, ISliderControlBase, IKnobControlBase, IVXYPadControl, IVRangeSliderControl, IVMultiSliderControl< MAXNC >, IGraphicsLiveEdit, IVKeyboardControl, IShaderControl, IVNumberBoxControl, TestMTControl, TestBezierControl, IPopupMenuControl, TestTextOrientationControl, TestTextSizeControl, and ITextEntryControl.
Definition at line 99 of file IControl.h.
References OnMouseDblClick().
Referenced by IVRangeSliderControl::OnMouseDown(), IVXYPadControl::OnMouseDown(), IGraphics::OnMouseDrag(), and IVRangeSliderControl::OnMouseUp().
|
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 IURLControl, IVTrackControlBase, IVColorSwatchControl, IVRangeSliderControl, IVSliderControl, IVKnobControl, IVTabSwitchControl, IVKeyboardControl, IVSwitchControl, ICornerResizerControl, IPopupMenuControl, and TestCursorControl.
Definition at line 273 of file IControl.cpp.
References mMouseIsOver, and SetDirty().
Referenced by OnKeyUp(), TestCursorControl::OnMouseOut(), ICornerResizerControl::OnMouseOut(), IVSwitchControl::OnMouseOut(), IVTabSwitchControl::OnMouseOut(), IVKnobControl::OnMouseOut(), IVSliderControl::OnMouseOut(), IGraphics::OnMouseOut(), and IURLControl::OnMouseOut().
|
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 IURLControl, IVTrackControlBase, IVColorSwatchControl, IVRangeSliderControl, IVSliderControl, IVKnobControl, IVKeyboardControl, IVTabSwitchControl, IGraphicsLiveEdit, TestBezierControl, IPopupMenuControl, and ICornerResizerControl.
Definition at line 265 of file IControl.cpp.
References mMouseIsOver, and SetDirty().
Referenced by OnKeyUp(), ICornerResizerControl::OnMouseOver(), IVTabSwitchControl::OnMouseOver(), IVKnobControl::OnMouseOver(), IVSliderControl::OnMouseOver(), IGraphics::OnMouseOver(), IURLControl::OnMouseOver(), and IGraphics::OnMouseUp().
|
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 ILambdaControl, ISwitchControlBase, ISliderControlBase, IKnobControlBase, IWheelControl, IVXYPadControl, IVRangeSliderControl, IVSliderControl, IVKnobControl, TestKeyboardControl, IVKeyboardControl, IShaderControl, IGraphicsLiveEdit, IVNumberBoxControl, TestMTControl, TestBezierControl, TestArcControl, TestPolyControl, TestTextOrientationControl, TestTextSizeControl, and ITextEntryControl.
Definition at line 91 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 ISliderControlBase, IKnobControlBase, IWheelControl, IVNumberBoxControl, and IPopupMenuControl.
Definition at line 112 of file IControl.h.
Referenced by IGraphics::OnMouseWheel().
|
virtual |
Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControl::PromptUserInput.
pSelectedMenu | If pSelectedMenu is invalid it means the user didn't select anything |
valIdx | An index that indicates which of the controls vals the menu relates to |
Reimplemented in IWheelControl, IGraphicsLiveEdit, IVDiskPresetManagerControl, TestFlexBoxControl, TestDirBrowseControl, and IVBakedPresetManagerControl.
Definition at line 281 of file IControl.cpp.
References GetParam(), GetParamIdx(), and SetValueFromUserInput().
Referenced by CreateContextMenu().
|
inlinevirtual |
Implement to do something when graphics is scaled globally (e.g.
moves to different DPI screen)
Reimplemented in IBitmapControl, IBTextControl, IBSliderControl, IBKnobControl, IBSwitchControl, IBButtonControl, IWebViewControl, ICornerResizerControl, and TestSizeControl.
Definition at line 145 of file IControl.h.
Referenced by IGraphics::CreatePopupMenu(), 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 PlaceHolder, ICaptionControl, IVTrackControlBase, ISliderControlBase, IBSliderControl, ISVGSliderControl, IVColorSwatchControl, IVPanelControl, IVGroupControl, IVPlotControl, IVXYPadControl, IGraphicsLiveEdit, IVSliderControl, IVKnobControl, IVKeyboardControl, IVTabSwitchControl, IShaderControl, IVSlideSwitchControl, IWebViewControl, IVSwitchControl, IVScopeControl< MAXNC, MAXBUF >, IVButtonControl, TestFlexBoxControl, IVNumberBoxControl, IVDisplayControl, TestGradientControl, TestSizeControl, TestDirBrowseControl, and TestColorControl.
Definition at line 148 of file IControl.h.
Referenced by IVSwitchControl::OnMouseOut(), IVTabSwitchControl::OnMouseOut(), IVKnobControl::OnMouseOut(), IVSliderControl::OnMouseOut(), IBSliderControl::OnRescale(), PlaceHolder::OnTextEntryCompletion(), IGraphics::Resize(), SetDelegate(), IVTrackControlBase::SetParams(), SetRECT(), and SetTargetAndDrawRECTs().
|
inlinevirtual |
Implement this method to handle text input after IGraphics::CreateTextEntry/IControl::PromptUserInput.
str | A CString with the inputted text |
valIdx | An index that indicates which of the controls vals the text completion relates to |
Reimplemented in PlaceHolder, IEditableTextControl, and IVNumberBoxControl.
Definition at line 176 of file IControl.h.
|
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 139 of file IControl.h.
Referenced by IGraphics::OnTouchCancelled().
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 controls 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 332 of file IControl.cpp.
References GetParam(), GetParamIdx(), GetUI(), IRECT::MH(), IRECT::MW(), IGraphics::PromptUserInput(), and SetDirty().
Referenced by OnContextSelection(), OnMouseDblClick(), IVKnobControl::OnMouseDblClick(), IVSliderControl::OnMouseDblClick(), OnMouseDown(), IVKnobControl::OnMouseDown(), IVSliderControl::OnMouseDown(), and ICaptionControl::OnMouseDown().
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 controls 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 355 of file IControl.cpp.
References GetParamIdx(), GetUI(), and IGraphics::PromptUserInput().
|
inline |
Set an Action Function for this control.
actionFunc | A std::function conforming to IActionFunction |
Definition at line 201 of file IControl.h.
Referenced by ISkLottieControl::Draw(), IVToggleControl::DrawValue(), IVRadioButtonControl::GetButtonForPoint(), IBubbleControl::IBubbleControl(), IPopupMenuControl::IPopupMenuControl(), IWheelControl::IWheelControl(), and IURLControl::SetText().
|
inline |
Set the animation function.
func | A std::function conforming to IAnimationFunction |
Definition at line 477 of file IControl.h.
Referenced by DefaultClickActionFunc(), ILEDControl::Draw(), ISkLottieControl::Draw(), ILambdaControl::Draw(), IVToggleControl::DrawValue(), IBubbleControl::IBubbleControl(), IPopupMenuControl::IPopupMenuControl(), TestKeyboardControl::OnKeyDown(), 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 482 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 206 of file IControl.h.
Referenced by IVToggleControl::DrawValue(), IBubbleControl::IBubbleControl(), IVBakedPresetManagerControl::OnAttached(), IVNumberBoxControl::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 290 of file IControl.h.
|
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, IVSliderControl, IVKnobControl, IVSlideSwitchControl, and IVSwitchControl.
Definition at line 196 of file IControl.cpp.
References Clip(), ForValIdx(), GetAnimationFunction(), GetDelegate(), GetParamIdx(), GetUI(), GetValue(), NVals(), IEditorDelegate::SendParameterValueFromUI(), SetValue(), and IGraphics::UpdatePeers().
Referenced by IVPlotControl::AddPlotFunc(), IPopupMenuControl::CalculateMenuPanels(), IVKeyboardControl::Draw(), ISVGKnobControl::Draw(), IPanelControl::Draw(), ILambdaControl::Draw(), Hide(), IBubbleControl::IBubbleControl(), IsHit(), TestDropShadowControl::OnDrop(), TestImageControl::OnDrop(), TestSVGControl::OnDrop(), TestGesturesControl::OnInit(), ITextEntryControl::OnKeyDown(), TestKeyboardControl::OnKeyDown(), IVKeyboardControl::OnMidi(), IWheelControl::OnMidi(), TestTextControl::OnMouseDblClick(), TestCursorControl::OnMouseDown(), TestTextControl::OnMouseDown(), TestGradientControl::OnMouseDown(), TestSVGControl::OnMouseDown(), TestFontControl::OnMouseDown(), TestLayerControl::OnMouseDown(), TestAnimationControl::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), IVKeyboardControl::OnMouseDown(), IShaderControl::OnMouseDown(), ISkLottieControl::OnMouseDown(), IVTabSwitchControl::OnMouseDown(), TestMultiPathControl::OnMouseDown(), IVMultiSliderControl< MAXNC >::OnMouseDown(), IVKnobControl::OnMouseDown(), IBSwitchControl::OnMouseDown(), IButtonControlBase::OnMouseDown(), ISwitchControlBase::OnMouseDown(), ITextToggleControl::OnMouseDown(), IPopupMenuControl::OnMouseDrag(), TestBezierControl::OnMouseDrag(), TestMTControl::OnMouseDrag(), IShaderControl::OnMouseDrag(), IVKeyboardControl::OnMouseDrag(), IVXYPadControl::OnMouseDrag(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), ILambdaControl::OnMouseDrag(), IVSwitchControl::OnMouseOut(), IVKeyboardControl::OnMouseOut(), OnMouseOut(), IVTabSwitchControl::OnMouseOut(), IVKnobControl::OnMouseOut(), IVSliderControl::OnMouseOut(), IVColorSwatchControl::OnMouseOut(), IVTrackControlBase::OnMouseOut(), IPopupMenuControl::OnMouseOver(), TestBezierControl::OnMouseOver(), OnMouseOver(), IVTabSwitchControl::OnMouseOver(), IVKeyboardControl::OnMouseOver(), IVKnobControl::OnMouseOver(), IVSliderControl::OnMouseOver(), IVRangeSliderControl::OnMouseOver(), IVColorSwatchControl::OnMouseOver(), IVTrackControlBase::OnMouseOver(), ITextEntryControl::OnMouseUp(), TestTextSizeControl::OnMouseUp(), TestTextOrientationControl::OnMouseUp(), TestMTControl::OnMouseUp(), IShaderControl::OnMouseUp(), IVKeyboardControl::OnMouseUp(), IVKnobControl::OnMouseUp(), IVSliderControl::OnMouseUp(), IVXYPadControl::OnMouseUp(), IWheelControl::OnMouseUp(), IKnobControlBase::OnMouseUp(), ISliderControlBase::OnMouseUp(), ISwitchControlBase::OnMouseUp(), ILambdaControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), IRTTextControl< MAXNC, T >::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVScopeControl< MAXNC, MAXBUF >::OnMsgFromDelegate(), IVDisplayControl::OnMsgFromDelegate(), TestDirBrowseControl::OnPopupMenuSelection(), TestFlexBoxControl::OnPopupMenuSelection(), IVDisplayControl::OnResize(), IVButtonControl::OnResize(), IVScopeControl< MAXNC, MAXBUF >::OnResize(), IVSwitchControl::OnResize(), IShaderControl::OnResize(), IVTabSwitchControl::OnResize(), IVKeyboardControl::OnResize(), IVKnobControl::OnResize(), IVSliderControl::OnResize(), IVXYPadControl::OnResize(), IVPlotControl::OnResize(), IVGroupControl::OnResize(), IVColorSwatchControl::OnResize(), ISVGSliderControl::OnResize(), IBSliderControl::OnResize(), ISliderControlBase::OnResize(), IVTrackControlBase::OnResize(), IEditableTextControl::OnTextEntryCompletion(), IVKeyboardControl::OnTouchCancelled(), PromptUserInput(), IGraphics::SetAllControlsDirty(), IURLControl::SetCLColor(), IVSwitchControl::SetDirty(), IVKnobControl::SetDirty(), IVSliderControl::SetDirty(), ITextToggleControl::SetDirty(), SetDisabled(), IURLControl::SetMOColor(), SetParamIdx(), IVTrackControlBase::SetParams(), SetPTParameterHighlight(), ITextControl::SetStr(), ITextControl::SetStrFmt(), IBubbleControl::SetStrokeColor(), IVNumberBoxControl::SetStyle(), SetValueFromDelegate(), SetValueFromUserInput(), SetValueToDefault(), IVMultiSliderControl< MAXNC >::SnapToMouse(), SnapToMouse(), and SplashAnimationFunc().
|
virtual |
Sets disabled mode for the control, the default implementation modifies the mBlend member.
disable | true for disabled |
Definition at line 243 of file IControl.cpp.
References SetDirty().
Referenced by IGraphics::DisableControl(), and IsHidden().
|
inline |
Assign the control to a control group.
groupName | A CString indicating the control group that this control should belong to |
Definition at line 274 of file IControl.h.
References mGroup.
Referenced by IGraphics::AttachControl().
|
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 364 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 360 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 controls vals to set |
Definition at line 113 of file IControl.cpp.
References NVals(), and SetDirty().
Referenced by GetTooltip(), ICaptionControl::ICaptionControl(), IVTrackControlBase::SetParams(), and IURLControl::SetText().
|
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 289 of file IControl.cpp.
References IRECT::H(), IRECT::L, SetRECT(), SetTargetRECT(), IRECT::T, and IRECT::W().
Referenced by IGraphics::SetControlPosition(), and SetTargetAndDrawRECTs().
|
inline |
Set if the control should show parameter labels/units e.g.
"Hz" in text entry prompts
Definition at line 379 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 363 of file IControl.cpp.
References SetDirty().
Referenced by IGraphics::SetPTParameterHighlight(), and SetTargetAndDrawRECTs().
|
inline |
Set the rectangular draw area for this control, within the graphics context.
bounds | The control's bounds |
Definition at line 309 of file IControl.h.
References mMouseIsOver, and OnResize().
Referenced by IPopupMenuControl::CalculateMenuPanels(), IGraphicsLiveEdit::OnMouseUp(), SetPosition(), and IBubbleControl::SetStrokeColor().
|
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 301 of file IControl.cpp.
References IRECT::L, SetTargetAndDrawRECTs(), and IRECT::T.
Referenced by IGraphics::SetControlSize(), and SetTargetAndDrawRECTs().
|
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 321 of file IControl.h.
References mMouseIsOver, OnResize(), SetPosition(), SetPTParameterHighlight(), and SetSize().
Referenced by ITextEntryControl::OnKeyDown(), ICornerResizerControl::OnRescale(), IVNumberBoxControl::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 317 of file IControl.h.
References mMouseIsOver.
Referenced by IPopupMenuControl::CalculateMenuPanels(), IGraphicsLiveEdit::OnMouseUp(), IVDisplayControl::OnResize(), IVNumberBoxControl::OnResize(), IVButtonControl::OnResize(), IVScopeControl< MAXNC, MAXBUF >::OnResize(), IVSwitchControl::OnResize(), IVTabSwitchControl::OnResize(), IVKnobControl::OnResize(), IVSliderControl::OnResize(), IGraphicsLiveEdit::OnResize(), IVXYPadControl::OnResize(), IVPlotControl::OnResize(), IVGroupControl::OnResize(), IVPanelControl::OnResize(), IVColorSwatchControl::OnResize(), ISliderControlBase::OnResize(), IVTrackControlBase::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 286 of file IControl.h.
Referenced by ITextEntryControl::OnKeyDown(), and IURLControl::OnMouseOut().
|
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 301 of file IControl.h.
|
inline |
Set a tooltip for the control.
str | CString tooltip to be displayed |
Definition at line 210 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 145 of file IControl.cpp.
References NVals().
Referenced by ILEDControl::Draw(), IVToggleControl::DrawValue(), GetValIdxForPos(), IWheelControl::IWheelControl(), IVSwitchControl::OnInit(), IWheelControl::OnMidi(), IVTabSwitchControl::OnMouseDown(), IVMultiSliderControl< MAXNC >::OnMouseDown(), IBSwitchControl::OnMouseDown(), IButtonControlBase::OnMouseDown(), ISwitchControlBase::OnMouseDown(), ITextToggleControl::OnMouseDown(), IVXYPadControl::OnMouseDrag(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), IWheelControl::OnMouseUp(), IKnobControlBase::OnMouseWheel(), ISliderControlBase::OnMouseWheel(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), SetDirty(), IVNumberBoxControl::SetStyle(), SetValueFromDelegate(), SetValueFromUserInput(), SetValueToDefault(), IVMultiSliderControl< MAXNC >::SnapToMouse(), and 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 IVNumberBoxControl.
Definition at line 157 of file IControl.cpp.
References GetUI(), GetValue(), SetDirty(), and SetValue().
Referenced by GetValIdxForPos(), IGEditorDelegate::SendControlValueFromDelegate(), IGEditorDelegate::SendParameterValueFromDelegate(), 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 controls 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 IVNumberBoxControl.
Definition at line 172 of file IControl.cpp.
References GetValue(), SetDirty(), and SetValue().
Referenced by GetValIdxForPos(), OnPopupMenuSelection(), 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 181 of file IControl.cpp.
References ForValIdx(), IParam::GetDefault(), GetParam(), NVals(), SetDirty(), and SetValue().
Referenced by GetValIdxForPos(), 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 414 of file IControl.h.
Referenced by IWheelControl::IWheelControl().
|
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 |
Reimplemented in IVMultiSliderControl< MAXNC >.
Definition at line 395 of file IControl.cpp.
References Clip(), IRECT::Constrain(), ForValIdx(), IRECT::H(), IRECT::L, SetDirty(), SetValue(), IRECT::T, and IRECT::W().
Referenced by GetMouseIsOver(), ISliderControlBase::OnMouseDown(), IVRangeSliderControl::OnMouseDrag(), and ISliderControlBase::OnMouseDrag().
void IControl::StartAnimation | ( | int | duration | ) |
duration | Duration in milliseconds for the animation |
Definition at line 423 of file IControl.cpp.
Referenced by ILambdaControl::Draw(), GetMouseIsOver(), TestKeyboardControl::OnKeyDown(), and SetAnimation().
|
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 545 of file IControl.h.
Referenced by TestCursorControl::Draw(), TestImageControl::Draw(), TestSVGControl::Draw(), TestDirBrowseControl::Draw(), TestAnimationControl::Draw(), IVNumberBoxControl::Draw(), IVPanelControl::Draw(), IURLControl::Draw(), ICaptionControl::Draw(), IVButtonControl::DrawWidget(), IVSwitchControl::DrawWidget(), IVToggleControl::DrawWidget(), IVSlideSwitchControl::DrawWidget(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), IVXYPadControl::DrawWidget(), GetMouseIsOver(), OnMouseOut(), OnMouseOver(), SetRECT(), SetTargetAndDrawRECTs(), and SetTargetRECT().