engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FMenuStack类 参考

Represents a stack of open menus. 更多...

#include <MenuStack.h>

Public 成员函数

void DismissAll ()
 Dismisses the entire menu stack
 
void DismissFrom (const TSharedPtr< IMenu > &InFromMenu)
 Dismisses the menu stack including InFromMenu and all its child menus Dismisses in reverse order (children first) 更多...
 
TSharedPtr< IMenu > FindMenuFromWindow (TSharedRef< SWindow > InWindow) const
 Finds a menu in the stack that owns InWindow. 更多...
 
TSharedPtr< IMenu > FindMenuInWidgetPath (const FWidgetPath &PathToQuery) const
 Searches from bottom to top of the widget path for a menu in the stack. 更多...
 
 FMenuStack ()
 Constructor
 
TSharedPtr< SWindow > GetHostWindow () const
 
bool GetToolTipForceFieldRect (const TSharedRef< IMenu > &InMenu, const FWidgetPath &InPathContainingMenu, FSlateRect &OutSlateRect) const
 Called by the application when showing tooltips. 更多...
 
bool HasMenus () const
 
bool HasOpenSubMenus (TSharedPtr< IMenu > InMenu) const
 
void OnWindowActivated (TSharedRef< SWindow > ActivatedWindow)
 Notifies the stack that a new window was activated. 更多...
 
void OnWindowDestroyed (TSharedRef< SWindow > InWindow)
 Called by the application when any window is destroyed. 更多...
 
TSharedRef< IMenu > Push (const FWidgetPath &InOwnerPath, const TSharedRef< SWidget > &InContent, const FVector2D &SummonLocation, const FPopupTransitionEffect &TransitionEffect, const bool bFocusImmediately=true, const FVector2D &SummonLocationSize=FVector2D::ZeroVector, TOptional< EPopupMethod > InMethod=TOptional< EPopupMethod >(), const bool bIsCollapsedByParent=true, const bool bEnablePerPixelTransparency=false)
 Pushes a new menu onto the stack. 更多...
 
TSharedRef< IMenu > Push (const TSharedPtr< IMenu > &InParentMenu, const TSharedRef< SWidget > &InContent, const FVector2D &SummonLocation, const FPopupTransitionEffect &TransitionEffect, const bool bFocusImmediately=true, const FVector2D &SummonLocationSize=FVector2D::ZeroVector, const bool bIsCollapsedByParent=true, const bool bEnablePerPixelTransparency=false)
 Pushes a new child menu onto the stack. 更多...
 
TSharedRef< IMenu > PushHosted (const FWidgetPath &InOwnerPath, const TSharedRef< IMenuHost > &InMenuHost, const TSharedRef< SWidget > &InContent, TSharedPtr< SWidget > &OutWrappedContent, const FPopupTransitionEffect &TransitionEffect, EShouldThrottle ShouldThrottle, const bool bIsCollapsedByParent=true)
 Pushes a new menu onto the stack that is drawn by an external host widget. 更多...
 
TSharedRef< IMenu > PushHosted (const TSharedPtr< IMenu > &InParentMenu, const TSharedRef< IMenuHost > &InMenuHost, const TSharedRef< SWidget > &InContent, TSharedPtr< SWidget > &OutWrappedContent, const FPopupTransitionEffect &TransitionEffect, EShouldThrottle ShouldThrottle, const bool bIsCollapsedByParent=true)
 Pushes a new child menu onto the stack that is drawn by an external host widget. 更多...
 

详细描述

Represents a stack of open menus.

The last item in the stack is the top most menu Menus are described as IMenus. Implementations of IMenu can control how the menus are created and presented (e.g. in their own window)

成员函数说明

◆ DismissFrom()

void FMenuStack::DismissFrom ( const TSharedPtr< IMenu > &  InFromMenu)

Dismisses the menu stack including InFromMenu and all its child menus Dismisses in reverse order (children first)

参数
InFromMenuThe menu to remove along with its children

◆ FindMenuFromWindow()

TSharedPtr< IMenu > FMenuStack::FindMenuFromWindow ( TSharedRef< SWindow >  InWindow) const

Finds a menu in the stack that owns InWindow.

Although this method isn't deprecated, it is intended for private use inside FMenuStack and its use as a public method should be avoided. Menus should be identified in client code as IMenu interfaces.

参数
InWindowThe window to look for
返回
The menu in the stack that owns InWindow, or an invalid ptr if not found

◆ FindMenuInWidgetPath()

TSharedPtr< IMenu > FMenuStack::FindMenuInWidgetPath ( const FWidgetPath &  PathToQuery) const

Searches from bottom to top of the widget path for a menu in the stack.

If the widget at the end of PathToQuery is inside a menu, there will be a menu content wrapper widget in the path.

参数
PathToQueryThe widget path to search for a menu
返回
The menu in the stack that contains the widget at the end of PathToQuery, or an invalid ptr if not found

◆ GetHostWindow()

TSharedPtr< SWindow > FMenuStack::GetHostWindow ( ) const
返回
Returns the window that is the parent of everything in the stack, if any. If the stack is empty, returns an invalid ptr.

◆ GetToolTipForceFieldRect()

bool FMenuStack::GetToolTipForceFieldRect ( const TSharedRef< IMenu > &  InMenu,
const FWidgetPath &  InPathContainingMenu,
FSlateRect &  OutSlateRect 
) const

Called by the application when showing tooltips.

It prevents tooltips from drawing over menu items. If the resulting bool is false, the resulting OutSlateRect will be [0,0,0,0] and should not be used.

参数
InMenuA menu in the stack, used to generate the force field rect
InPathContainingMenuA widget path containing InMenu. This could be generated but the application has the path so it helps performance to pass it in here.
OutSlateRectThe output rectangle enclosing the menu's children (created from the clipping rects in the geometry in PathContainingMenu)
返回
A bool indicating whether a solution was found. If false, the resulting OutSlateRect will be [0,0,0,0] and should not be used.

◆ HasMenus()

bool FMenuStack::HasMenus ( ) const
返回
True if the stack has one or more menus in it, false if it is empty.

◆ HasOpenSubMenus()

bool FMenuStack::HasOpenSubMenus ( TSharedPtr< IMenu >  InMenu) const
返回
Returns whether the menu has child menus. If the menu isn't in the stack, returns false.

◆ OnWindowActivated()

void FMenuStack::OnWindowActivated ( TSharedRef< SWindow >  ActivatedWindow)

Notifies the stack that a new window was activated.

The menu stack will be dismissed if the activated window is not a menu in the stack

参数
ActivatedWindowThe window that was just activated

◆ OnWindowDestroyed()

void FMenuStack::OnWindowDestroyed ( TSharedRef< SWindow >  InWindow)

Called by the application when any window is destroyed.

参数
InWindowThe window that was destroyed

◆ Push() [1/2]

TSharedRef< IMenu > FMenuStack::Push ( const FWidgetPath &  InOwnerPath,
const TSharedRef< SWidget > &  InContent,
const FVector2D &  SummonLocation,
const FPopupTransitionEffect &  TransitionEffect,
const bool  bFocusImmediately = true,
const FVector2D &  SummonLocationSize = FVector2D::ZeroVector,
TOptional< EPopupMethod >  InMethod = TOptional< EPopupMethod >(),
const bool  bIsCollapsedByParent = true,
const bool  bEnablePerPixelTransparency = false 
)

Pushes a new menu onto the stack.

The widget path will be searched for existing menus and the new menu will be parented appropriately. Menus are always auto-sized. Use fixed-size content if a fixed size is required.

参数
InOwnerPathThe widget path for the parent widget of this menu.
InContentThe menu's content
SummonLocationLocation in screen-space where the menu should appear
TransitionEffectAnimation to use when the popup appears
bFocusImmediatelyShould the popup steal focus when shown?
SummonLocationSizeAn optional size around the summon location which describes an area in which the menu may not appear
InMethodAn optional popup method that will override the default method for the widgets in InOwnerPath
bIsCollapsedByParentIs this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.
bEnablePerPixelTransparencyDoes the menu's content require per pixel transparency?

◆ Push() [2/2]

TSharedRef< IMenu > FMenuStack::Push ( const TSharedPtr< IMenu > &  InParentMenu,
const TSharedRef< SWidget > &  InContent,
const FVector2D &  SummonLocation,
const FPopupTransitionEffect &  TransitionEffect,
const bool  bFocusImmediately = true,
const FVector2D &  SummonLocationSize = FVector2D::ZeroVector,
const bool  bIsCollapsedByParent = true,
const bool  bEnablePerPixelTransparency = false 
)

Pushes a new child menu onto the stack.

Menus are always auto-sized. Use fixed-size content if a fixed size is required.

参数
InParentMenuThe parent menu for this menu
InContentThe menu's content
SummonLocationLocation in screen-space where the menu should appear
TransitionEffectAnimation to use when the popup appears
bFocusImmediatelyShould the popup steal focus when shown?
SummonLocationSizeAn optional size around the summon location which describes an area in which the menu may not appear
bIsCollapsedByParentIs this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.
bEnablePerPixelTransparencyDoes the menu's content require per pixel transparency?

◆ PushHosted() [1/2]

TSharedRef< IMenu > FMenuStack::PushHosted ( const FWidgetPath &  InOwnerPath,
const TSharedRef< IMenuHost > &  InMenuHost,
const TSharedRef< SWidget > &  InContent,
TSharedPtr< SWidget > &  OutWrappedContent,
const FPopupTransitionEffect &  TransitionEffect,
EShouldThrottle  ShouldThrottle,
const bool  bIsCollapsedByParent = true 
)

Pushes a new menu onto the stack that is drawn by an external host widget.

The widget path will be searched for existing menus and the new menu will be parented appropriately. Menus are always auto-sized. Use fixed-size content if a fixed size is required.

参数
InOwnerPathThe widget path for the parent widget of this menu
InMenuHostThe host widget that draws the menu's content
InContentThe menu's content
OutWrappedContentReturns the InContent wrapped with widgets needed by the menu stack system. This is what should be drawn by the host after this call.
TransitionEffectAnimation to use when the popup appears
bIsCollapsedByParentIs this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.

◆ PushHosted() [2/2]

TSharedRef< IMenu > FMenuStack::PushHosted ( const TSharedPtr< IMenu > &  InParentMenu,
const TSharedRef< IMenuHost > &  InMenuHost,
const TSharedRef< SWidget > &  InContent,
TSharedPtr< SWidget > &  OutWrappedContent,
const FPopupTransitionEffect &  TransitionEffect,
EShouldThrottle  ShouldThrottle,
const bool  bIsCollapsedByParent = true 
)

Pushes a new child menu onto the stack that is drawn by an external host widget.

Menus are always auto-sized. Use fixed-size content if a fixed size is required.

参数
InParentMenuThe parent menu for this menu
InMenuHostThe host widget that draws the menu's content
InContentThe menu's content
OutWrappedContentReturns the InContent wrapped with widgets needed by the menu stack system. This is what should be drawn by the host after this call.
TransitionEffectAnimation to use when the popup appears
bIsCollapsedByParentIs this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it.

该类的文档由以下文件生成: