Detailed Description

A group of options.

Inheritance diagram for ContextMenus.OptionList:
ContextMenus.Option

Public Member Functions

ContextEvent createEvent ()
 Creates a context menu event. Used during the option collect process. More...
 
ContextEvent createEvent (string name)
 Creates a context menu event. Used during the option collect process. More...
 
void close ()
 Closes any visible version of this list only. Does not close parent menu's. E.g. closes a sub-menu if you're on one. More...
 
void close (bool all)
 Closes any visible version of this list. More...
 
virtual void run ()
 Runs this option (or option 0 if this is a list). More...
 
void run (int index)
 Runs the option at the given index. Closes the menu if it's open. More...
 
void display (InputPointer ip, bool instant)
 Collects options and displays the menu at the pointers position. Run this on the 'root' option list only (don't call it on submenu's). More...
 
Dictionary< string, object > buildGlobals (ContextEvent ce)
 Creates the set of globals to pass through to a standard window. Note that the only required value is 'options' (which is set to this list). Others are 'x' and 'y' - pixel values which originate from the ContextEvent's clientX/Y. More...
 
ContextEvent collectOptions (InputPointer ip)
 Collects options at the given pointer location. More...
 
void relocate ()
 If this list is visible on the UI, relocate it. Used if e.g. a gameobject is moving around. More...
 
ContextEvent collectOptions (GameObject go)
 Collects options from the given gameobject (or any parent in the hierarchy). More...
 
ContextEvent collectOptions (Element e)
 Collects options from the given HTML element. More...
 
Option add (string markup, OptionEventMethod method)
 Adds the given option to the list. Typically the markup would be a HTML variable. Note that you can also create your own option class (inherit from Option) and add that instead. More...
 
void add (Option option)
 Adds the given option to the list. More...
 

Static Public Member Functions

static void ResolveOptionFromClick (Dom.Event e)
 Used when an option is triggered (usually by an onclick attribute). More...
 
static Option ResolveOption (int index, Windows.Window window)
 Resolves an option from a context menu window's document. More...
 

Public Attributes

float range
 The 3D range an option can work from. More...
 
OptionList parent
 The list that this option belongs to. More...
 
IEventTarget trigger
 The source trigger. More...
 
Windows.Window window
 A visible window containing the list. More...
 
Element triggerElement
 The element that this is a list for. Related to trigger. More...
 
GameObject triggerGameObject
 The GO that this is the list for. Related to trigger. More...
 
List< Optionoptions =new List<Option>()
 The available options. More...
 

Properties

bool is3D [get]
 True if the trigger is a 3D object. More...
 
bool isOpen [get]
 True if this list is open on the UI. Also see window. More...
 
Vector2 rootScreenLocation [get]
 Gets the 2D location the root list will appear at. Doesn't figure out where submenu's should go. More...
 
Option firstOption [get]
 The first option or null. More...
 
Option this[int index] [get]
 Gets an option from this list safely - this won't throw any errors. More...
 
int length [get]
 The length of the list. More...
 
bool hasOptions [get]
 True if there's more than one option (or sub-option). More...
 

Member Function Documentation

Option ContextMenus.OptionList.add ( string  markup,
OptionEventMethod  method 
)
inline

Adds the given option to the list. Typically the markup would be a HTML variable. Note that you can also create your own option class (inherit from Option) and add that instead.

void ContextMenus.OptionList.add ( Option  option)
inline

Adds the given option to the list.

Dictionary<string,object> ContextMenus.OptionList.buildGlobals ( ContextEvent  ce)
inline

Creates the set of globals to pass through to a standard window. Note that the only required value is 'options' (which is set to this list). Others are 'x' and 'y' - pixel values which originate from the ContextEvent's clientX/Y.

void ContextMenus.OptionList.close ( )
inline

Closes any visible version of this list only. Does not close parent menu's. E.g. closes a sub-menu if you're on one.

void ContextMenus.OptionList.close ( bool  all)
inline

Closes any visible version of this list.

ContextEvent ContextMenus.OptionList.collectOptions ( InputPointer  ip)
inline

Collects options at the given pointer location.

ContextEvent ContextMenus.OptionList.collectOptions ( GameObject  go)
inline

Collects options from the given gameobject (or any parent in the hierarchy).

ContextEvent ContextMenus.OptionList.collectOptions ( Element  e)
inline

Collects options from the given HTML element.

ContextEvent ContextMenus.OptionList.createEvent ( )
inline

Creates a context menu event. Used during the option collect process.

ContextEvent ContextMenus.OptionList.createEvent ( string  name)
inline

Creates a context menu event. Used during the option collect process.

void ContextMenus.OptionList.display ( InputPointer  ip,
bool  instant 
)
inline

Collects options and displays the menu at the pointers position. Run this on the 'root' option list only (don't call it on submenu's).

void ContextMenus.OptionList.relocate ( )
inline

If this list is visible on the UI, relocate it. Used if e.g. a gameobject is moving around.

static Option ContextMenus.OptionList.ResolveOption ( int  index,
Windows.Window  window 
)
inlinestatic

Resolves an option from a context menu window's document.

static void ContextMenus.OptionList.ResolveOptionFromClick ( Dom.Event  e)
inlinestatic

Used when an option is triggered (usually by an onclick attribute).

virtual void ContextMenus.OptionList.run ( )
inlinevirtual

Runs this option (or option 0 if this is a list).

Reimplemented in ContextMenus.Option.

void ContextMenus.OptionList.run ( int  index)
inline

Runs the option at the given index. Closes the menu if it's open.

Member Data Documentation

List<Option> ContextMenus.OptionList.options =new List<Option>()

The available options.

OptionList ContextMenus.OptionList.parent

The list that this option belongs to.

float ContextMenus.OptionList.range

The 3D range an option can work from.

IEventTarget ContextMenus.OptionList.trigger

The source trigger.

Element ContextMenus.OptionList.triggerElement

The element that this is a list for. Related to trigger.

GameObject ContextMenus.OptionList.triggerGameObject

The GO that this is the list for. Related to trigger.

Windows.Window ContextMenus.OptionList.window

A visible window containing the list.

Property Documentation

Option ContextMenus.OptionList.firstOption
get

The first option or null.

bool ContextMenus.OptionList.hasOptions
get

True if there's more than one option (or sub-option).

bool ContextMenus.OptionList.is3D
get

True if the trigger is a 3D object.

bool ContextMenus.OptionList.isOpen
get

True if this list is open on the UI. Also see window.

int ContextMenus.OptionList.length
get

The length of the list.

Vector2 ContextMenus.OptionList.rootScreenLocation
get

Gets the 2D location the root list will appear at. Doesn't figure out where submenu's should go.

Option ContextMenus.OptionList.this[int index]
get

Gets an option from this list safely - this won't throw any errors.