Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

XInterface.GUIContextMenu


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
//====================================================================
//  Parent: GUI
//   Class: UT2K4UI.GUIContextMenu
//    Date: 05-01-2003
//
//  Right-click context menu.
//
//  Written by Joe Wilcox
//  (c) 2003, Epic Games, Inc.  All Rights Reserved
// ====================================================================

class GUIContextMenu extends GUIComponent
    native;

// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

var localized array<string>   ContextItems;                   // List of menu items
var int             ItemIndex;              // Selected item
var string          SelectionStyleName;     // Name of the Style to use
var GUIStyles       SelectionStyle;         // Holds the style
var int             ItemHeight;

delegate bool OnOpen(GUIContextMenu Sender);  // Return false to prevent menu from appearing
delegate bool OnClose(GUIContextMenu Sender);      // Return false to prevent menu from closing
delegate OnSelect(GUIContextMenu Sender, int ClickIndex);

// Return false to override default behavior
// ( here is where an item is selected & highlighted )
delegate bool OnContextHitTest(float MouseX, float MouseY);

function int AddItem(string NewItem)
{
    local int Index;

    Index = ContextItems.Length;
    ContextItems[Index] = NewItem;
    return Index;
}

function int InsertItem(string NewItem, int Index)
{
    if (Index >= ContextItems.Length)
        return AddItem(NewItem);

    if (Index <0)
        return -1;

    ContextItems.Insert(Index, 1);
    ContextItems[Index] = NewItem;
    return Index;
}

function bool RemoveItemByName(string ItemName)
{
    local int Index;
    for (Index=0;Index<ContextItems.Length;Index++)
        if (ContextItems[Index] ~= ItemName)
        {
            ContextItems.Remove(Index,1);
            return true;
        }

    return false;
}

function bool RemoveItemByIndex(int Index)
{
    if (Index>=0 && Index<ContextItems.Length)
    {
        ContextItems.Remove(Index,1);
        return true;
    }

    return false;
}

function bool ReplaceItem( int Index, string NewItem )
{
	if ( RemoveItemByIndex(Index) )
		return InsertItem(NewItem, Index) > 0;

	return false;

}

defaultproperties
{
     SelectionStyleName="ListSelection"
     FontScale=FNS_Small
     StyleName="ContextMenu"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: pr 5-2-2018 12:35:52.000 - Creation time: sk 18-3-2018 09:50:09.680 - Created with UnCodeX