Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

UE3:UTUI_ContextMenu (UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT3 Object >> UIRoot >> UIScreenObject >> UIObject >> UIList >> UIContextMenu >> UTUI_ContextMenu
Package: 
UTGame
Implemented interfaces
UIDataStorePublisher

Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.

A version of UIContextMenu that has been adapted to use 2DStringList's (required in order to get them working)

NOTE: It may not be possible to get this working through the UI Editor, if so, then use the 'OnOpenContextMenu' delegate to initialize (and fill, using 'SetMenuItems' etc.) the context menu through code

Properties[edit]

LastBoundField[edit]

Type: name


Default values[edit]

Property Value
CellDataComponent UIComp_ListPresenterCascade'UTContextMenuDataComponent'
CellLinkType LINKED_None
ColumnWidth
Member Value
Value 0.0

Subobjects[edit]

UTContextMenuDataComponent[edit]

Class: Engine.UIComp_ListPresenterCascade

Property Value
ListItemOverlay[0] UITexture'UTGame.Default__UTUI_ContextMenu:UTContextMenuDataComponent.NormalOverlayTemplate'
ListItemOverlay[1] UITexture'UTGame.Default__UTUI_ContextMenu:UTContextMenuDataComponent.ActiveOverlayTemplate'
ListItemOverlay[2] UITexture'UTGame.Default__UTUI_ContextMenu:UTContextMenuDataComponent.SelectionOverlayTemplate'
ListItemOverlay[3] UITexture'UTGame.Default__UTUI_ContextMenu:UTContextMenuDataComponent.HoverOverlayTemplate'

WidgetEventComponent[edit]

Class: Engine.UIComp_Event

Inherits from: UIContextMenu.WidgetEventComponent

No new values.

Functions[edit]

Events[edit]

ClearMenuItems[edit]

event bool ClearMenuItems (UIObject Widget)

Overrides: UIContextMenu.ClearMenuItems

(Description copied from UIContextMenu.ClearMenuItems)
Removes all context menu items from this context menu.

Parameters:

  • Widget - the widget that invoked this context menu

Returns:

TRUE if the operation was successful.

FindMenuItemIndex[edit]

event int FindMenuItemIndex (UIObject Widget, string ItemToFind)

Overrides: UIContextMenu.FindMenuItemIndex

(Description copied from UIContextMenu.FindMenuItemIndex)
Finds the location of a string in the context menu's array of items.

Parameters:

  • Widget - the widget that invoked this context menu
  • ItemToFind - the string to find

Returns:

the index for the specified value, or INDEX_NONE if it couldn't be found.

GetAllMenuItems[edit]

event bool GetAllMenuItems (UIObject Widget, out array<stringout_MenuItems)

Overrides: UIContextMenu.GetAllMenuItems

(Description copied from UIContextMenu.GetAllMenuItems)
Gets a list of the current context menu items strings.

Parameters:

  • Widget - the widget that invoked this context menu
  • out_MenuItems - receives the context menu item strings

Returns:

TRUE if the operation was successful.

GetMenuItem[edit]

event bool GetMenuItem (UIObject Widget, int IndexToGet, out string out_MenuItem)

Overrides: UIContextMenu.GetMenuItem

(Description copied from UIContextMenu.GetMenuItem)
Gets the value of the context menu item located at a specified position in the array.

Parameters:

  • Widget - the widget that invoked this context menu
  • IndexToGet - the index of the context menu item to get
  • out_MenuItem - receives the value of the context menu item text.

Returns:

TRUE if the value was successfully retrieved and copied to out_MenuItem.

InsertMenuItem[edit]

event bool InsertMenuItem (UIObject Widget, string Item, optional int InsertIndex, optional bool bAllowDuplicates)

Overrides: UIContextMenu.InsertMenuItem

(Description copied from UIContextMenu.InsertMenuItem)
Sets the text for a single context menu item.

Parameters:

  • Widget - the widget that invoked this context menu
  • Item - the text to add/insert to the context menu
  • InsertIndex - the location [in the list's items array] to insert the new menu item; if not specified, will be appended to the end of the array.
  • bAllowDuplicates - specify TRUE to allow multiple menu items with the same value; otherwise, the new value will not be added if an existing item has the same value.

Returns:

TRUE if the operation was successful.

RemoveMenuItem[edit]

event bool RemoveMenuItem (UIObject Widget, string ItemToRemove)

Overrides: UIContextMenu.RemoveMenuItem

(Description copied from UIContextMenu.RemoveMenuItem)
Removes a single menu item from the context menu.

Parameters:

  • Widget - the widget that invoked this context menu
  • ItemToRemove - the string that should be removed from the context menu

Returns:

TRUE if the value was successfully removed or didn't exist in the first place.

RemoveMenuItemAtIndex[edit]

event bool RemoveMenuItemAtIndex (UIObject Widget, int IndexToRemove)

Overrides: UIContextMenu.RemoveMenuItemAtIndex

(Description copied from UIContextMenu.RemoveMenuItemAtIndex)
Removes the context menu item located at a specified position in the array.

Parameters:

  • Widget - the widget that invoked this context menu
  • IndexToRemove - the index of the item that should be removed.

Returns:

TRUE if the value was successfully removed; FALSE if IndexToRemove wasn't valid or the value couldn't be removed.

SetMenuItems[edit]

event bool SetMenuItems (UIObject Widget, array<stringNewMenuItems, optional bool bClearExisting, optional int InsertIndex)

Overrides: UIContextMenu.SetMenuItems

(Description copied from UIContextMenu.SetMenuItems)
Sets the text that will be displayed in the context menu items.

Parameters:

  • Widget - the widget that invoked this context menu
  • NewMenuItems - the menu items to use in the context menu
  • bClearExisting - specify TRUE to clear any existing menu items; otherwise, the new items will be appended to the old
  • InsertIndex - the location [in the list's items array] to insert the new menu items at; only relevant if bClearExisting is FALSE

Returns:

TRUE if the operation was successful.

Other instance functions[edit]

AddMenuItem[edit]

function bool AddMenuItem (UIObject Widget, string Item, optional bool bDisabledItem, optional bool bAllowDuplicates)


Get2DDataStoreRef[edit]

function UTUIDataStore_2DStringList Get2DDataStoreRef (UIObject Widget, optional name WidgetField)


GetMenuItemCount[edit]

function int GetMenuItemCount (UIObject Widget)


SetContextTitle[edit]

function bool SetContextTitle (UIObject Widget, string ContextTitle)