CArcMenuStack
- Module
- Arc
- Header
#include "Arc/Widgets/AMenu.h"- Namespace
Arcf
Public functions
| Returns | Name | Description |
|---|---|---|
CArcMenuStack& | Get | |
void | PushMenu | A menu opened while an input event for window W is being routed belongs to W whatever windowId the caller passed: most open helpers asked for the main window, so a menu opened from a panel torn off into its own window popped up over the main one, at the panel's local coordinates. |
uint32_t | GetRoutingWindowId | |
void | OpenContextMenu | Framework context menu (U1): dismisses open menus, builds an AMenu from the entries and anchors it at the given window-space point, clamped to the window. |
uint32_t | GetWindowId | |
void | PopMenu | |
void | DismissAll | |
int32_t | FindMenuContaining | Index of the topmost menu (submenus included) covering the point, -1 when the point is outside every open menu. |
void | DismissAbove | Closes every menu stacked above the given index, so acting on a parent menu takes its children down with it. |
bool | HasOpenMenus | |
TSharedPtr<AMenu> | GetTopMenu | |
const std::vector<TSharedPtr<AMenu>>& | GetStack | |
void | SetAnchor | The widget the menu hangs off. |
TSharedPtr<AWidget> | GetAnchor | |
bool | DoesAnchorAbsorbPointer |
Function details
Get
static CArcMenuStack& Get()PushMenu
void PushMenu(TSharedPtr<AMenu> menu, uint32_t windowId = 0)A menu opened while an input event for window W is being routed belongs to W whatever windowId the caller passed: most open helpers asked for the main window, so a menu opened from a panel torn off into its own window popped up over the main one, at the panel's local coordinates. The menu is re-clamped to W's bounds.
GetRoutingWindowId
uint32_t GetRoutingWindowId() constOpenContextMenu
void OpenContextMenu(std::vector<CMenuEntry> entries, const ArcVec2& position, uint32_t windowId = 0)Framework context menu (U1): dismisses open menus, builds an AMenu from the entries and anchors it at the given window-space point, clamped to the window. The boilerplate every panel used to carry.
GetWindowId
uint32_t GetWindowId() constPopMenu
void PopMenu()DismissAll
void DismissAll()FindMenuContaining
int32_t FindMenuContaining(const ArcVec2& absolutePosition) constIndex of the topmost menu (submenus included) covering the point, -1 when the point is outside every open menu.
DismissAbove
void DismissAbove(int32_t index)Closes every menu stacked above the given index, so acting on a parent menu takes its children down with it.
HasOpenMenus
bool HasOpenMenus() constGetTopMenu
TSharedPtr<AMenu> GetTopMenu() constGetStack
const std::vector<TSharedPtr<AMenu>>& GetStack() constSetAnchor
void SetAnchor(TSharedPtr<AWidget> anchor, bool absorbsPointer = false)The widget the menu hangs off. Hover always reaches it so a menu bar can switch between its triggers, but a press only reaches it when absorbsPointer is set — a launcher (menu bar, toolbar button) wants the press to toggle its own menu, while the panel a context menu was opened over is just background and must dismiss instead.
GetAnchor
TSharedPtr<AWidget> GetAnchor() constDoesAnchorAbsorbPointer
bool DoesAnchorAbsorbPointer() const