AMenu
- Module
- Arc
- Header
#include "Arc/Widgets/AMenu.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
static constexpr float | kSubMenuHoverDelay | Default 0.3f. |
static constexpr float | kContextMenuMinWidth | Default 240.0f. |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
float | GetAppearAmount | 0..1 progress of the appear transition. |
void | SetEntries | |
const std::vector<CMenuEntry>& | GetEntries | |
void | SetSquareTopLeft | |
void | SetMinWidth | A floor over menu.json's 200 px minimum, for flyouts that are menus in all but width (the notification history is 360). |
void | PlayAppearAnimation | |
bool | ContainsPoint | |
void | HighlightFirstItem | |
void | SetPopupHosted | Hosted = painted into its own popup OS window: the background fills the whole window square-cornered, the slide/shadow that assumed an in-window overlay is skipped, and the open submenu is NOT painted inline (it has a popup window of its own). |
bool | IsPopupHosted | |
TSharedPtr<AMenu> | GetSubMenu | |
bool | OpenSubMenuByLabel | Opens the submenu entry with this label and leaves it hovered, as a pointer resting on it would (automation stages a menu this way). |
bool | HoverEntryByLabel | Leaves the enabled action row with this label hovered, as a pointer resting on it would. |
bool | InvokeEntryByLabel | Runs the enabled action row with this label the way a click does — every menu closes first. |
void | InvokeAndDismiss | Closes every menu, then runs the action. |
ArcVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
CReply | OnMouseMove | |
CReply | OnMouseButtonDown | |
CReply | OnKeyDown | |
const char* | GetTypeName |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(AMenu) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)GetAppearAmount
float GetAppearAmount() const0..1 progress of the appear transition. A menu hosted in its own OS window fades that window with it (the window manager reads this). A menu opened without PlayAppearAnimation reads as fully shown.
SetEntries
void SetEntries(std::vector<CMenuEntry> entries)GetEntries
const std::vector<CMenuEntry>& GetEntries() constSetSquareTopLeft
void SetSquareTopLeft(bool squareTopLeft)SetMinWidth
void SetMinWidth(float width)A floor over menu.json's 200 px minimum, for flyouts that are menus in all but width (the notification history is 360).
PlayAppearAnimation
void PlayAppearAnimation()ContainsPoint
bool ContainsPoint(const ArcVec2& absolutePosition) constHighlightFirstItem
void HighlightFirstItem()SetPopupHosted
void SetPopupHosted(bool hosted)Hosted = painted into its own popup OS window: the background fills the whole window square-cornered, the slide/shadow that assumed an in-window overlay is skipped, and the open submenu is NOT painted inline (it has a popup window of its own).
IsPopupHosted
bool IsPopupHosted() constGetSubMenu
TSharedPtr<AMenu> GetSubMenu() constOpenSubMenuByLabel
bool OpenSubMenuByLabel(const std::string& label)Opens the submenu entry with this label and leaves it hovered, as a pointer resting on it would (automation stages a menu this way).
HoverEntryByLabel
bool HoverEntryByLabel(const std::string& label)Leaves the enabled action row with this label hovered, as a pointer resting on it would. False when there is no such row.
InvokeEntryByLabel
bool InvokeEntryByLabel(const std::string& label)Runs the enabled action row with this label the way a click does — every menu closes first. False when no such row can run.
InvokeAndDismiss
static void InvokeAndDismiss(const std::function<void()>& action)Closes every menu, then runs the action.
ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float scale) const overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseMove
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonDown
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnKeyDown
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) overrideGetTypeName
const char* GetTypeName() const override