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

A base control for a pop-up menu/drop-down list that stays within the bounds of the IGraphics context. More...

#include <IPopupMenuControl.h>

Inheritance diagram for IPopupMenuControl:
[legend]

Public Types

enum  EPopupState {
  kCollapsed = 0 , kExpanding , kExpanded , kCollapsing ,
  kFlickering , kSubMenuAppearing , kIdling
}
 An enumerated list, that is used to determine the state of the menu, mainly for animations. More...
 
enum  EArrowDir { kNorth , kEast , kSouth , kWest }
 

Public Member Functions

 IPopupMenuControl (int paramIdx=kNoParameter, IText text=IText(16), IRECT collapsedBounds=IRECT(), IRECT expandedBounds=IRECT())
 Create a new IPopupMenuControl. More...
 
void Draw (IGraphics &g) override
 Draw the control to the graphics context. More...
 
void OnMouseDown (float x, float y, const IMouseMod &mod) override
 Implement this method to respond to a mouse down event on this control. More...
 
void OnMouseDrag (float x, float y, float dX, float dY, const IMouseMod &mod) override
 Implement this method to respond to a mouse drag event on this control. More...
 
void OnMouseOver (float x, float y, const IMouseMod &mod) override
 Implement this method to respond to a mouseover event on this control. More...
 
void OnMouseOut () override
 Implement this method to respond to a mouseout event on this control. More...
 
void OnMouseWheel (float x, float y, const IMouseMod &mod, float d) override
 Implement this method to respond to a mouse wheel event on this control. More...
 
void OnEndAnimation () override
 
void CalculateMenuPanels (float x, float y)
 Called as the user moves the mouse around, in order to work out which menu panel should be on the screen, and create new ones as necessary (for submenus) More...
 
virtual void DrawCalloutArrow (IGraphics &g, const IRECT &bounds, IBlend *pBlend)
 Override this method to change the way Callout arrows are drawn. More...
 
virtual void DrawSubMenuCalloutArrow (IGraphics &g, const IRECT &bounds, IBlend *pBlend)
 Override this method to change the way Callout arrows for Submenus are drawn. More...
 
virtual void DrawPanelBackground (IGraphics &g, MenuPanel *panel)
 Override this method to change the background of the pop-up menu panel. More...
 
virtual void DrawPanelShadow (IGraphics &g, MenuPanel *panel)
 Override this method to change the shadow of the pop-up menu panel. More...
 
virtual void DrawCellBackground (IGraphics &g, const IRECT &bounds, const IPopupMenu::Item *pItem, bool sel, IBlend *pBlend)
 Override this method to change the way a cell's background is drawn. More...
 
virtual void DrawCellText (IGraphics &g, const IRECT &bounds, const IPopupMenu::Item *pItem, bool sel, IBlend *pBlend)
 Override this method to change the way a cell's text is drawn. More...
 
virtual void DrawTick (IGraphics &g, const IRECT &bounds, const IPopupMenu::Item *pItem, bool sel, IBlend *pBlend)
 Override this method to change the way a checked cell's "tick" is drawn. More...
 
virtual void DrawSubMenuArrow (IGraphics &g, const IRECT &bounds, const IPopupMenu::Item *pItem, bool sel, IBlend *pBlend)
 Override this method to change the way a submenu cell's arrow is drawn. More...
 
virtual void DrawUpArrow (IGraphics &g, const IRECT &bounds, bool sel, IBlend *pBlend)
 Override this method to change the way a scroll up cell's arrow is drawn. More...
 
virtual void DrawDownArrow (IGraphics &g, const IRECT &bounds, bool sel, IBlend *pBlend)
 Override this method to change the way a scroll Down cell's arrow is drawn. More...
 
virtual void DrawSeparator (IGraphics &g, const IRECT &bounds, IBlend *pBlend)
 Override this method to change the way a cell separator is drawn
More...
 
void SetPanelColor (IColor color)
 Call this to set the Panel color. More...
 
void SetCellBackgroundColor (IColor color)
 Call this to set the Cell color when mouse is over it. More...
 
void SetItemMouseoverColor (IColor color)
 Call this to set the mouseover color for text, tick, and arrows on menu panels. More...
 
void SetItemColor (IColor color)
 Call this to set the color of enabled text items, ticks and arrows on menu panels. More...
 
void SetDisabledItemColor (IColor color)
 Call this to set the text color of disabled items on menu panels. More...
 
void SetSeparatorColor (IColor color)
 Call this to set the Separator color on menu panels. More...
 
void SetShiftForSubmenus (float distance)
 Sets the amount the main menu is shifted to make room for submenus. More...
 
void SetMenuForcedSouth (bool isForcedSouth)
 If set true, the menu (kNorth) is forced to appear below it's control(kSouth) when it would normally be above - only if there is room for it. More...
 
void CreatePopupMenu (IPopupMenu &menu, const IRECT &anchorArea)
 Call this to create a pop-up menu. More...
 
bool GetExpanded () const
 
EPopupState GetState () const
 
void SetExpandedBounds (const IRECT &bounds)
 Force the menu to open with a specific bounds - useful on small screens for making it modal. More...
 
void SetCallout (bool callout)
 Set if the menu is shifted away from where the control is created with a callout arrow (for fat fingers on touchscreens) More...
 
void SetMaxBounds (const IRECT &bounds)
 Set the bounds that the menu can potentially occupy, if not the full graphics context. More...
 
- Public Member Functions inherited from IControl
 IControl (const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
 Constructor. More...
 
 IControl (const IRECT &bounds, const std::initializer_list< int > &params, IActionFunction actionFunc=nullptr)
 Constructor (range of parameters) More...
 
 IControl (const IRECT &bounds, IActionFunction actionFunc)
 Constructor (no paramIdx) More...
 
 IControl (const IControl &)=delete
 
void operator= (const IControl &)=delete
 
virtual ~IControl ()
 Destructor. More...
 
virtual void OnMouseDown (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse down event on this control. More...
 
virtual void OnMouseUp (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse up event on this control. More...
 
virtual void OnMouseDrag (float x, float y, float dX, float dY, const IMouseMod &mod)
 Implement this method to respond to a mouse drag event on this control. More...
 
virtual void OnMouseDblClick (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse double click event on this control. More...
 
virtual void OnMouseWheel (float x, float y, const IMouseMod &mod, float d)
 Implement this method to respond to a mouse wheel event on this control. More...
 
virtual bool OnKeyDown (float x, float y, const IKeyPress &key)
 Implement this method to respond to a key down event on this control. More...
 
virtual bool OnKeyUp (float x, float y, const IKeyPress &key)
 Implement this method to respond to a key up event on this control. More...
 
virtual void OnMouseOver (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouseover event on this control. More...
 
virtual void OnMouseOut ()
 Implement this method to respond to a mouseout event on this control. More...
 
virtual void OnTouchCancelled (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a touch cancel event on this control. More...
 
virtual void OnDrop (const char *str)
 Implement to do something when something was drag 'n dropped onto this control. More...
 
virtual void OnDropMultiple (const std::vector< const char * > &paths)
 Implement to handle multiple items drag 'n dropped onto this control. More...
 
virtual void OnRescale ()
 Implement to do something when graphics is scaled globally (e.g. More...
 
virtual void OnResize ()
 Called when IControl is constructed or resized using SetRect(). More...
 
virtual void OnInit ()
 Called just prior to when the control is attached, after its delegate and graphics member variable set. More...
 
virtual void OnAttached ()
 Called after the control has been attached, and its delegate and graphics member variable set. More...
 
virtual void OnMsgFromDelegate (int msgTag, int dataSize, const void *pData)
 Implement to receive messages sent to the control, see IEditorDelegate:SendControlMsgFromDelegate() More...
 
virtual void OnMidi (const IMidiMsg &msg)
 Implement to receive MIDI messages sent to the control if mWantsMidi == true, see IEditorDelegate:SendMidiMsgFromDelegate() More...
 
virtual bool OnGesture (const IGestureInfo &info)
 
virtual void CreateContextMenu (IPopupMenu &contextMenu)
 Called by default when the user right clicks a control. More...
 
virtual void OnPopupMenuSelection (IPopupMenu *pSelectedMenu, int valIdx)
 Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput. More...
 
virtual void OnTextEntryCompletion (const char *str, int valIdx)
 Implement this method to handle text input after IGraphics::CreateTextEntry/IControlPromptUserInput. More...
 
virtual void OnContextSelection (int itemSelected)
 Implement this to respond to a menu selection from CreateContextMenu();. More...
 
virtual void Draw (IGraphics &g)=0
 Draw the control to the graphics context. More...
 
virtual void DrawPTHighlight (IGraphics &g)
 Implement this to customise how a colored highlight is drawn on the control in ProTools (AAX format only), when a control is linked to a parameter that is automated. More...
 
void PromptUserInput (int valIdx=0)
 Call this method in response to a mouse event to create an edit box so the user can enter a value, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter) More...
 
void PromptUserInput (const IRECT &bounds, int valIdx=0)
 Create a text entry box so the user can enter a value, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter) specifying the bounds. More...
 
IControlSetActionFunction (IActionFunction actionFunc)
 Set an Action Function for this control. More...
 
IControlSetAnimationEndActionFunction (IActionFunction actionFunc)
 Set an Action Function to be called at the end of an animation. More...
 
IControlSetTooltip (const char *str)
 Set a tooltip for the control. More...
 
const char * GetTooltip () const
 
int GetParamIdx (int valIdx=0) const
 Get the index of a parameter that the control is linked to Normaly controls are either linked to a single parameter or no parameter but some may be linked to multiple parameters. More...
 
virtual void SetParamIdx (int paramIdx, int valIdx=0)
 Set the index of a parameter that the control is linked to If you are calling this "manually" to reuse a control for multiple parameters, you probably want to call IEditorDelegate::SendCurrentParamValuesFromDelegate() afterward, to update the control values. More...
 
int LinkedToParam (int paramIdx) const
 Check if the control is linked to a particular parameter. More...
 
int NVals () const
 
virtual int GetValIdxForPos (float x, float y) const
 Check to see which of the control's values relates to this x and y coordinate. More...
 
const IParamGetParam (int valIdx=0) const
 Get a const pointer to the IParam object (owned by the editor delegate class), associated with this control. More...
 
virtual void SetValueFromDelegate (double value, int valIdx=0)
 Set the control's value from the delegate This method is called from the class implementing the IEditorDelegate interface in order to update a control's value members and set it to be marked dirty for redraw. More...
 
virtual void SetValueFromUserInput (double value, int valIdx=0)
 Set the control's value after user input. More...
 
virtual void SetValueToDefault (int valIdx=kNoValIdx)
 Set one or all of the control's values to the default value of the associated parameter. More...
 
virtual void SetValue (double value, int valIdx=0)
 Set one of the control's values. More...
 
double GetValue (int valIdx=0) const
 Get the control's value. More...
 
void SetGroup (const char *groupName)
 Assign the control to a control group. More...
 
const char * GetGroup () const
 Get the group that the control belongs to, if any. More...
 
const ITextGetText () const
 Get the Text object for the control. More...
 
virtual void SetText (const IText &txt)
 Set the Text object typically used to determine font/layout/size etc of the main text in a control. More...
 
void SetBlend (const IBlend &blend)
 Set the Blend for this control. More...
 
IBlend GetBlend () const
 Get the Blend for this control. More...
 
int GetTextEntryLength () const
 Get the max number of characters that are allowed in text entry. More...
 
void SetTextEntryLength (int len)
 Set the max number of characters that are allowed in text entry. More...
 
const IRECTGetRECT () const
 Get the rectangular draw area for this control, within the graphics context. More...
 
void SetRECT (const IRECT &bounds)
 Set the rectangular draw area for this control, within the graphics context. More...
 
const IRECTGetTargetRECT () const
 Get the rectangular mouse tracking target area, within the graphics context for this control. More...
 
void SetTargetRECT (const IRECT &bounds)
 Set the rectangular mouse tracking target area, within the graphics context for this control. More...
 
void SetTargetAndDrawRECTs (const IRECT &bounds)
 Set BOTH the draw rect and the target area, within the graphics context for this control. More...
 
virtual void SetPosition (float x, float y)
 Set the position of the control, preserving the width and height. More...
 
virtual void SetSize (float w, float h)
 Set the size of the control, preserving the current position. More...
 
void SetPTParameterHighlight (bool isHighlighted, int color)
 Used internally by the AAX wrapper view interface to set the control parmeter highlight. More...
 
bool GetMouseDblAsSingleClick () const
 Get double click as single click By default, mouse double click has its own handler. More...
 
virtual void Hide (bool hide)
 Shows or hides the IControl. More...
 
bool IsHidden () const
 
virtual void SetDisabled (bool disable)
 Sets disabled mode for the control, the default implementation modifies the mBlend member. More...
 
bool IsDisabled () const
 
void SetMouseOverWhenDisabled (bool allow)
 Specify whether the control should respond to mouse overs when disabled. More...
 
void SetMouseEventsWhenDisabled (bool allow)
 Specify whether the control should respond to other mouse events when disabled. More...
 
bool GetMouseOverWhenDisabled () const
 
bool GetMouseEventsWhenDisabled () const
 
bool GetIgnoreMouse () const
 
virtual void SetIgnoreMouse (bool ignore)
 Specify whether the control should respond to mouse events. More...
 
bool GetPromptShowsParamLabel () const
 
void SetPromptShowsParamLabel (bool enable)
 Set if the control should show parameter labels/units e.g. More...
 
virtual bool IsHit (float x, float y) const
 Hit test the control. More...
 
virtual void SetDirty (bool triggerAction=true, int valIdx=kNoValIdx)
 Mark the control as dirty, i.e. More...
 
virtual void SetClean ()
 
void Animate ()
 
virtual bool IsDirty ()
 Called at each display refresh by the IGraphics draw loop, after IControl::Animate(), to determine if the control is marked as dirty. More...
 
void DisablePrompt (bool disable)
 Disable/enable default prompt for user input. More...
 
virtual void OnGUIIdle ()
 This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined. More...
 
int GetTag () const
 Get the control's tag. More...
 
void SetWantsMidi (bool enable=true)
 Specify whether this control wants to know about MIDI messages sent to the UI. More...
 
bool GetWantsMidi () const
 
void SetWantsMultiTouch (bool enable=true)
 Specify whether this control supports multiple touches. More...
 
bool GetWantsMultiTouch () const
 
IControlAttachGestureRecognizer (EGestureType type, IGestureFunc func)
 Add a IGestureFunc that should be triggered in response to a certain type of gesture. More...
 
virtual bool GetWantsGestures () const
 
EGestureType GetLastGesture () const
 
IGEditorDelegateGetDelegate ()
 Gets a pointer to the class implementing the IEditorDelegate interface that handles parameter changes from this IGraphics instance. More...
 
void SetDelegate (IGEditorDelegate &dlg)
 Used internally to set the mDelegate (and mGraphics) variables. More...
 
IContainerBaseGetParent () const
 
void SetParent (IContainerBase *pParent)
 
IGraphicsGetUI ()
 
const IGraphicsGetUI () const
 
bool GetMouseIsOver () const
 This can be used in IControl::Draw() to check if the mouse is over the control, without implementing mouse over methods. More...
 
virtual void SnapToMouse (float x, float y, EDirection direction, const IRECT &bounds, int valIdx=-1, double minClip=0., double maxClip=1.)
 Set control value based on x, y position within a rectangle. More...
 
virtual void OnEndAnimation ()
 
void StartAnimation (int duration)
 
void SetAnimation (IAnimationFunction func)
 Set the animation function. More...
 
void SetAnimation (IAnimationFunction func, int duration)
 Set the animation function and starts it. More...
 
IAnimationFunction GetAnimationFunction ()
 Get the control's animation function, if it exists. More...
 
IActionFunction GetActionFunction ()
 Get the control's action function, if it exists. More...
 
double GetAnimationProgress () const
 Get the progress in a control's animation, in the range 0-1. More...
 
Milliseconds GetAnimationDuration () const
 Get the duration of animations applied to the control. More...
 
template<class T >
T * As ()
 Helper function to dynamic cast an IControl to a subclass. More...
 

Protected Attributes

IRECT mSpecifiedCollapsedBounds
 
IRECT mSpecifiedExpandedBounds
 
- Protected Attributes inherited from IControl
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
 

Additional Inherited Members

- Protected Member Functions inherited from IControl
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)
 

Detailed Description

A base control for a pop-up menu/drop-down list that stays within the bounds of the IGraphics context.

This is mainly used as a special control that lives outside the main IGraphics control stack. For replacing generic menus this can be added with IGraphics::AttachPopupMenu(). If used in the main IControl stack, you probably want it to be the very last control that is added, so that it gets drawn on top.

Definition at line 29 of file IPopupMenuControl.h.

Member Enumeration Documentation

◆ EArrowDir

enum IPopupMenuControl::EArrowDir

Definition at line 46 of file IPopupMenuControl.h.

◆ EPopupState

An enumerated list, that is used to determine the state of the menu, mainly for animations.

Definition at line 35 of file IPopupMenuControl.h.

Constructor & Destructor Documentation

◆ IPopupMenuControl()

IPopupMenuControl::IPopupMenuControl ( int  paramIdx = kNoParameter,
IText  text = IText(16),
IRECT  collapsedBounds = IRECT(),
IRECT  expandedBounds = IRECT() 
)

Create a new IPopupMenuControl.

Parameters
paramIdxWhether this control should be linked to a parameter
textAn IText specifying properties of the menu text
collapsedBoundsIf this control, when collapsed should occupy an area of the graphics context, specify this, otherwise the collapsed area is empty
expandedBoundsIf you want to explicitly specify the size of the expanded pop-up, you can specify an area here

Definition at line 26 of file IPopupMenuControl.cpp.

References IControl::GetAnimationProgress(), IControl::SetActionFunction(), and IControl::SetAnimation().

◆ ~IPopupMenuControl()

IPopupMenuControl::~IPopupMenuControl ( )
virtual

Definition at line 77 of file IPopupMenuControl.cpp.

Member Function Documentation

◆ CalculateMenuPanels()

void IPopupMenuControl::CalculateMenuPanels ( float  x,
float  y 
)

Called as the user moves the mouse around, in order to work out which menu panel should be on the screen, and create new ones as necessary (for submenus)

Parameters
xMouse X position
yMouse Y position

Definition at line 504 of file IPopupMenuControl.cpp.

References IRECT::MH(), IControl::SetDirty(), IControl::SetRECT(), IControl::SetTargetRECT(), and IRECT::Union().

Referenced by OnMouseOver().

◆ CreatePopupMenu()

void IPopupMenuControl::CreatePopupMenu ( IPopupMenu menu,
const IRECT anchorArea 
)

Call this to create a pop-up menu.

Parameters
menuReference to a menu from which to populate this user interface control. NOTE: this object should not be a temporary, otherwise when the menu returns asynchronously, it may not exist.
anchorAreaThe pop-up menu opens adjacent to this area, but won't occupy it. At the moment, the menu is always below or right of that region.

Definition at line 439 of file IPopupMenuControl.cpp.

References IGraphics::GetBounds(), GetState(), IControl::GetUI(), and IRECT::W().

◆ Draw()

void IPopupMenuControl::Draw ( IGraphics g)
overridevirtual

Draw the control to the graphics context.

Parameters
gThe graphics context to which this control belongs.

Implements IControl.

Definition at line 82 of file IPopupMenuControl.cpp.

References DrawCalloutArrow(), DrawCellBackground(), DrawCellText(), DrawDownArrow(), DrawPanelBackground(), DrawPanelShadow(), DrawSeparator(), DrawSubMenuArrow(), DrawSubMenuCalloutArrow(), DrawTick(), and DrawUpArrow().

◆ DrawCalloutArrow()

void IPopupMenuControl::DrawCalloutArrow ( IGraphics g,
const IRECT bounds,
IBlend pBlend 
)
virtual

Override this method to change the way Callout arrows are drawn.

Definition at line 259 of file IPopupMenuControl.cpp.

References IGraphics::FillTriangle(), IRECT::H(), IRECT::MH(), and IRECT::MW().

Referenced by Draw().

◆ DrawCellBackground()

void IPopupMenuControl::DrawCellBackground ( IGraphics g,
const IRECT bounds,
const IPopupMenu::Item pItem,
bool  sel,
IBlend pBlend 
)
virtual

Override this method to change the way a cell's background is drawn.

Definition at line 343 of file IPopupMenuControl.cpp.

References IGraphics::FillRect(), and IRECT::GetHPadded().

Referenced by Draw().

◆ DrawCellText()

void IPopupMenuControl::DrawCellText ( IGraphics g,
const IRECT bounds,
const IPopupMenu::Item pItem,
bool  sel,
IBlend pBlend 
)
virtual

Override this method to change the way a cell's text is drawn.

Definition at line 349 of file IPopupMenuControl.cpp.

References IGraphics::DrawText(), and IRECT::GetCentredInside().

Referenced by Draw().

◆ DrawDownArrow()

void IPopupMenuControl::DrawDownArrow ( IGraphics g,
const IRECT bounds,
bool  sel,
IBlend pBlend 
)
virtual

Override this method to change the way a scroll Down cell's arrow is drawn.

Definition at line 419 of file IPopupMenuControl.cpp.

References IGraphics::FillTriangle(), IRECT::H(), IRECT::MH(), and IRECT::MW().

Referenced by Draw().

◆ DrawPanelBackground()

void IPopupMenuControl::DrawPanelBackground ( IGraphics g,
MenuPanel *  panel 
)
virtual

Override this method to change the background of the pop-up menu panel.

Definition at line 331 of file IPopupMenuControl.cpp.

References IGraphics::FillRoundRect().

Referenced by Draw().

◆ DrawPanelShadow()

void IPopupMenuControl::DrawPanelShadow ( IGraphics g,
MenuPanel *  panel 
)
virtual

Override this method to change the shadow of the pop-up menu panel.

Definition at line 337 of file IPopupMenuControl.cpp.

References IGraphics::DrawFastDropShadow(), and IRECT::GetPadded().

Referenced by Draw().

◆ DrawSeparator()

void IPopupMenuControl::DrawSeparator ( IGraphics g,
const IRECT bounds,
IBlend pBlend 
)
virtual

Override this method to change the way a cell separator is drawn

Definition at line 433 of file IPopupMenuControl.cpp.

References IGraphics::FillRect().

Referenced by Draw().

◆ DrawSubMenuArrow()

void IPopupMenuControl::DrawSubMenuArrow ( IGraphics g,
const IRECT bounds,
const IPopupMenu::Item pItem,
bool  sel,
IBlend pBlend 
)
virtual

Override this method to change the way a submenu cell's arrow is drawn.

Definition at line 374 of file IPopupMenuControl.cpp.

References IGraphics::FillTriangle(), IRECT::H(), and IRECT::MH().

Referenced by Draw().

◆ DrawSubMenuCalloutArrow()

void IPopupMenuControl::DrawSubMenuCalloutArrow ( IGraphics g,
const IRECT bounds,
IBlend pBlend 
)
virtual

Override this method to change the way Callout arrows for Submenus are drawn.

Definition at line 304 of file IPopupMenuControl.cpp.

References IGraphics::FillTriangle(), IRECT::H(), IRECT::MH(), and IRECT::MW().

Referenced by Draw().

◆ DrawTick()

void IPopupMenuControl::DrawTick ( IGraphics g,
const IRECT bounds,
const IPopupMenu::Item pItem,
bool  sel,
IBlend pBlend 
)
virtual

Override this method to change the way a checked cell's "tick" is drawn.

Definition at line 368 of file IPopupMenuControl.cpp.

References IGraphics::FillRoundRect(), and IRECT::GetCentredInside().

Referenced by Draw().

◆ DrawUpArrow()

void IPopupMenuControl::DrawUpArrow ( IGraphics g,
const IRECT bounds,
bool  sel,
IBlend pBlend 
)
virtual

Override this method to change the way a scroll up cell's arrow is drawn.

Definition at line 405 of file IPopupMenuControl.cpp.

References IGraphics::FillTriangle(), IRECT::H(), IRECT::MH(), and IRECT::MW().

Referenced by Draw().

◆ GetExpanded()

bool IPopupMenuControl::GetExpanded ( ) const
inline
Returns
\true if the pop-up is fully expanded

Definition at line 127 of file IPopupMenuControl.h.

◆ GetState()

EPopupState IPopupMenuControl::GetState ( ) const
inline
Returns
EPopupState indicating the state of the pop-up

Definition at line 130 of file IPopupMenuControl.h.

Referenced by CreatePopupMenu(), and OnMouseDown().

◆ OnEndAnimation()

void IPopupMenuControl::OnEndAnimation ( )
overridevirtual

Reimplemented from IControl.

Definition at line 837 of file IPopupMenuControl.cpp.

◆ OnMouseDown()

void IPopupMenuControl::OnMouseDown ( float  x,
float  y,
const IMouseMod mod 
)
overridevirtual

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

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

Reimplemented from IControl.

Definition at line 171 of file IPopupMenuControl.cpp.

References GetState(), and IControl::OnMouseDown().

◆ OnMouseDrag()

void IPopupMenuControl::OnMouseDrag ( float  x,
float  y,
float  dX,
float  dY,
const IMouseMod mod 
)
overridevirtual

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

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

Reimplemented from IControl.

Definition at line 182 of file IPopupMenuControl.cpp.

References IControl::SetDirty().

◆ OnMouseOut()

void IPopupMenuControl::OnMouseOut ( )
overridevirtual

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

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

Reimplemented from IControl.

Definition at line 237 of file IPopupMenuControl.cpp.

◆ OnMouseOver()

void IPopupMenuControl::OnMouseOver ( float  x,
float  y,
const IMouseMod mod 
)
overridevirtual

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

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

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

Reimplemented from IControl.

Definition at line 191 of file IPopupMenuControl.cpp.

References CalculateMenuPanels(), and IControl::SetDirty().

◆ OnMouseWheel()

void IPopupMenuControl::OnMouseWheel ( float  x,
float  y,
const IMouseMod mod,
float  d 
)
overridevirtual

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

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

Reimplemented from IControl.

Definition at line 242 of file IPopupMenuControl.cpp.

◆ SetCallout()

void IPopupMenuControl::SetCallout ( bool  callout)
inline

Set if the menu is shifted away from where the control is created with a callout arrow (for fat fingers on touchscreens)

Definition at line 136 of file IPopupMenuControl.h.

◆ SetCellBackgroundColor()

void IPopupMenuControl::SetCellBackgroundColor ( IColor  color)
inline

Call this to set the Cell color when mouse is over it.

Definition at line 104 of file IPopupMenuControl.h.

◆ SetDisabledItemColor()

void IPopupMenuControl::SetDisabledItemColor ( IColor  color)
inline

Call this to set the text color of disabled items on menu panels.

Definition at line 110 of file IPopupMenuControl.h.

◆ SetExpandedBounds()

void IPopupMenuControl::SetExpandedBounds ( const IRECT bounds)
inline

Force the menu to open with a specific bounds - useful on small screens for making it modal.

Definition at line 133 of file IPopupMenuControl.h.

◆ SetItemColor()

void IPopupMenuControl::SetItemColor ( IColor  color)
inline

Call this to set the color of enabled text items, ticks and arrows on menu panels.

Definition at line 108 of file IPopupMenuControl.h.

◆ SetItemMouseoverColor()

void IPopupMenuControl::SetItemMouseoverColor ( IColor  color)
inline

Call this to set the mouseover color for text, tick, and arrows on menu panels.

Definition at line 106 of file IPopupMenuControl.h.

◆ SetMaxBounds()

void IPopupMenuControl::SetMaxBounds ( const IRECT bounds)
inline

Set the bounds that the menu can potentially occupy, if not the full graphics context.

Definition at line 139 of file IPopupMenuControl.h.

◆ SetMenuForcedSouth()

void IPopupMenuControl::SetMenuForcedSouth ( bool  isForcedSouth)
inline

If set true, the menu (kNorth) is forced to appear below it's control(kSouth) when it would normally be above - only if there is room for it.

Definition at line 119 of file IPopupMenuControl.h.

◆ SetPanelColor()

void IPopupMenuControl::SetPanelColor ( IColor  color)
inline

Call this to set the Panel color.

Definition at line 102 of file IPopupMenuControl.h.

◆ SetSeparatorColor()

void IPopupMenuControl::SetSeparatorColor ( IColor  color)
inline

Call this to set the Separator color on menu panels.

Definition at line 112 of file IPopupMenuControl.h.

◆ SetShiftForSubmenus()

void IPopupMenuControl::SetShiftForSubmenus ( float  distance)
inline

Sets the amount the main menu is shifted to make room for submenus.

This helps on small GUI's where submenus will intrude upon the main menu. This does not affect the positioning of menus that do not contain submenus.

Parameters
distanceThe distance in pixels to shift the main menu. Use only positive numbers. It will shift left if the center of the control that opens it is right of center of UI and to the right if otherwise.

Definition at line 117 of file IPopupMenuControl.h.

Member Data Documentation

◆ mSpecifiedCollapsedBounds

IRECT IPopupMenuControl::mSpecifiedCollapsedBounds
protected

Definition at line 249 of file IPopupMenuControl.h.

◆ mSpecifiedExpandedBounds

IRECT IPopupMenuControl::mSpecifiedExpandedBounds
protected

Definition at line 250 of file IPopupMenuControl.h.


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