Detailed Description

Represents the input tag which handles various types of input on forms. Note that all input tags are expected to be on a form to work correctly. E.g. radio buttons won't work if they are not on a form. Supports the type, name, value and checked attributes. Also supports a 'content' attribute which accepts a value as html; great for buttons.

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

Public Member Functions

 InputTag ()
 
virtual void OnScrolled (float progress)
 Used by e.g. sliders. This receives the scrolling progress if DivertOutput is true. More...
 
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...
 
override 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...
 
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...
 
override KeyboardMode OnShowMobileKeyboard ()
 Called when PowerUI attempts to display the mobile keyboard (only called on mobile platforms). More...
 
void Unselect ()
 Used by boolean inputs (checkbox/radio). Unselects this from being the active one. More...
 
void Select ()
 Used by boolean inputs (checkbox/radio). Selects this as the active one. More...
 
override void OnTagLoaded ()
 Called when the tag is instanced and the element plus its attributes and kids have been fully parsed. More...
 
void ScrollBy (int pixels)
 Scrolls a scrollbar by the given number of pixels. This may fail if it's already at an end of the bar and can't move any further. More...
 
void ScrollTo (int location)
 Scrolls a scrollbar to the given location in pixels. More...
 
void ScrollTo (float position)
 Scrolls a scrollbar to the given 0-1 location along the bar. More...
 
void ElementScrolled ()
 Called when ScrollTop or ScrollLeft has changed. More...
 
virtual void RecalculateTab ()
 Recalculates the tab size of a scroll bar. More...
 
bool NoTarget ()
 Checks if this scrollbar has no target attribute. More...
 
void SetValue (string value)
 Sets the value of this input box. More...
 
void SetValue (string value, bool html)
 Sets the value of this input box, optionally as a html string. More...
 
Element GetTarget ()
 Used only by scrollbars. Gets the target element to be scrolled. More...
 
override void OnKeyPress (UIEvent pressEvent)
 Called on the focused element when a key is pressed or released. More...
 
void MoveCursor (int index)
 For text and password inputs, this relocates the cursor to the given index. More...
 
void MoveCursor (int index, bool immediate)
 For text and password inputs, this relocates the cursor to the given index. More...
 
override void OnRenderPass ()
 Called immediately after the text pass on the focused element. More...
 
override void OnFocus ()
 Called when the element is focused. More...
 
override void OnBlur ()
 Called when the element is unfocused/blurred. More...
 
override bool OnClick (UIEvent clickEvent)
 Called when the element is clicked (or the mouse is released over it). 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 OnResetAllVariables ()
 Called when all variable () values must have their content reloaded. More...
 
virtual void OnResetVariable (string name)
 Called when the named variable variable () values must have its content reloaded. 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 OnLoaded (string objectLoaded)
 Called when this elements content has been loaded. Used by e.g. iframe or img. More...
 
virtual void OnMouseMove (UIEvent moveEvent)
 Called on the focused element when the mouse is moved. More...
 
virtual void OnChildrenLoaded ()
 Called when the elements kids are fully loaded. More...
 
- Public Member Functions inherited from Wrench.TagHandler
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 Hidden
 Used by password inputs. True if this input's value is hidden. More...
 
string Value
 The value text for this input. More...
 
bool Checked
 For boolean (radio or checkbox) inputs, this is true if this one is checked. More...
 
Element Cursor
 For text or password input boxes, this is the cursor. More...
 
InputType Type
 The type of input that this is; e.g. text/password/radio etc. More...
 
int CursorIndex
 The current location of the cursor. More...
 
bool LocateCursor
 True if the cursor should be located after the next update. More...
 
string TargetName
 Used by scrollbars. This is the name of the target element that will be scrolled if there is one. Parent is used otherwise. More...
 
Element TargetElement
 Used by scrollbars. This is the element that will get scrolled. More...
 
ScrollTabTag ScrollTab
 Used by scrollbars. The tag handler for the scrollbars tab. More...
 
int MaxLength =int.MaxValue
 The maximum length of text in this box. More...
 
bool DivertOutput
 Set this true in an overriding class to receive scrolling progress. See OnScrolled. 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

bool IsScrollInput ()
 Checks if this is a horizontal or vertical scrollbar. More...
 
bool IsBoolInput ()
 Checks if this is a radio or checkbox input box. More...
 
bool IsTextInput ()
 Checks if this is a text or password input box. More...
 
void LocateCursorNow ()
 Positions the cursor immediately. More...
 

Constructor & Destructor Documentation

PowerUI.InputTag.InputTag ( )
inline

Member Function Documentation

void PowerUI.InputTag.ElementScrolled ( )
inline

Called when ScrollTop or ScrollLeft has changed.

override Wrench.TagHandler PowerUI.InputTag.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.

override string [] PowerUI.InputTag.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.

Element PowerUI.InputTag.GetTarget ( )
inline

Used only by scrollbars. Gets the target element to be scrolled.

Returns
The target element.
bool PowerUI.InputTag.IsBoolInput ( )
inlineprivate

Checks if this is a radio or checkbox input box.

Returns
True if it is; false otherwise.
bool PowerUI.InputTag.IsScrollInput ( )
inlineprivate

Checks if this is a horizontal or vertical scrollbar.

Returns
True if it is; false otherwise.
bool PowerUI.InputTag.IsTextInput ( )
inlineprivate

Checks if this is a text or password input box.

Returns
True if it is; false otherwise.
void PowerUI.InputTag.LocateCursorNow ( )
inlineprivate

Positions the cursor immediately.

void PowerUI.InputTag.MoveCursor ( int  index)
inline

For text and password inputs, this relocates the cursor to the given index.

Parameters
indexThe character index to move the cursor to, starting at 0.
void PowerUI.InputTag.MoveCursor ( int  index,
bool  immediate 
)
inline

For text and password inputs, this relocates the cursor to the given index.

Parameters
indexThe character index to move the cursor to, starting at 0.
immediateTrue if the cursor should be moved right now.
bool PowerUI.InputTag.NoTarget ( )
inline

Checks if this scrollbar has no target attribute.

Returns
True if it has no target attribute; false if it does.
override bool PowerUI.InputTag.OnAttributeChange ( string  property)
inlinevirtual

Called when an attribute of the element was changed. Returns true if the method handled the change to prevent unnecessary checks.

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.InputTag.OnBlur ( )
inlinevirtual

Called when the element is unfocused/blurred.

Reimplemented from PowerUI.HtmlTagHandler.

override bool PowerUI.InputTag.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.InputTag.OnFocus ( )
inlinevirtual

Called when the element is focused.

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.InputTag.OnKeyPress ( UIEvent  pressEvent)
inlinevirtual

Called on the focused element when a key is pressed or released.

Parameters
pressEventThe UIEvent describing the press; e.g. which key.

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.InputTag.OnRenderPass ( )
inlinevirtual

Called immediately after the text pass on the focused element.

Reimplemented from PowerUI.HtmlTagHandler.

virtual void PowerUI.InputTag.OnScrolled ( float  progress)
inlinevirtual

Used by e.g. sliders. This receives the scrolling progress if DivertOutput is true.

override KeyboardMode PowerUI.InputTag.OnShowMobileKeyboard ( )
inlinevirtual

Called when PowerUI attempts to display the mobile keyboard (only called on mobile platforms).

Returns
A KeyboardType if this element wants the keyboard to show up (KeyboardType.None otherwise).

Reimplemented from PowerUI.HtmlTagHandler.

override void PowerUI.InputTag.OnTagLoaded ( )
inlinevirtual

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

Reimplemented from Wrench.TagHandler.

virtual void PowerUI.InputTag.RecalculateTab ( )
inlinevirtual

Recalculates the tab size of a scroll bar.

void PowerUI.InputTag.ScrollBy ( int  pixels)
inline

Scrolls a scrollbar by the given number of pixels. This may fail if it's already at an end of the bar and can't move any further.

Parameters
pixelsThe number of pixels the scrollbar tab will try to move by.
void PowerUI.InputTag.ScrollTo ( int  location)
inline

Scrolls a scrollbar to the given location in pixels.

Parameters
locationThe number of pixels the scrollbar tab will try to locate at.
void PowerUI.InputTag.ScrollTo ( float  position)
inline

Scrolls a scrollbar to the given 0-1 location along the bar.

Parameters
positionThe 0-1 location along the bar that the tab will locate at.
void PowerUI.InputTag.Select ( )
inline

Used by boolean inputs (checkbox/radio). Selects this as the active one.

override bool PowerUI.InputTag.SelfClosing ( )
inlinevirtual

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.

Reimplemented from Wrench.TagHandler.

void PowerUI.InputTag.SetValue ( string  value)
inline

Sets the value of this input box.

Parameters
valueThe value to set.
void PowerUI.InputTag.SetValue ( string  value,
bool  html 
)
inline

Sets the value of this input box, optionally as a html string.

Parameters
valueThe value to set.
htmlTrue if the value can safely contain html.
void PowerUI.InputTag.Unselect ( )
inline

Used by boolean inputs (checkbox/radio). Unselects this from being the active one.

Member Data Documentation

bool PowerUI.InputTag.Checked

For boolean (radio or checkbox) inputs, this is true if this one is checked.

Element PowerUI.InputTag.Cursor

For text or password input boxes, this is the cursor.

int PowerUI.InputTag.CursorIndex

The current location of the cursor.

bool PowerUI.InputTag.DivertOutput

Set this true in an overriding class to receive scrolling progress. See OnScrolled.

bool PowerUI.InputTag.Hidden

Used by password inputs. True if this input's value is hidden.

bool PowerUI.InputTag.LocateCursor

True if the cursor should be located after the next update.

int PowerUI.InputTag.MaxLength =int.MaxValue

The maximum length of text in this box.

ScrollTabTag PowerUI.InputTag.ScrollTab

Used by scrollbars. The tag handler for the scrollbars tab.

Element PowerUI.InputTag.TargetElement

Used by scrollbars. This is the element that will get scrolled.

string PowerUI.InputTag.TargetName

Used by scrollbars. This is the name of the target element that will be scrolled if there is one. Parent is used otherwise.

InputType PowerUI.InputTag.Type

The type of input that this is; e.g. text/password/radio etc.

string PowerUI.InputTag.Value

The value text for this input.