class

CMiriMenuStack

Module
Miri
Header
#include "Miri/Widgets/MMenu.h"
Namespace
Miri

Public functions

ReturnsNameDescription
CMiriMenuStack&Get
voidPushMenuA 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_tGetRoutingWindowId
voidOpenContextMenuFramework context menu (U1): dismisses open menus, builds an MMenu from the entries and anchors it at the given window-space point, clamped to the window.
uint32_tGetWindowId
voidPopMenu
voidDismissAll
int32_tFindMenuContainingIndex of the topmost menu (submenus included) covering the point, -1 when the point is outside every open menu.
voidDismissAboveCloses every menu stacked above the given index, so acting on a parent menu takes its children down with it.
boolHasOpenMenus
TSharedPtr<MMenu>GetTopMenu
const std::vector<TSharedPtr<MMenu>>&GetStack
voidSetAnchorThe widget the menu hangs off.
TSharedPtr<MWidget>GetAnchor
boolDoesAnchorAbsorbPointer

Function details

Get

C++
static CMiriMenuStack& Get()

PushMenu

C++
void PushMenu(TSharedPtr<MMenu> 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

C++
uint32_t GetRoutingWindowId() const

OpenContextMenu

C++
void OpenContextMenu(std::vector<CMenuEntry> entries, const MiriVec2& position, uint32_t windowId = 0)

Framework context menu (U1): dismisses open menus, builds an MMenu from the entries and anchors it at the given window-space point, clamped to the window. The boilerplate every panel used to carry.

GetWindowId

C++
uint32_t GetWindowId() const

PopMenu

C++
void PopMenu()

DismissAll

C++
void DismissAll()

FindMenuContaining

C++
int32_t FindMenuContaining(const MiriVec2& absolutePosition) const

Index of the topmost menu (submenus included) covering the point, -1 when the point is outside every open menu.

DismissAbove

C++
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

C++
bool HasOpenMenus() const

GetTopMenu

C++
TSharedPtr<MMenu> GetTopMenu() const

GetStack

C++
const std::vector<TSharedPtr<MMenu>>& GetStack() const

SetAnchor

C++
void SetAnchor(TSharedPtr<MWidget> 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

C++
TSharedPtr<MWidget> GetAnchor() const

DoesAnchorAbsorbPointer

C++
bool DoesAnchorAbsorbPointer() const
Generated from Miri/Widgets/MMenu.h via miri.json · Dec 5, 2026Version 1.1.0