ContextMenus.Option Class Reference

Detailed Description

An option.

Inheritance diagram for ContextMenus.Option:
ContextMenus.OptionList

Public Member Functions

 Option ()
 
 Option (string markup, OptionEventMethod method)
 
void closeMenu ()
 Closes the whole menu. More...
 
override void run ()
 Run this option. More...
 
- Public Member Functions inherited from ContextMenus.OptionList
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...
 
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...
 

Public Attributes

int index
 The index of this option in the parent list. More...
 
string markup
 The HTML for this option. More...
 
PowerUI.HtmlElement buttonElement
 The latest element that represents 'this' option. Note that this is different from 'element' (which is potentially a submenu). Optionally set so e.g. submenu's can know where to go. More...
 
OptionEventMethod method
 The method to run. More...
 
- Public Attributes inherited from ContextMenus.OptionList
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

string mouseRef [get]
 Two attributes (optindex='index' and onclick='OptionList.ResolveOptionFromClick') which make an option clickable. More...
 
- Properties inherited from ContextMenus.OptionList
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ContextMenus.OptionList
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...
 

Constructor & Destructor Documentation

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

Member Function Documentation

void ContextMenus.Option.closeMenu ( )
inline

Closes the whole menu.

override void ContextMenus.Option.run ( )
inlinevirtual

Run this option.

Reimplemented from ContextMenus.OptionList.

Member Data Documentation

PowerUI.HtmlElement ContextMenus.Option.buttonElement

The latest element that represents 'this' option. Note that this is different from 'element' (which is potentially a submenu). Optionally set so e.g. submenu's can know where to go.

int ContextMenus.Option.index

The index of this option in the parent list.

string ContextMenus.Option.markup

The HTML for this option.

OptionEventMethod ContextMenus.Option.method

The method to run.

Property Documentation

string ContextMenus.Option.mouseRef
get

Two attributes (optindex='index' and onclick='OptionList.ResolveOptionFromClick') which make an option clickable.