Detailed Description

A html element which is created when using . They are tracked in this way so their content can be replaced if the language of the UI changes.

Inheritance diagram for PowerUI.VariableElement:
PowerUI.Element Wrench.MLVariableElement

Public Member Functions

 VariableElement (Document document, Element parent)
 Creates a new variable element. More...
 
void SetVariableName (string name)
 Changes the name of the variable. Thats the text used . More...
 
override void ResetVariable (string name)
 Reloads the content of this variable if it's name matches the given one. More...
 
override void ResetAllVariables ()
 Reloads the content of this variable element. This should be used when the language of the UI changes. More...
 
void LoadNow (bool innerElement)
 Loads the content of this variable element by looking up the content for the variables name. More...
 
string GetArgument (int id)
 Reads the runtime argument at the given index. Used with &arg.X; where x starts from 0. The arguments themselves originate from e.g. &variableName(arg0,arg1,arg2..); More...
 
void SetArguments (string[] arguments)
 Sets the runtime argument set. See the Arguments variable. More...
 
override string ToTextString ()
 Gets this elements content as text. More...
 
override string ToString ()
 Gets this elements content as text. More...
 
- Public Member Functions inherited from PowerUI.Element
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...
 
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

string[] Arguments
 The set of arguments that can be passed into a variable at runtime. &Name(a0,a1,a2..); Arguments are accessed simply with &arg.X; More...
 
- Public Attributes inherited from PowerUI.Element
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...
 

Private Attributes

string Name
 The used. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PowerUI.Element
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 inherited from PowerUI.Element
List< ElementChildNodes
 Internal use only. The set of child elements for this element. More...
 
- Package Functions inherited from PowerUI.Element
void Lettering (List< Element > into, Element parent)
 
- Properties inherited from PowerUI.Element
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 inherited from PowerUI.Element
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...
 

Constructor & Destructor Documentation

PowerUI.VariableElement.VariableElement ( Document  document,
Element  parent 
)
inline

Creates a new variable element.

Parameters
documentThe html document it will belong to.
parentThe parent html element.

Member Function Documentation

string PowerUI.VariableElement.GetArgument ( int  id)
inline

Reads the runtime argument at the given index. Used with &arg.X; where x starts from 0. The arguments themselves originate from e.g. &variableName(arg0,arg1,arg2..);

Implements Wrench.MLVariableElement.

void PowerUI.VariableElement.LoadNow ( bool  innerElement)
inline

Loads the content of this variable element by looking up the content for the variables name.

Parameters
innerElementTrue if this element is being loaded from within another variable.

Implements Wrench.MLVariableElement.

override void PowerUI.VariableElement.ResetAllVariables ( )
inline

Reloads the content of this variable element. This should be used when the language of the UI changes.

override void PowerUI.VariableElement.ResetVariable ( string  name)
inline

Reloads the content of this variable if it's name matches the given one.

Parameters
nameThe name of the variable to reset.
void PowerUI.VariableElement.SetArguments ( string[]  arguments)
inline

Sets the runtime argument set. See the Arguments variable.

Parameters
argumentsThe new arguments.

Implements Wrench.MLVariableElement.

void PowerUI.VariableElement.SetVariableName ( string  name)
inline

Changes the name of the variable. Thats the text used .

Implements Wrench.MLVariableElement.

override string PowerUI.VariableElement.ToString ( )
inline

Gets this elements content as text.

Returns
A text string of the elements content.
override string PowerUI.VariableElement.ToTextString ( )
inlinevirtual

Gets this elements content as text.

Returns
A text string of the elements content.

Reimplemented from PowerUI.Element.

Member Data Documentation

string [] PowerUI.VariableElement.Arguments

The set of arguments that can be passed into a variable at runtime. &Name(a0,a1,a2..); Arguments are accessed simply with &arg.X;

string PowerUI.VariableElement.Name
private

The used.