XML/EditBox

From Warcraft Wiki
< XML
Jump to navigation Jump to search

<EditBox> (inherits from <Frame>, creates an EditBox widget) recieves text input.

<EditBox font="" letters="" blinkSpeed="" numeric="" alphabeticOnly="" password="" multiLine="" historyLines="" autoFocus="" ignoreArrows="" countInvisibleLetters="" invisibleBytes="">
	<FontString />
	<HighlightColor />
	<TextInsets />
</EditBox>

Attributes

font (xs:string) - See <Font>.
letters (xs:int?Optional. Could be nil.) - Maximum number of letters; or zero for no limit.
blinkSpeed (xs:float?Optional. Could be nil. - speed of cursor blinking, interval in seconds between "blinks".
numeric (boolean?Optional. Could be nil.) - if true, then only digits 0-9 can be entered in this EditBox
password (boolean?Optional. Could be nil.) - if true, then asterisks will be displayed instead of whatever text you enter.
multiLine (boolean?Optional. Could be nil.) - multi-line EditBox
historyLines (int?Optional. Could be nil.) - Number of lines to keep as a "history" for this editbox. You can cycle through editbox' history with arrows Up and Down (or Alt+Up, Alt+Down if attribute ignoreArrows set to true)
autoFocus (boolean?Optional. Could be nil.) - if true, then this EditBox will automatically receive keyboard focus when it is displayed.
ignoreArrows (boolean?Optional. Could be nil.) - if false, then pressing arrows on keyboard will move cursor around the EditBox. If set to true, then EditBox will ignore arrows and they will instead turn around your character in game world. In this case you can still move text cursor around your editbox with Alt-arrows.
countInvisibleLetters (boolean?Optional. Could be nil.)
invisibleBytes (int?Optional. Could be nil.)

Child elements

<FontString>

<HighlightColor> inherits <Color>

<TextInsets> defines padding (+) or overflow (-) of the FontString relative to the EditBox; inherits <Inset>.

Example

Included in Backdrop

<EditBox name="$parentEditBox" letters="80">
	<Size>
		<AbsDimension x="100" y="32"></AbsDimension>
	</Size>
	<Anchors>
		<Anchor point="LEFT">
			<Offset>
				<AbsDimension x="50" y="0"></AbsDimension>
			</Offset>
		</Anchor>
	</Anchors>
	<Layers>
		<Layer level="BACKGROUND">
			<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Left">
				<Size>
					<AbsDimension x="75" y="32"></AbsDimension>
				</Size>
				<Anchors>
					<Anchor point="LEFT">
						<Offset>
							<AbsDimension x="-10" y="0"></AbsDimension>
						</Offset>
					</Anchor>
				</Anchors>
				<TexCoords left="0" right="0.2" top="0" bottom="1.0"></TexCoords>
			</Texture>
			<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Right">
				<Size>
					<AbsDimension x="75" y="32"></AbsDimension>
				</Size>
				<Anchors>
					<Anchor point="RIGHT">
						<Offset>
							<AbsDimension x="10" y="0"></AbsDimension>
						</Offset>
					</Anchor>
				</Anchors>
				<TexCoords left="0.7" right="1.0" top="0" bottom="1.0"></TexCoords>
			</Texture>
		</Layer>
	</Layers>
	<Scripts>
		<OnLoad></OnLoad>
	</Scripts>
	<FontString inherits="ChatFontNormal"></FontString>
</EditBox>

Editbox.jpg