Detailed Description

Select dropdowns. Supports the onchange="nitroMethod" and name attributes.

Inheritance diagram for PowerUI.SelectTag:
PowerUI.HtmlTagHandler Wrench.TagHandler

Public Member Functions

 SelectTag ()
 
override string[] GetTags ()
 Returns all tags that are handled by this handler, e.g. "div" or "span". Usually there will be just one in the set but some tags may wish to have more. More...
 
override Wrench.TagHandler GetInstance ()
 Makes a new instance of this tag handler. A global instance is made of this handler so this is used to generate a new instance in an efficient way. More...
 
int GetSelectID (Element element)
 Gets the index for the given element. More...
 
override void OnResetVariable (string name)
 Called when the named variable variable () values must have its content reloaded. More...
 
override void OnResetAllVariables ()
 Called when all variable () values must have their content reloaded. More...
 
override void OnTagLoaded ()
 Called when the tag is instanced and the element plus its attributes and kids have been fully parsed. More...
 
void Drop ()
 Drops this select box down. More...
 
override void OnBlur ()
 Called when this element becomes unfocused. More...
 
void Hide ()
 Closes this dropdown. More...
 
string GetValue ()
 Gets the currently selected value. More...
 
void SetSelected (Element element)
 Sets the given element as the selected option. More...
 
void SetSelected (int index)
 Sets the option at the given index as the selected one. More...
 
override bool OnClick (UIEvent clickEvent)
 Called when the element is clicked (or the mouse is released over it). More...
 
override void OnMouseMove (UIEvent e)
 Called on the focused element when the mouse is moved. More...
 
- Public Member Functions inherited from PowerUI.HtmlTagHandler
void RequestLayout ()
 Requests the renderer handling this element to layout next update. More...
 
virtual bool Junk ()
 Tells the parser to not include this element in the DOM. More...
 
virtual void OnRenderPass ()
 Called during a layout event on only the focused element. More...
 
virtual void HeightChanged ()
 Called when the fixed height of this element changes. More...
 
virtual void WidthChanged ()
 Called when the width of this element changes. More...
 
virtual void OnLayout ()
 Called during a layout event on all elements. More...
 
virtual void OnFocus ()
 Called when this element comes into focus. More...
 
virtual void OnLoaded (string objectLoaded)
 Called when this elements content has been loaded. Used by e.g. iframe or img. More...
 
virtual void OnKeyPress (UIEvent pressEvent)
 Called on the focused element when a key is pressed or released. More...
 
virtual KeyboardMode OnShowMobileKeyboard ()
 Called when PowerUI attempts to display the mobile keyboard (only called on mobile platforms). More...
 
virtual void OnChildrenLoaded ()
 Called when the elements kids are fully loaded. More...
 
override bool OnAttributeChange (string property)
 Called when an attribute of the element was changed. Returns true if the method handled the change to prevent unnecessary checks. More...
 
- Public Member Functions inherited from Wrench.TagHandler
virtual bool SelfClosing ()
 Returns true if this tag has no kids and closes itself. For example <input type='text' />. Note that this method exists to make that final slash essentially optional. More...
 
virtual void OnParseContent (MLLexer lexer)
 Called when the parser is reading the content of this tag for custom reading, e.g. a script/style tag. Non-self closing tags only. Anything that's not read by this method is assumed to be a child element. More...
 

Public Attributes

bool Dropped
 True if this select is currently dropped down. More...
 
int SelectedIndex =-1
 The index of the selected option. More...
 
List< ElementOptions
 The set of options this select provides. More...
 
- Public Attributes inherited from PowerUI.HtmlTagHandler
bool IsIsolated
 True if this element is isolated from style changes by its parent (e.g. used by iframes). More...
 
Element Element
 The element this tag handler is attached to. More...
 
bool IgnoreClick
 True if the element should ignore all clicks. More...
 
bool IsFocusable
 True if this tag is focusable. More...
 
bool IgnoreSelfClick
 Set this to true if this element should ignore clicks on itself, but not its kids (e.g. html or body). More...
 
- Public Attributes inherited from Wrench.TagHandler
int Priority
 If you define a tag handler with tags which already exist, this priority allows your tag to override the existing one optionally. All system tags have a priority of zero. More...
 
string TagExtension
 This is applied to every derivative of this tag handler. This enables tags to be grouped by file they are handling. e.g. "ui" extension and tag name "div" would become "ui-div" internally. More...
 

Private Member Functions

Element GetDropdownBox ()
 Attempts to get the box that will show the options. More...
 
void SetSelected (int index, Element element, bool runOnChange)
 Sets the option at the given index as the selected one. More...
 

Private Attributes

Element DisplayText
 The element that displays the selected option. More...
 

Constructor & Destructor Documentation

PowerUI.SelectTag.SelectTag ( )
inline

Member Function Documentation

void PowerUI.SelectTag.Drop ( )
inline

Drops this select box down.

Element PowerUI.SelectTag.GetDropdownBox ( )
inlineprivate

Attempts to get the box that will show the options.

Returns
The dropdown box if it was found; null otherwise.
override Wrench.TagHandler PowerUI.SelectTag.GetInstance ( )
inlinevirtual

Makes a new instance of this tag handler. A global instance is made of this handler so this is used to generate a new instance in an efficient way.

Reimplemented from Wrench.TagHandler.

int PowerUI.SelectTag.GetSelectID ( Element  element)
inline

Gets the index for the given element.

Parameters
elementThe element to look for.
Returns
The index of the element.
override string [] PowerUI.SelectTag.GetTags ( )
inlinevirtual

Returns all tags that are handled by this handler, e.g. "div" or "span". Usually there will be just one in the set but some tags may wish to have more.

Reimplemented from Wrench.TagHandler.

string PowerUI.SelectTag.GetValue ( )
inline

Gets the currently selected value.

Returns
The currently selected value.
void PowerUI.SelectTag.Hide ( )
inline

Closes this dropdown.

override void PowerUI.SelectTag.OnBlur ( )
inlinevirtual

Called when this element becomes unfocused.

Reimplemented from PowerUI.HtmlTagHandler.

override bool PowerUI.SelectTag.OnClick ( UIEvent  clickEvent)
inlinevirtual

Called when the element is clicked (or the mouse is released over it).

Parameters
clickEventThe UIEvent describing the click.

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.SelectTag.OnMouseMove ( UIEvent  moveEvent)
inlinevirtual

Called on the focused element when the mouse is moved.

Parameters
clickEventThe UIEvent describing the click.

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.SelectTag.OnResetAllVariables ( )
inlinevirtual

Called when all variable () values must have their content reloaded.

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.SelectTag.OnResetVariable ( string  name)
inlinevirtual

Called when the named variable variable () values must have its content reloaded.

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.SelectTag.OnTagLoaded ( )
inlinevirtual

Called when the tag is instanced and the element plus its attributes and kids have been fully parsed.

Reimplemented from Wrench.TagHandler.

void PowerUI.SelectTag.SetSelected ( Element  element)
inline

Sets the given element as the selected option.

Parameters
elementThe option to set as the selected value.
void PowerUI.SelectTag.SetSelected ( int  index)
inline

Sets the option at the given index as the selected one.

Parameters
indexThe index of the option to select.
void PowerUI.SelectTag.SetSelected ( int  index,
Element  element,
bool  runOnChange 
)
inlineprivate

Sets the option at the given index as the selected one.

Parameters
indexThe index of the option to select.
elementThe element at the given index.
runOnChangeTrue if the onchange event should run.

Member Data Documentation

Element PowerUI.SelectTag.DisplayText
private

The element that displays the selected option.

bool PowerUI.SelectTag.Dropped

True if this select is currently dropped down.

List<Element> PowerUI.SelectTag.Options

The set of options this select provides.

int PowerUI.SelectTag.SelectedIndex =-1

The index of the selected option.