Detailed Description

This function is called when a -face font is done loading.

This class extends Element to include an easy to use element.video property (unavailable on mobile).

Provides additional Element methods for managing focus.

A useful function which splits all letters in an element into their own individual elements. Great for animating each letter on it's own. Similar to lettering.js.

This represents a html element in the DOM.

Inheritance diagram for PowerUI.Element:
PowerUI.TextElement PowerUI.VariableElement PowerUI.WordElement

Public Member Functions

void AddToAttributeLookups ()
 Adds this element to all fast lookups. More...
 
void AddToAttributeLookup (string attrib, AttributeLookup lookup)
 Adds this element to the given attribute lookup. More...
 
bool OnClickEvent (UIEvent clickEvent)
 Called by a tag handler when a click occurs. More...
 
bool MouseWasDown ()
 Was the mouse clicked on this element during the last mouse down? More...
 
bool RunClick (UIEvent clickEvent)
 Performs a click (mouse down or up) on this element. More...
 
bool GotClicked (UIEvent clickEvent)
 Run a click on this element. More...
 
bool RunClickOnKids (UIEvent clickEvent)
 Attempts to run a click on the children of this element. More...
 
void FontLoaded (DynamicFont font)
 Called when a -face font is done loading. More...
 
void PositionGlobally (ComputedStyle relativeTo)
 This is the second pass of layout requests. It positions the element in global screen space and also fires the render events which in turn generate or reallocates mesh blocks. This call applies to all it's children elements too. More...
 
void PositionLocally ()
 Positions this element and all it's children relative to their parent. More...
 
bool IsMousedOver ()
 True if the mouse is over this element. Most accurate compared to MousedOver, but is more intensive. In general, only use this one from within onmouseover or onmouseout. More...
 
bool MouseOver (UIEvent mouseEvent)
 Let the element know the mouse has moved over it. More...
 
void MouseOut (UIEvent mouseEvent)
 Let the element know the mouse is no longer over it. More...
 
void OnMouseMoveEvent (UIEvent moveEvent)
 Called on focused elements only (see focus()). Runs the mouse move functions. More...
 
bool RunMouseOverOnKids (UIEvent mouseEvent)
 Performs a mouse over on the child elements of this element. More...
 
bool RunMouseOver (UIEvent mouseEvent)
 Performs a mouse over on this element. More...
 
bool RunBlocked (string attribute, UIEvent uiEvent)
 Runs the given function held in the named attribute (e.g. onkeydown) and checks if that function blocked the event. In the case of a blocked event, no default action should occur. More...
 
object Run (string attribute, params object[] args)
 Runs a nitro function whos name is held in the given attribute. More...
 
object RunLiteral (string attribute, object[] args)
 Runs a nitro function whos name is held in the given attribute with a fixed block of arguments. More...
 
 Element (string tag)
 Creates a new element with the given tag, parenting it to the main UI document. More...
 
 Element (string tag, Element parent)
 Creates a new element with the given tag and parent. More...
 
 Element (Document document, Element parent)
 Creates a new element for the given document and as a child of the given parent. More...
 
override void OnChildrenLoaded ()
 
void SetDocument (Document document)
 Changes the document used by this element and all it's kids. Used by iframes. More...
 
void OnLoaded (string objectLoaded)
 Called by some tags when their content is loaded. E.g. img tag or iframe. More...
 
void Focus ()
 Focuses this element so it receives events such as keypresses. More...
 
void Unfocus ()
 Unfocuses this element so it will no longer receive events like keypresses. More...
 
void OnKeyPress (UIEvent pressEvent)
 Called by a tag handler when a key press occurs. More...
 
void RefreshSelector (Css.SelectorType type, string selector)
 Refreshes this elements css style if the given selector matches its own. More...
 
Element getElementByTagName (string tag)
 Gets the first child element with the given tag. More...
 
List< ElementgetElementsByTagName (string tag)
 Gets all child elements with the given tag. More...
 
List< ElementgetElementsByTagName (string tag, bool stopWithOne)
 Gets all child elements with the given tag. More...
 
bool getElementsByTagName (string tag, bool stopWithOne, List< Element > results)
 Gets all child elements with the given tag. More...
 
List< ElementgetElementsByClassName (string className)
 Gets all elements with the given class name(s), seperated by spaces. May include this element or any of it's kids. More...
 
void getElementsByClassName (string[] classes, List< Element > results)
 Gets all elements with the given class name(s). May include this element or any of it's kids. More...
 
List< ElementgetElementsByAttribute (string property, string value)
 Gets all elements with the given attribute. May include this element or any of it's kids. More...
 
List< ElementgetElementsWithProperty (string property, string value)
 Gets all elements with the given attribute. May include this element or any of it's kids. More...
 
void getElementsByAttribute (string property, string value, List< Element > results)
 Gets all elements with the given property. May include this element or any of it's kids. More...
 
Element getElementByAttribute (string property, string value)
 Gets an element with the given property. May be this element or any of it's kids. More...
 
override void SetTag (string tag)
 Sets the tag and the tag handler for this element. More...
 
override TagHandler GetHandler ()
 Gets the tag handler for this element. More...
 
void SetWidthForKids (ComputedStyle parent)
 Resolves any percentage widths for all child elements using the given parent element. More...
 
void SetHeightForKids (ComputedStyle parent)
 Resolves any percentage heights for all child elements using the given parent element. More...
 
override void ResetVariable (string name)
 
override void ResetAllVariables ()
 Requests all child elements to reload their if they have any. More...
 
virtual string ToTextString ()
 Converts this elements content to its pure text format (no html will be in the output). More...
 
override string ToString ()
 Converts this element and it's content to it's html representitive. More...
 
void appendTextContent (string text)
 Appends the given literal text to the content of this element. This is good for preventing html injection as the text will be taken literally. More...
 
void appendInnerHTML (string text)
 Appends the given html text to the content of this element. More...
 
void RemovedFromDOM ()
 Called when this element got removed from the DOM. More...
 
void WentOffScreen ()
 Called when this element goes offscreen. More...
 
Element appendChild (string text)
 Appends the given element defined as text. More...
 
void appendChild (Element element)
 Adds the given element to the children of this element. More...
 
void AppendNewChild (Element element)
 Adds the given element to the children of this element. Note that this does not update CSS; it should be used for new elements only. More...
 
bool isChild (Element childElement)
 Checks if the given element is a child of this element. More...
 
void removeChild (Element element)
 Removes the given child from this element. More...
 
void scrollBy (int x, int y)
 Scrolls the element by the given values. More...
 
void scrollTo (int x, int y)
 Scrolls the element to the given exact values. More...
 
void RequireLayout ()
 Forces a layout to occur if one is required. You should almost never need to call this directly - it's only needed if you want to read the fully computed size of an element immediately after having updated it's style. More...
 
UIAnimation animate (string css, float constantSpeedTime, float timeToAccelAndDecel)
 Animates css properties on this element. More...
 
UIAnimation animate (string css, float constantSpeedTime)
 Animates css properties on this element. More...
 
UIAnimation animate (string css, float constantSpeedTime, float timeToAccelerate, float timeToDecelerate)
 Animates css properties on this element. More...
 
void Lettering ()
 
Element GetFocusableAbove ()
 Gets the nearest focusable element above this. More...
 
Element GetFocusableBelow ()
 Gets the nearest focusable element below this. More...
 
Element GetFocusableLeft ()
 Gets the nearest focusable element left of this. More...
 
Element GetFocusableRight ()
 Gets the nearest focusable element right of this. More...
 
Element GetFocusedNext ()
 Used for tab focus. Gets the next available focusable element. More...
 
Vector2 AxisDistanceFrom (float x, float y)
 Finds out the distance in pixels on the x and y axis the given point is away from this elements midpoint. More...
 
float DistanceFromFast (float x, float y)
 Gets a relative 2D distance of this elements midpoint from the given point. The value returned is a fast distance used for comparison only. Use DistanceFrom for the correct distance. More...
 
float DistanceFrom (float x, float y)
 Gets the 2D distance of this elements midpoint from the given point. More...
 
bool IsLeftOf (ComputedStyle computed)
 Checks if this element is to the left of the given style. More...
 
bool IsRightOf (ComputedStyle computed)
 Checks if this element is to the right of the given style. More...
 
bool IsAbove (ComputedStyle computed)
 Checks if this element is above the given style. More...
 
bool IsBelow (ComputedStyle computed)
 Checks if this element is below the given style. More...
 
CanvasContext getContext (string text)
 Gets a rendering context for this canvas (if it is a canvas element!). More...
 
Element GetForm ()
 Internal use only. PowerUI.Element.formElement. Scans up the DOM to find the parent form element. More...
 
void submit ()
 Submits the form this element is in. More...
 
void stop ()
 Stops the video. More...
 
void pause ()
 Pauses the video. More...
 
void play ()
 Plays the video. More...
 

Public Attributes

object Data
 A custom data object for whatever you would like to pass through for e.g. callbacks. More...
 
bool HScrollbar
 True if this element has a horizontal scrollbar that it must render. Don't set manually. More...
 
bool VScrollbar
 True if this element has a vertical scrollbar that it must render. Don't set manually. More...
 
Document Document
 The html document that this element belongs to. More...
 
Element ParentNode
 Internal use only. The parent of this element. Use PowerUI.Element.parentNode instead. More...
 
ElementStyle Style
 Internal use only. The style of this element. Use PowerUI.Element.style instead. More...
 
HtmlTagHandler Handler
 The handler for the tag of this element (e.g. a, body, u etc). More...
 
MouseOverState MousedOver
 Is the mouse is over this element, and if so, did the element consume it? Unreliable from within onmouseover/out - use IsMousedOver for that. More...
 
InputTag VerticalScrollbar
 The vertical scrollbar that scrolls this element if there is one. More...
 
InputTag HorizontalScrollbar
 The horizontal scrollbar that scrolls this element if there is one. More...
 
List< ElementKidsToRender
 Internal use only. Children being rendered are set here. This allows multiple threads to access the DOM. More...
 
bool IsRebuildingChildren
 This is true if the ChildNodes are being rebuilt. True for a tiny amount of time, but prevents collisions with the renderer thread. More...
 

Protected Member Functions

override string GetVariableValue (string variableString)
 Looks up the value for a named More...
 
override MLElement CreateTagElement (MLLexer lexer)
 Generates a new html element. More...
 
override MLVariableElement CreateVariableElement ()
 Generates a new variable element. More...
 
override MLTextElement CreateTextElement ()
 Generates a new text element. More...
 

Protected Attributes

List< ElementChildNodes
 Internal use only. The set of child elements for this element. More...
 

Package Functions

void Lettering (List< Element > into, Element parent)
 

Properties

Text3D text3D [get]
 Gets the text3D instance on this element. Great for raw control over your 3D text rendering. More...
 
bool HasBackground [get]
 True if this element has some form of background applied to it. More...
 
string textContent [get, set]
 Gets or sets the text content of this element (i.e. the content without any html.). Setting this is good for preventing any html injection as it will be taken literally. More...
 
string className [get, set]
 The css class attribute of this element. Won't ever be null. Note that it can potentially hold multiple names, e.g. "red button". More...
 
string id [get, set]
 The ID of this element. Won't ever be null. More...
 
string innerHTML [get, set]
 Gets or sets the innerHTML of this element. More...
 
List< ElementchildNodes [get, set]
 The set of child elements of this element. More...
 
bool isRooted [get]
 True if this element is in any document and is rooted. More...
 
Document document [get]
 The document this element is on. More...
 
Document contentDocument [get]
 Applies to iframes. The document contained in the iframe itself. More...
 
int offsetLeft [get, set]
 The x location of this element on the screen. Note that you may need to take scrolling into account (scrollLeft). More...
 
int offsetTop [get, set]
 The y location of this element on the screen. Note that you may need to take scrolling into account (scrollTop). More...
 
int scrollLeft [get, set]
 The amount of pixels the content of this element is scrolled horizontally. More...
 
int scrollTop [get, set]
 The amount of pixels the content of this element is scrolled vertically. More...
 
int contentHeight [get]
 The height of the content inside this element. More...
 
int contentWidth [get]
 The width of the content inside this element. More...
 
int pixelHeight [get]
 The height of this element. More...
 
int pixelWidth [get]
 The width of this element. More...
 
int scrollHeight [get]
 The height of this element without margins or borders. More...
 
int scrollWidth [get]
 The width of this element without margins or borders. More...
 
bool Checked [get, set]
 Gets or sets the checked state of this radio/checkbox input. Note that 'checked' is a C# keyword, thus the uppercase. Nitro is not case-sensitive, so element.checked works fine there. More...
 
Texture2D image [get, set]
 Gets or sets the image from the background of this element. More...
 
Element firstChild [get]
 The first child of this element. More...
 
Element lastChild [get]
 The last child of this element. More...
 
Element previousElementSibling [get]
 The sibling before this one under this elements parent. Null if this is the first child. More...
 
Element nextElementSibling [get]
 The sibling following this one under this elements parent. Null if this is the last child. More...
 
Element previousSibling [get]
 The element before this one at this same level in the DOM tree. More...
 
Element nextSibling [get]
 The element after this one at this same level in the DOM tree. More...
 
bool focused [get, set]
 Gets or sets if this element is focused. More...
 
int childIndex [get]
 Gets the index of this element in it's parents childNodes. More...
 
int childElementCount [get]
 The number of child elements of this element. More...
 
Element parentNode [get, set]
 Gets or sets the parent html element of this element. More...
 
Css.ComputedStyle computedStyle [get]
 Gets the computed style of this element. More...
 
Css.ElementStyle style [get]
 Gets the style of this element. More...
 
bool focusable [get]
 True if this element is focusable. More...
 
Element formElement [get]
 Scans up the DOM to find the parent form element. Note: PowerUI.Element.form may be more useful than the element iself. More...
 
FormTag form [get]
 Scans up the DOM to find the parent form element's handler. The object returned provides useful methods such as PowerUI.FormTag.submit. More...
 
string value [get, set]
 Gets or sets the value of this element. Input/Select elements only. More...
 
string content [get, set]
 Gets or sets the value as html for this element. Input/Select elements only. More...
 
int selectedIndex [get, set]
 Updates the current selected element in a dropdown menu. More...
 
VideoTag videoHandler [get]
 Gets the video tag associated with this element (if it's a video element). More...
 
MovieTexture video [get]
 The source movie texture. More...
 
bool playing [get]
 Is the video playing? More...
 
bool paused [get]
 Is the video paused? More...
 
AudioClip audioTrack [get]
 Gets the audio track of the video. More...
 

Events

EventHandler OnKeyUp
 An alternative to Nitro. Called when this element receives a keyup. More...
 
EventHandler OnKeyDown
 An alternative to Nitro. Called when this element receives a keydown. More...
 
EventHandler OnMouseUp
 An alternative to Nitro. Called when this element receives a mouseup. More...
 
EventHandler OnMouseOut
 An alternative to Nitro. Called when this element receives a mouseout. More...
 
EventHandler OnMouseDown
 An alternative to Nitro. Called when this element receives a mousedown. More...
 
EventHandler OnMouseMove
 An alternative to Nitro. Called when this element receives a mousemove. Note that it must be focused. More...
 
EventHandler OnMouseOver
 An alternative to Nitro. Called when this element receives a mouseover. More...
 
EventHandler OnLoadedEvent
 An alternative to Nitro. Called when this element receives a loaded event (e.g. iframe). More...
 
EventHandler OnFocus
 An alternative to Nitro. Called when this element gets focused. More...
 
EventHandler OnBlur
 An alternative to Nitro. Called when this element is unfocused (blurred). More...
 
EventHandler OnClick
 An alternative to Nitro. Called when this element receives a full click. More...
 

Private Member Functions

 Element (Document document, MLLexer lexer, Element parent)
 Creates a new element for the given document and as a child of the given parent with content to parse. More...
 
void SetDimensionForKids (ComputedStyle parent, bool isWidth)
 Resolves any percentages for all child elements using the given parent element. More...
 
void ClearChildNodes ()
 Clears the child node set such that they no longer have a parent. More...
 
Element GetFocusableOverride (string direction)
 Checks if this element defines a specific focusable element by id in the given direction. E.g. it's defined focus-right, focus-left, focus-up, focus-down. More...
 
float HorizontalDistanceRatio (float x, float y)
 Finds the distance on both axis of the given point from this elements midpoint. Then, it divides the y result by the x result giving a ratio of 'horizontalness' of the distance. This is used by focus graphs, as it can be used to perceive how leftward or how rightward an element is. More...
 
float VerticalDistanceRatio (float x, float y)
 Finds the distance on both axis of the given point from this elements midpoint. Then, it divides the x result by the y result giving a ratio of 'verticalness' of the distance. This is used by focus graphs, as it can be used to perceive how upward or how downward an element is. More...
 

Constructor & Destructor Documentation

PowerUI.Element.Element ( string  tag)
inline

Creates a new element with the given tag, parenting it to the main UI document.

Parameters
tagThe tag, e.g. "<div id='hello'>".
PowerUI.Element.Element ( string  tag,
Element  parent 
)
inline

Creates a new element with the given tag and parent.

Parameters
tagThe tag, e.g. "<div id='hello'>".
parentThe element to parent to.
PowerUI.Element.Element ( Document  document,
Element  parent 
)
inline

Creates a new element for the given document and as a child of the given parent.

Parameters
documentThe document that this element will belong to.
parentThe element that this element will be parented to.
PowerUI.Element.Element ( Document  document,
MLLexer  lexer,
Element  parent 
)
inlineprivate

Creates a new element for the given document and as a child of the given parent with content to parse.

Parameters
documentThe document that this element will belong to.
lexerAn MLLexer containing the tag. No children are read; Just this tag only.
parentThe element that this element will be parented to.

Member Function Documentation

void PowerUI.Element.AddToAttributeLookup ( string  attrib,
AttributeLookup  lookup 
)
inline

Adds this element to the given attribute lookup.

void PowerUI.Element.AddToAttributeLookups ( )
inline

Adds this element to all fast lookups.

UIAnimation PowerUI.Element.animate ( string  css,
float  constantSpeedTime,
float  timeToAccelAndDecel 
)
inline

Animates css properties on this element.

Parameters
cssA set of target css properties, e.g. "rotate-x:45deg;scale-y:110%;".
constantSpeedTimeThe time, in seconds, to take animating the properties at a constant speed.
timeToAccelAndDecelThe time, in seconds, to take accelerating and decelerating.
Returns
An animation instance which can be used to track progress.
UIAnimation PowerUI.Element.animate ( string  css,
float  constantSpeedTime 
)
inline

Animates css properties on this element.

Parameters
cssA set of target css properties, e.g. "rotate-x:45deg;scale-y:110%;".
constantSpeedTimeThe time, in seconds, to take animating the properties at a constant speed.
Returns
An animation instance which can be used to track progress.
UIAnimation PowerUI.Element.animate ( string  css,
float  constantSpeedTime,
float  timeToAccelerate,
float  timeToDecelerate 
)
inline

Animates css properties on this element.

Parameters
cssA set of target css properties, e.g. "rotate-x:45deg;scale-y:110%;".
constantSpeedTimeThe time, in seconds, to take animating the properties at a constant speed.
timeToAccelerateThe time, in seconds, to take accelerating.
timeToDecelerateThe time, in seconds, to take decelerating.
Returns
An animation instance which can be used to track progress.
Element PowerUI.Element.appendChild ( string  text)
inline

Appends the given element defined as text.

Parameters
textThe element as text, e.g. "<div id='someNewElement'>".
Returns
The newly created element.
void PowerUI.Element.appendChild ( Element  element)
inline

Adds the given element to the children of this element.

Parameters
elementThe child element to add.
void PowerUI.Element.appendInnerHTML ( string  text)
inline

Appends the given html text to the content of this element.

Parameters
textThe html text to append.
void PowerUI.Element.AppendNewChild ( Element  element)
inline

Adds the given element to the children of this element. Note that this does not update CSS; it should be used for new elements only.

Parameters
elementThe child element to add.
void PowerUI.Element.appendTextContent ( string  text)
inline

Appends the given literal text to the content of this element. This is good for preventing html injection as the text will be taken literally.

Parameters
textThe literal text to append.
Vector2 PowerUI.Element.AxisDistanceFrom ( float  x,
float  y 
)
inline

Finds out the distance in pixels on the x and y axis the given point is away from this elements midpoint.

Parameters
xThe x coordinate to check from.
yThe y coordinate to check from.
Returns
The distance on each axis from the given point as a vector.
void PowerUI.Element.ClearChildNodes ( )
inlineprivate

Clears the child node set such that they no longer have a parent.

override MLElement PowerUI.Element.CreateTagElement ( MLLexer  lexer)
inlineprotected

Generates a new html element.

Returns
A new html element.
override MLTextElement PowerUI.Element.CreateTextElement ( )
inlineprotected

Generates a new text element.

Returns
A new html text element.
override MLVariableElement PowerUI.Element.CreateVariableElement ( )
inlineprotected

Generates a new variable element.

Returns
A new html variable element.
float PowerUI.Element.DistanceFrom ( float  x,
float  y 
)
inline

Gets the 2D distance of this elements midpoint from the given point.

Parameters
xThe x coordinate to check from.
yThe y coordinate to check from.
float PowerUI.Element.DistanceFromFast ( float  x,
float  y 
)
inline

Gets a relative 2D distance of this elements midpoint from the given point. The value returned is a fast distance used for comparison only. Use DistanceFrom for the correct distance.

Parameters
xThe x coordinate to check from.
yThe y coordinate to check from.
void PowerUI.Element.Focus ( )
inline

Focuses this element so it receives events such as keypresses.

void PowerUI.Element.FontLoaded ( DynamicFont  font)
inline

Called when a -face font is done loading.

CanvasContext PowerUI.Element.getContext ( string  text)
inline

Gets a rendering context for this canvas (if it is a canvas element!).

Parameters
textThe context type e.g. "2D".
Element PowerUI.Element.getElementByAttribute ( string  property,
string  value 
)
inline

Gets an element with the given property. May be this element or any of it's kids.

Parameters
propertyThe name of the property to find. E.g. "id".
valueOptional. The value that the property should be; null for any value.
Returns
The first element found that matches.

Gets an element with the given attribute. May be this element or any of it's kids.

Parameters
propertyThe name of the attribute to find. E.g. "id".
valueOptional. The value that the attribute should be; null for any value.
Returns
The first element found that matches.
Element PowerUI.Element.getElementByTagName ( string  tag)
inline

Gets the first child element with the given tag.

Parameters
tagThe html tag to look for.
Returns
The first child with the tag.
List<Element> PowerUI.Element.getElementsByAttribute ( string  property,
string  value 
)
inline

Gets all elements with the given attribute. May include this element or any of it's kids.

Parameters
propertyThe name of the attribute to find. E.g. "id".
valueOptional. The value that the attribute should be; null for any value.
Returns
A list of all matches.
void PowerUI.Element.getElementsByAttribute ( string  property,
string  value,
List< Element results 
)
inline

Gets all elements with the given property. May include this element or any of it's kids.

Parameters
propertyThe name of the property to find. E.g. "id".
valueOptional. The value that the property should be; null for any value.
resultsThe set of elements to add results to.
List<Element> PowerUI.Element.getElementsByClassName ( string  className)
inline

Gets all elements with the given class name(s), seperated by spaces. May include this element or any of it's kids.

Parameters
classNameThe name of the classes to find. E.g. "red box".
Returns
A list of all matches.
void PowerUI.Element.getElementsByClassName ( string[]  classes,
List< Element results 
)
inline

Gets all elements with the given class name(s). May include this element or any of it's kids.

Parameters
classesThe name of the classes to find. No duplicates allowed.
resultsThe set into which the results are placed.
List<Element> PowerUI.Element.getElementsByTagName ( string  tag)
inline

Gets all child elements with the given tag.

Parameters
tagThe html tag to look for.
Returns
The set of all tags with this tag.
List<Element> PowerUI.Element.getElementsByTagName ( string  tag,
bool  stopWithOne 
)
inline

Gets all child elements with the given tag.

Parameters
tagThe html tag to look for.
stopWithOneTrue if the search should stop when one is found.
Returns
The set of all tags with this tag.
bool PowerUI.Element.getElementsByTagName ( string  tag,
bool  stopWithOne,
List< Element results 
)
inline

Gets all child elements with the given tag.

Parameters
tagThe html tag to look for.
Returns
The set of all tags with this tag.
List<Element> PowerUI.Element.getElementsWithProperty ( string  property,
string  value 
)
inline

Gets all elements with the given attribute. May include this element or any of it's kids.

Parameters
attributeThe name of the attribute to find. E.g. "id".
valueOptional. The value that the attribute should be; null for any value.
Returns
A list of all matches.
Element PowerUI.Element.GetFocusableAbove ( )
inline

Gets the nearest focusable element above this.

Returns
The nearest focusable element above. Null if there is none.
Element PowerUI.Element.GetFocusableBelow ( )
inline

Gets the nearest focusable element below this.

Returns
The nearest focusable element below. Null if there is none.
Element PowerUI.Element.GetFocusableLeft ( )
inline

Gets the nearest focusable element left of this.

Returns
The nearest focusable element to the left. Null if there is none.
Element PowerUI.Element.GetFocusableOverride ( string  direction)
inlineprivate

Checks if this element defines a specific focusable element by id in the given direction. E.g. it's defined focus-right, focus-left, focus-up, focus-down.

Parameters
directionThe direction to look for an override in.
Returns
The overriding element, if found. Null otherwise.
Element PowerUI.Element.GetFocusableRight ( )
inline

Gets the nearest focusable element right of this.

Returns
The nearest focusable element to the right. Null if there is none.
Element PowerUI.Element.GetFocusedNext ( )
inline

Used for tab focus. Gets the next available focusable element.

Returns
The next available focusable element. Null if there is none.
Element PowerUI.Element.GetForm ( )
inline

Internal use only. PowerUI.Element.formElement. Scans up the DOM to find the parent form element.

Returns
The parent form element, if found.
override TagHandler PowerUI.Element.GetHandler ( )
inline

Gets the tag handler for this element.

Returns
The tag handler.
override string PowerUI.Element.GetVariableValue ( string  variableString)
inlineprotected

Looks up the value for a named

Parameters
variableStringThe of the variable to find.
Returns
The variable value; null if it was not found.
bool PowerUI.Element.GotClicked ( UIEvent  clickEvent)
inline

Run a click on this element.

Parameters
clickEventThe event that represents the mouse location.
Returns
True if this element accepted the click.
float PowerUI.Element.HorizontalDistanceRatio ( float  x,
float  y 
)
inlineprivate

Finds the distance on both axis of the given point from this elements midpoint. Then, it divides the y result by the x result giving a ratio of 'horizontalness' of the distance. This is used by focus graphs, as it can be used to perceive how leftward or how rightward an element is.

bool PowerUI.Element.IsAbove ( ComputedStyle  computed)
inline

Checks if this element is above the given style.

Returns
True if this element is above the given style.
bool PowerUI.Element.IsBelow ( ComputedStyle  computed)
inline

Checks if this element is below the given style.

Returns
True if this element is below the given style.
bool PowerUI.Element.isChild ( Element  childElement)
inline

Checks if the given element is a child of this element.

Parameters
childElementThe element to check if it's a child of this or not.
Returns
True if the given element is actually a child of this.
bool PowerUI.Element.IsLeftOf ( ComputedStyle  computed)
inline

Checks if this element is to the left of the given style.

Returns
True if this element is to the left of the given style.
bool PowerUI.Element.IsMousedOver ( )
inline

True if the mouse is over this element. Most accurate compared to MousedOver, but is more intensive. In general, only use this one from within onmouseover or onmouseout.

bool PowerUI.Element.IsRightOf ( ComputedStyle  computed)
inline

Checks if this element is to the right of the given style.

Returns
True if this element is to the right of the given style.
void PowerUI.Element.Lettering ( )
inline
void PowerUI.Element.Lettering ( List< Element into,
Element  parent 
)
inlinepackage
void PowerUI.Element.MouseOut ( UIEvent  mouseEvent)
inline

Let the element know the mouse is no longer over it.

Parameters
mouseEventThe UIEvent that represents where the mouse is.
bool PowerUI.Element.MouseOver ( UIEvent  mouseEvent)
inline

Let the element know the mouse has moved over it.

Parameters
mouseEventThe UIEvent that represents where the mouse is.
Returns
True if this element accepts the mouse; false otherwise.
bool PowerUI.Element.MouseWasDown ( )
inline

Was the mouse clicked on this element during the last mouse down?

override void PowerUI.Element.OnChildrenLoaded ( )
inline
bool PowerUI.Element.OnClickEvent ( UIEvent  clickEvent)
inline

Called by a tag handler when a click occurs.

Parameters
clickEventThe event that represents the click.
Returns
True if it accepted the click.
void PowerUI.Element.OnKeyPress ( UIEvent  pressEvent)
inline

Called by a tag handler when a key press occurs.

Parameters
clickEventThe event that represents the key press.
void PowerUI.Element.OnLoaded ( string  objectLoaded)
inline

Called by some tags when their content is loaded. E.g. img tag or iframe.

Parameters
objectLoadedThe object which has loaded. E.g. background-image or webpage.
void PowerUI.Element.OnMouseMoveEvent ( UIEvent  moveEvent)
inline

Called on focused elements only (see focus()). Runs the mouse move functions.

void PowerUI.Element.pause ( )
inline

Pauses the video.

void PowerUI.Element.play ( )
inline

Plays the video.

void PowerUI.Element.PositionGlobally ( ComputedStyle  relativeTo)
inline

This is the second pass of layout requests. It positions the element in global screen space and also fires the render events which in turn generate or reallocates mesh blocks. This call applies to all it's children elements too.

Parameters
relativeToThe current style we are positioning relative to.
void PowerUI.Element.PositionLocally ( )
inline

Positions this element and all it's children relative to their parent.

void PowerUI.Element.RefreshSelector ( Css.SelectorType  type,
string  selector 
)
inline

Refreshes this elements css style if the given selector matches its own.

Parameters
typeThe type of the given selector.
selectorThe selector to match with.
void PowerUI.Element.removeChild ( Element  element)
inline

Removes the given child from this element.

Parameters
elementThe child element to remove.
void PowerUI.Element.RemovedFromDOM ( )
inline

Called when this element got removed from the DOM.

void PowerUI.Element.RequireLayout ( )
inline

Forces a layout to occur if one is required. You should almost never need to call this directly - it's only needed if you want to read the fully computed size of an element immediately after having updated it's style.

override void PowerUI.Element.ResetAllVariables ( )
inline

Requests all child elements to reload their if they have any.

override void PowerUI.Element.ResetVariable ( string  name)
inline
object PowerUI.Element.Run ( string  attribute,
params object[]  args 
)
inline

Runs a nitro function whos name is held in the given attribute.

Parameters
attributeThe name of the attribute in lowercase, e.g. "onmousedown".
argsAdditional parameters you would like to pass to your function.
Returns
The value returned by the function.
Exceptions
NullReferenceExceptionThrown if the function does not exist.
bool PowerUI.Element.RunBlocked ( string  attribute,
UIEvent  uiEvent 
)
inline

Runs the given function held in the named attribute (e.g. onkeydown) and checks if that function blocked the event. In the case of a blocked event, no default action should occur.

Parameters
attributeThe name of the attribute, e.g. onkeydown.
uiEventA standard UIEvent containing e.g. key/mouse information.
bool PowerUI.Element.RunClick ( UIEvent  clickEvent)
inline

Performs a click (mouse down or up) on this element.

Parameters
clickEventThe event that represents where the mouse is.
Returns
True if this or any child accepted the click.
bool PowerUI.Element.RunClickOnKids ( UIEvent  clickEvent)
inline

Attempts to run a click on the children of this element.

Parameters
clickEventThe click event which represents various properties of the mouse.
Returns
True if any child element consumed this event.
object PowerUI.Element.RunLiteral ( string  attribute,
object[]  args 
)
inline

Runs a nitro function whos name is held in the given attribute with a fixed block of arguments.

Parameters
attributeThe name of the attribute in lowercase, e.g. "onmousedown".
argsAdditional parameters you would like to pass to your function.
Returns
The value returned by the function.
Exceptions
NullReferenceExceptionThrown if the function does not exist.
bool PowerUI.Element.RunMouseOver ( UIEvent  mouseEvent)
inline

Performs a mouse over on this element.

Parameters
clickEventThe event that represents where the mouse is.
Returns
True if this or any child has the mouse over it.
bool PowerUI.Element.RunMouseOverOnKids ( UIEvent  mouseEvent)
inline

Performs a mouse over on the child elements of this element.

Parameters
mouseEventThe event that represents where the mouse is.
Returns
True if any child elements had the mouse over it.
void PowerUI.Element.scrollBy ( int  x,
int  y 
)
inline

Scrolls the element by the given values.

Parameters
xThe change in x pixels.
yThe change in y pixels.
void PowerUI.Element.scrollTo ( int  x,
int  y 
)
inline

Scrolls the element to the given exact values.

Parameters
xThe x offset in pixels.
yThe y offset in pixels.
void PowerUI.Element.SetDimensionForKids ( ComputedStyle  parent,
bool  isWidth 
)
inlineprivate

Resolves any percentages for all child elements using the given parent element.

Parameters
parentThe computed style to base percentages on.
isWidthTrue if we should use the width of the parent; false for height.
void PowerUI.Element.SetDocument ( Document  document)
inline

Changes the document used by this element and all it's kids. Used by iframes.

Parameters
documentThe new document to use.
void PowerUI.Element.SetHeightForKids ( ComputedStyle  parent)
inline

Resolves any percentage heights for all child elements using the given parent element.

Parameters
parentThe computed style to base percentages on.
override void PowerUI.Element.SetTag ( string  tag)
inline

Sets the tag and the tag handler for this element.

Parameters
tagThe new tag for this element, e.g. "span".
void PowerUI.Element.SetWidthForKids ( ComputedStyle  parent)
inline

Resolves any percentage widths for all child elements using the given parent element.

Parameters
parentThe computed style to base percentages on.
void PowerUI.Element.stop ( )
inline

Stops the video.

void PowerUI.Element.submit ( )
inline

Submits the form this element is in.

override string PowerUI.Element.ToString ( )
inline

Converts this element and it's content to it's html representitive.

Returns
This element and its children as a html string.
virtual string PowerUI.Element.ToTextString ( )
inlinevirtual

Converts this elements content to its pure text format (no html will be in the output).

Returns
The text only content of this element.

Reimplemented in PowerUI.TextElement, and PowerUI.VariableElement.

void PowerUI.Element.Unfocus ( )
inline

Unfocuses this element so it will no longer receive events like keypresses.

float PowerUI.Element.VerticalDistanceRatio ( float  x,
float  y 
)
inlineprivate

Finds the distance on both axis of the given point from this elements midpoint. Then, it divides the x result by the y result giving a ratio of 'verticalness' of the distance. This is used by focus graphs, as it can be used to perceive how upward or how downward an element is.

void PowerUI.Element.WentOffScreen ( )
inline

Called when this element goes offscreen.

Member Data Documentation

List<Element> PowerUI.Element.ChildNodes
protected

Internal use only. The set of child elements for this element.

object PowerUI.Element.Data

A custom data object for whatever you would like to pass through for e.g. callbacks.

Document PowerUI.Element.Document

The html document that this element belongs to.

HtmlTagHandler PowerUI.Element.Handler

The handler for the tag of this element (e.g. a, body, u etc).

InputTag PowerUI.Element.HorizontalScrollbar

The horizontal scrollbar that scrolls this element if there is one.

bool PowerUI.Element.HScrollbar

True if this element has a horizontal scrollbar that it must render. Don't set manually.

bool PowerUI.Element.IsRebuildingChildren

This is true if the ChildNodes are being rebuilt. True for a tiny amount of time, but prevents collisions with the renderer thread.

List<Element> PowerUI.Element.KidsToRender

Internal use only. Children being rendered are set here. This allows multiple threads to access the DOM.

MouseOverState PowerUI.Element.MousedOver

Is the mouse is over this element, and if so, did the element consume it? Unreliable from within onmouseover/out - use IsMousedOver for that.

Element PowerUI.Element.ParentNode

Internal use only. The parent of this element. Use PowerUI.Element.parentNode instead.

ElementStyle PowerUI.Element.Style

Internal use only. The style of this element. Use PowerUI.Element.style instead.

InputTag PowerUI.Element.VerticalScrollbar

The vertical scrollbar that scrolls this element if there is one.

bool PowerUI.Element.VScrollbar

True if this element has a vertical scrollbar that it must render. Don't set manually.

Property Documentation

AudioClip PowerUI.Element.audioTrack
get

Gets the audio track of the video.

bool PowerUI.Element.Checked
getset

Gets or sets the checked state of this radio/checkbox input. Note that 'checked' is a C# keyword, thus the uppercase. Nitro is not case-sensitive, so element.checked works fine there.

int PowerUI.Element.childElementCount
get

The number of child elements of this element.

int PowerUI.Element.childIndex
get

Gets the index of this element in it's parents childNodes.

List<Element> PowerUI.Element.childNodes
getset

The set of child elements of this element.

string PowerUI.Element.className
getset

The css class attribute of this element. Won't ever be null. Note that it can potentially hold multiple names, e.g. "red button".

Css.ComputedStyle PowerUI.Element.computedStyle
get

Gets the computed style of this element.

string PowerUI.Element.content
getset

Gets or sets the value as html for this element. Input/Select elements only.

Document PowerUI.Element.contentDocument
get

Applies to iframes. The document contained in the iframe itself.

int PowerUI.Element.contentHeight
get

The height of the content inside this element.

int PowerUI.Element.contentWidth
get

The width of the content inside this element.

Document PowerUI.Element.document
get

The document this element is on.

Element PowerUI.Element.firstChild
get

The first child of this element.

bool PowerUI.Element.focusable
get

True if this element is focusable.

bool PowerUI.Element.focused
getset

Gets or sets if this element is focused.

FormTag PowerUI.Element.form
get

Scans up the DOM to find the parent form element's handler. The object returned provides useful methods such as PowerUI.FormTag.submit.

Element PowerUI.Element.formElement
get

Scans up the DOM to find the parent form element. Note: PowerUI.Element.form may be more useful than the element iself.

bool PowerUI.Element.HasBackground
get

True if this element has some form of background applied to it.

string PowerUI.Element.id
getset

The ID of this element. Won't ever be null.

Texture2D PowerUI.Element.image
getset

Gets or sets the image from the background of this element.

string PowerUI.Element.innerHTML
getset

Gets or sets the innerHTML of this element.

bool PowerUI.Element.isRooted
get

True if this element is in any document and is rooted.

Element PowerUI.Element.lastChild
get

The last child of this element.

Element PowerUI.Element.nextElementSibling
get

The sibling following this one under this elements parent. Null if this is the last child.

Element PowerUI.Element.nextSibling
get

The element after this one at this same level in the DOM tree.

int PowerUI.Element.offsetLeft
getset

The x location of this element on the screen. Note that you may need to take scrolling into account (scrollLeft).

int PowerUI.Element.offsetTop
getset

The y location of this element on the screen. Note that you may need to take scrolling into account (scrollTop).

Element PowerUI.Element.parentNode
getset

Gets or sets the parent html element of this element.

bool PowerUI.Element.paused
get

Is the video paused?

int PowerUI.Element.pixelHeight
get

The height of this element.

int PowerUI.Element.pixelWidth
get

The width of this element.

bool PowerUI.Element.playing
get

Is the video playing?

Element PowerUI.Element.previousElementSibling
get

The sibling before this one under this elements parent. Null if this is the first child.

Element PowerUI.Element.previousSibling
get

The element before this one at this same level in the DOM tree.

int PowerUI.Element.scrollHeight
get

The height of this element without margins or borders.

int PowerUI.Element.scrollLeft
getset

The amount of pixels the content of this element is scrolled horizontally.

int PowerUI.Element.scrollTop
getset

The amount of pixels the content of this element is scrolled vertically.

int PowerUI.Element.scrollWidth
get

The width of this element without margins or borders.

int PowerUI.Element.selectedIndex
getset

Updates the current selected element in a dropdown menu.

Css.ElementStyle PowerUI.Element.style
get

Gets the style of this element.

Text3D PowerUI.Element.text3D
get

Gets the text3D instance on this element. Great for raw control over your 3D text rendering.

string PowerUI.Element.textContent
getset

Gets or sets the text content of this element (i.e. the content without any html.). Setting this is good for preventing any html injection as it will be taken literally.

string PowerUI.Element.value
getset

Gets or sets the value of this element. Input/Select elements only.

MovieTexture PowerUI.Element.video
get

The source movie texture.

VideoTag PowerUI.Element.videoHandler
get

Gets the video tag associated with this element (if it's a video element).

Event Documentation

EventHandler PowerUI.Element.OnBlur

An alternative to Nitro. Called when this element is unfocused (blurred).

EventHandler PowerUI.Element.OnClick

An alternative to Nitro. Called when this element receives a full click.

EventHandler PowerUI.Element.OnFocus

An alternative to Nitro. Called when this element gets focused.

EventHandler PowerUI.Element.OnKeyDown

An alternative to Nitro. Called when this element receives a keydown.

EventHandler PowerUI.Element.OnKeyUp

An alternative to Nitro. Called when this element receives a keyup.

EventHandler PowerUI.Element.OnLoadedEvent

An alternative to Nitro. Called when this element receives a loaded event (e.g. iframe).

EventHandler PowerUI.Element.OnMouseDown

An alternative to Nitro. Called when this element receives a mousedown.

EventHandler PowerUI.Element.OnMouseMove

An alternative to Nitro. Called when this element receives a mousemove. Note that it must be focused.

EventHandler PowerUI.Element.OnMouseOut

An alternative to Nitro. Called when this element receives a mouseout.

EventHandler PowerUI.Element.OnMouseOver

An alternative to Nitro. Called when this element receives a mouseover.

EventHandler PowerUI.Element.OnMouseUp

An alternative to Nitro. Called when this element receives a mouseup.