MultiEdit Control

From DevWiki

Jump to: navigation, search

Applications,Boxee GUI API,Controls

Contents


Overview

The MultiEdit control is simple a multi-lined (word wrap) Edit Control. MultiEdit control is used for text entry on the application window. It descends from a button and can be customized for position, size, looks and text and has several events for push and navigation. When clicked it automatically defaults to a virtual keyboard for text entry.


Example

  1. <control type="multiedit" id="9001">
  2.     <posx>190</posx>
  3.     <posy>67</posy>
  4.     <width>517</width>
  5.     <height>155</height>
  6.     <font>font28b</font>
  7.     <maxinputsize>119</maxinputsize>
  8.     <align>left</align>
  9.     <textcolor>black</textcolor>
  10.     <focusedcolor>black</focusedcolor>
  11.     <textoffsetx>18</textoffsetx>
  12.     <textoffsety>12</textoffsety>
  13.     <texturenofocus border="25">browse_menu_dialog_edit.png</texturenofocus>
  14.     <texturefocus border="25">browse_menu_dialog_edit_focus.png</texturefocus>
  15.     <onleft>-</onleft>
  16.     <onright>-</onright>
  17.     <pulseonselect>no</pulseonselect>
  18.     <onup>-</onup>
  19.     <ondown>10</ondown>
  20. </control>


Available Tags

In addition to the Default Control Properties the following tags are available. Note that all XML tags are in lower case.

Element Description Required
texturefocus Specifies the image file which should be displayed when the button has focus. No
texturenofocus Specifies the image file which should be displayed when the button does not have focus. No
label The label used on the button. It can be a link into strings.xml, or an actual text label. No
font Font used for the button label. From the skin /720p/fonts.xml. No
textcolor Color used for displaying the button label. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
focusedcolor Color used for the button label when the button has in focus. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
disabledcolor Color used for the button label if the button is disabled. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
shadowcolor Specifies the color of the drop shadow on the text. In AARRGGBB hex format or a name from the skin color themes /colors/defaults.xml. No
angle The angle the text should be rendered at, in degrees. A value of 0 is horizontal. No
align Label horizontal alignment on the button. Defaults to left, can also be center or right. No
aligny Label vertical alignment on the button. Defaults to top, can also be center. No
textoffsetx Amount to offset the label from the left (or right) edge of the button when using left or right alignment. No
textoffsety Amount to offset the label from the top edge of the button when using top alignment. No
password When set to true hides the entered text using * for password entry. No


Available Events

In addition to the Default Control Properties the following tags are available. Note that all XML tags are in lower case.

Element Description Required
onfocus Specifies actions or a python script which will run when the button is focused. The action is performed after any focus animations have completed. No
ontextchange Event fires when user modifies the edit field. No


Python Integration

In addition to the default control methods (disable/enable, visibility and focus), the following is also available for this control type.

GetEdit(controlId:Integer):Edit
Represents an edit control in the user interface. Get the object by calling GetEdit().

  1. edit = mc.GetWindow(14000).GetEdit(3500)
  1. <onclick lang="python"><![CDATA[
  2. edit = mc.GetWindow(14000).GetEdit(3500)
  3. ]]></onclick>


GetText

GetText():String
Gets the text of the edit control.

  1. editText = edit.GetText()


SetText

SetText(editText:String):Void
Sets the text of the edit control.

  1. newText = "I Love Boxee!"
  2. edit.SetText(newText)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox