- 3 Talk
-
XML properties
Types of properties:
- String - just some text
- Element - name of element
- Integer - number (0,1,2,3,4,5...)
- Single - number with point (0.3 or 1.65 etc)
- Boolean - true (enabled) or false (disabled)
- List - some predefined values to select from
Attributes
Edit
alpha
Edit
Effect: Elements can be transparent and this property used to define it.
- 0 - full transparent
- 1 - solid (default)
Type: Single
alphamode
Edit
Effect: Defines a way transparency applied:
- DISABLE - no transparency.
- BLEND - while background fades element gets stronger (default)
- ADD - background and element colors added resulting in too bright colors
- APLHAKEY - transparency depends on alpha channel of textures
- MOD - Not tested
Type: List
autofocus
Edit
Effect: Automatically place the cursor bar inside a text box and receive all of the keyboard's attention.
Type: Unknown
bytes
Edit
Effect: unknown
Type: Unknown
checked
Edit
Effect: If set to true - checkbutton is checked when loaded. Default is false
Type: Boolean
clampedtoscreen
Edit
Effect: Prohibits element to go out of screen. Way applied unknown, probably just moved. Default unknown
Type: Boolean
defaultvalue
Edit
Effect: unknown
Type: Unknown
displayduration
Edit
Effect: unknown
Type: Unknown
drawlayer
Edit
Effect: unknown
Type: Unknown
enablekeyboard
Edit
Effect: Tell the frame to receive keyboard input.
Type: Boolean
enablemouse
Edit
Effect: Tell the frame to receive mouse input.
Type: Boolean
file
Edit
This refers to a file used by element, path is relative to scheme path: if addon is in "MyAddon" folder file specified "myfile.lua" will be searched in this folder (i guess only, needs testing). "\\Interface\\Wherever" seems to be the same as "Interface\\Wherever" ("C:\\{{WoW}}\\Interface\\Wherever").
Type: String
font
Edit
Effect: unknown
Type: Unknown
framestrata
Edit
Effect: unknown
Type: Unknown
Edit
Effect: If true element is skipped in drawing resulting it not appearing on screen (interactions also skipped). Default false.
Type: Boolean
historylines
Edit
Effect: unknown
Type: Unknown
id
Edit
Effect: Number of element. Used for same looking element to make difference between them (much easier than by names)
Type: Integer
ignorearrows
Edit
Effect: Text fields will ignore directional arrows and move the character instead. (Holding <Alt> temporarily sets this to true). Default false.
Type: Unknown
inherits
Edit
Effect: Name of element to take properties from. Element must be marked with "virtual=true" attribute (not tested otherwise). For some reason it's allowed to inherit elements of different types. In that case properties are copied, and unused ones are ignored(need to be tested too). You can define more that one template to use:
<Button inherits="OneTemplate, TwoTemplate">Properties will be taken first from "OneTemplate" and then "TwoTemplate" so if they have the same properties from second will be taken.
Type: Element
insertmode
Edit
Effect: Tells a MessageFrame where to put new content. Accepts "TOP" or "BOTTOM". Default "TOP"
Type: Unknown
justifyh
Edit
Effect: Align text "LEFT", "RIGHT", or "CENTER".
Type: Unknown
justifyv
Edit
Effect: Align text "TOP", "BOTTOM", or "MIDDLE".
Type: Unknown
letters
Edit
Effect: Defines the maximum characters to allow in a text box.
Type: Unknown
maxlines
Edit
Effect: Defines the maximum number of lines to allow in a text box.
Type: Unknown
maxvalue
Edit
Effect: Defines the highest numeric value a widget will accept.
Type: Single
minimaparrowmodel
Edit
Effect: unknown
Type: Unknown
minimapplayermodel
Edit
Effect: unknown
Type: Unknown
minvalue
Edit
Effect: Defines the lowest numeric value a widget will accept.
Type: Single
monochrome
Edit
Effect: unknown
Type: Unknown
movable
Edit
Effect: (De)Activates the methods, :StartMoving() and :StopMovingOrSizing(). Default false.
Type: Boolean
multiline
Edit
Effect: Tells a text box to span multiple lines (<Enter> inserts a line break).
Type: Boolean
name
Edit
Effect: This string represents name of an element for scripting. Frames defined via XML must be named if they are to be accessed by scripts, but for showing up in interface unnamed are ok. Names are case sensitive - means "MyElement" not same as "myelement". For readability and errors avoiding it's strongly recommended to avoid same names with different letters. You can use "$parent" inside name, this one will be replaced with parent attribute of element to form final name:
<Button name="$parentButton" parent="MyFrame">gives out "MyFrameButton" name for element. When used without parent attribute it replaces with name of first named parent element. This needs for templates - if you use elements in template they will take name from real parent, not template one:
<Frame name="FrameTemplate" virtual="true"> <Button name="$parentButton"/> </Frame"> <Frame name="RealFrame" inherits="FrameTemplate">will result in creation of element "RealFrame" with "RealFrameButton" inside it. If parent attribute undefined name of container of element used.
<Frame Name="NamedFrame"> ... <Frame> ... <Button name="$parentButton"> ... </Button> </Frame> </Frame>Will create button named NamedFrameButton.
Type: String
nonspacewrap
Edit
Effect: Don't wrap text when it gets to the end of the parent frame.
Type: Unknown
numeric
Edit
Effect: Tells the text box to accept only numeric values.
Type: Unknown
orientation
Edit
Effect: unknown
Type: Unknown
outline
Edit
Effect: unknown
Type: Unknown
parent
Edit
Effect: You can define another parent for an element. To make button around minimap you can move it inside minimap frame that way. I'm not sure do element really removed from this one, or it just defines drawing order. If skipped then parent is container of element
Type: Element
protected
Edit
Effect: Can be defined only in blizzard interface files (At least no one checked yet). If set to true some special api functions can be used. Any element inherited from protected ones can use this functions too. Protected functions/actions cannot be circumvented with this attribute.
Type: Boolean
resizable
Edit
Effect: If true element can be resized. Default false
Type: Boolean
reverse
Edit
Effect: unknown
Type: Unknown
scale
Edit
Effect: Sets the scale. Default is the parent's scale. Accepts values greater than and not equal to 0.
Type: Single
setallpoints
Edit
Effect: Attaches all four corners to the parent's inner corners.
Type: Boolean
text
Edit
Effect: Used to define text to show on buttons, fontstrings etc.
Type: String
toplevel
Edit
Effect: unknown
Type: Unknown
valuestep
Edit
Effect: Tells a slider how far to jump per click.
Type: Single
virtual
Edit
Effect: If true element will not created, but used as template for other elements. Default false
Type: Boolean
Tags
Edit
anchors
Edit
This defines position of element relative to its parent position. You can define one or more "anchor" tags within "anchors". Each anchor has four attributes:
- Point - where the anchor is located on the element. Allowed values are:
- TOP
- BOTTOM
- LEFT
- RIGHT
- CENTER (default) (notice not MIDDLE. Some addons use middle instead, but it's not supported at the moment)
- TOPLEFT
- BOTTOMLEFT
- TOPRIGHT
- BOTTOMRIGHT
- RelativePoint - same as point, but defines not on this element but on its parent. Values are same as "Point". If undefined its value equals to "Point"
- RelativeTo - normally element docked to its parent (container) but you can specify another element to use instead with this attribute, giving a name as a value
- Offset - If point on element and point on its parent are separated between each other you need specify it with this tag. This is done normally by putting "AbsDimension" inside "Offset" tag with attributes "x" and "y". Bigger x - element goes right, bigger y - it goes top. If undefined it's taken as 0,0
If two or more anchors are defined they can override the size, so element size will depend on the size of its parent.
Each widget got only four borders:
- Horizontal type borders
- Left
- Right
- Vertical type borders
- Top
- Bottom
For each border type there are two ways of defining size and position:
- By size and point
Element size remains unchanged, position is defined by 'hook' (anchor) on left, middle or right part of widget and fixed to left, middle or right part to another widget - Without size
Element size depends on position and size elements used to 'hook' element to. Distance between them increasing - this widget size too.
In this case you need one 'hook' for left border and one for right border.
If undefined for both border types 'hook' is placed in center relative to its parent element center with zero offset and size equals to parent element size. Each anchor defined overrides one border rule. When 'hook' placed left or right it removes center 'hook'. When center 'hook' placed it removes 'left' and 'right' hooks if defined. Two borders type are separate, so horizontal size can be defined by one 'hook' and size, when vertical defined by two 'hooks'. TOPLEFT anchors should be processed as two anchors TOP anchor and LEFT anchor with all other properties same. Same for BOTTOMLEFT,TOPRIGHT,BOTTOMRIGHT. You can think about them just as shorter form of writing. CENTER anchor affects both border types.
Widget can be relative only to one other element. So each anchor with relativeto attribute defined changes it.
<Anchor point="LEFT"/>Will put 'hook' to left-middle part of widget and fix it to left-middle part of parent widget with zero offset
<Anchor point="LEFT" relativepoint="TOPRIGHT"/>makes left part of widget fixed to right part of parent while top of parent will be middle of widget
<Anchor point="TOPLEFT"/> <Anchor point="LEFT" relativeto="One"/>Widget top remains same as top of parent, when left of widget goes to left of "One"
<Anchor point="RIGHT"/> <Anchor point="CENTER"/>Element will be fixed to center of its parent
When element is inherited from another one and both got anchors defined, inherited processed first, then widget ones, so ones you override template anchors.
For all this size is taken from Size tag.
attributes
Edit
backdrop
Edit
barcolor
Edit
bartexture
Edit
buttontext
Edit
checkedtexture
Edit
color
Edit
colorvaluetexture
Edit
colorvaluethumbtexture
Edit
colorwheeltexture
Edit
colorwheelthumbtexture
Edit
disabledcheckedtexture
Edit
Define the texture to use when a check button is checked.
disabledfont
Edit
Define the font to use when a button is disabled.
disabledtexture
Edit
Define the texture to use when a button is disabled.
fontheight
Edit
fontstring
Edit
frames
Edit
Inside this tag all child elements are located. So if you want button inside a frame you need put it inside this tag of frame.
Still for some elements there is extra tags where elements can be placed. This depends completely on element type
highlightfont
Edit
Mouseover font.
highlighttexture
Edit
Mouseover texture.
hitrectinsets
Edit
layers
Edit
This is a place where actually defined what will be drawn on screen. If this tag omitted default representation is taken (this needs to be tested).
Only "layer" elements can be inside this tag, each have "level" property to define the order they will be drawn. Only fontstring and texture elements are allowed inside layer element.
normalfont
Edit
normaltexture
Edit
pushedtextoffset
Edit
Text moves when clicked (and held), this defines how far it moves. Text moves back to its previous location when the mouse button is released.
pushedtexture
Edit
Change the texture to this when clicked (and held). The texture changes back to its texture when the mouse button is released.
resizebounds
Edit
Define how big or small this frame can possibly be.
scripts
Edit
This tag only accepts Category:Widget event handlers.
scrollchild
Edit
shadow
Edit
Puts a shadow behind an element.
size
Edit
Defines a size of an element. Normally this is done by putting "AbsDimension" tag inside with "x" and "y" attributes, but sometimes this is done by just giving "x" and "y" attributes to "Size" tag itself. Last one is probably old way of defining and left for a backward compatibility.
texcoords
Edit
Determines how much of the specified texture is to be shown. There are four specifications: "left", "right", "top", and "bottom". Each one specifies the coordinates of what the image should show, using a scale value. IE: With left=0 and right=1, it would show all the pixels from the left side to the right, or 100% of the image's width.
<TexCoords left="0" right="0.5" top="0" bottom="0.5" />
This example shows only the top left quarter of the texture.