m
Move page script moved page XML/Frame to WoW:XML/Frame without leaving a redirect
(Fixed typo "inherts") |
m (Move page script moved page XML/Frame to WoW:XML/Frame without leaving a redirect) |
||
| (6 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{uixmlelem}} | ||
[[XML/Frame|Frame]] is a base type used as a fundamental UI building block for defining 'active' visible screen elements. The Frame type can be used for '''Layout''' due to [[XML/LayoutFrame|LayoutFrame]], and a full set of '''Appearance''' and '''Behaviour''' facilities. Provides a base type for [[XML/Button|Button]], [[XML/EditBox|EditBox]], [[XML/ScrollingMessageFrame|ScrollingMessageFrame]], and many others. | [[XML/Frame|Frame]] is a base type used as a fundamental UI building block for defining 'active' visible screen elements. The Frame type can be used for '''Layout''' due to [[XML/LayoutFrame|LayoutFrame]], and a full set of '''Appearance''' and '''Behaviour''' facilities. Provides a base type for [[XML/Button|Button]], [[XML/EditBox|EditBox]], [[XML/ScrollingMessageFrame|ScrollingMessageFrame]], and many others. | ||
== Inheritance == | == Inheritance == | ||
Inherited by: [[XML/Button|Button]] ..., Inherits: [[XML/LayoutFrame|LayoutFrame]], Defined in: [[XML/Frames|Frames]], [[XML/Ui|Ui | : Inherited by: [[XML/Button|Button]] ..., Inherits: [[XML/LayoutFrame|LayoutFrame]], Runtime object: [[UIOBJECT_Frame|Frame]] | ||
: Defined in: [[XML/Frames|Frames]], [[XML/Ui|Ui]] | |||
== Elements == | == Elements == | ||
| Line 49: | Line 48: | ||
* jumpNavigateEnabled {{attrtype|boolean}} | * jumpNavigateEnabled {{attrtype|boolean}} | ||
* jumpNavigateStart {{attrtype|boolean}} | * jumpNavigateStart {{attrtype|boolean}} | ||
* intrinsic {{attrtype|boolean}} - marks frame as an intrinsic frame type | |||
=== Inherited from [[XML/LayoutFrame|LayoutFrame]]: === | === Inherited from [[XML/LayoutFrame|LayoutFrame]]: === | ||
| Line 89: | Line 89: | ||
=== Events === | === Events === | ||
In addition to Frames being the things that you can see, Frames are also the things which UI and game events are delivered to. If you're writing code that needs to know about something, it will need a Frame (though not necessarily a visible one) to receive the event. There are many types of events, though often in AddOn development it refers to | In addition to Frames being the things that you can see, Frames are also the things which UI and game events are delivered to. If you're writing code that needs to know about something, it will need a Frame (though not necessarily a visible one) to receive the event. There are many types of events, though often in AddOn development it refers to an [[API event]] game event. rather than other UI events. | ||
A frame indicates its interest in events in a number of ways: | A frame indicates its interest in events in a number of ways: | ||
| Line 104: | Line 104: | ||
=== Parents === | === Parents === | ||
Frames have a parent frame. | Frames have a parent frame. By default, the parent of any child frame is the frame the child is defined in. | ||
<pre> | |||
<Frame name="Fame1"> | |||
<Frames> | |||
<Frame name="Fame2"><!-- Frame2's 'parent' is automatically Frame1 --> | |||
</Frame> | |||
</Frames> | |||
</Frame> | |||
</pre> | |||
; Visibility | |||
Each Frame can be shown and hidden | Each Frame can be shown and hidden. If a Frame is Hidden, then it and all of its children cease to be visible. It's far simpler to show and hide the parent frame of a complex set, than to try and manage the visibility of many elements independently. | ||
; Scaling | |||
The UI engine is built to perform automatic scaling of UI elements, the entire UI (actually, the UIParent frame, which most frames are children of), or any component of it can be enlarged or shrunk to fit on a screen appropriately. Frames are scaled and located relative to their parent rather than the whole screen, which means that you only need to worry about how your subcomponents relate to each other, and then your component can be placed and sized any way necessary. | The UI engine is built to perform automatic scaling of UI elements, the entire UI (actually, the UIParent frame, which most frames are children of), or any component of it can be enlarged or shrunk to fit on a screen appropriately. Frames are scaled and located relative to their parent rather than the whole screen, which means that you only need to worry about how your subcomponents relate to each other, and then your component can be placed and sized any way necessary. | ||
; Notes | |||
Complex visual elements are usually formed using many frames. It's considered good design to have a single related parent frame amongst them. By default, all child frames already use the frame they are defined in as their parent. If some of the frames are defined separately, they can still explicitly set their parent to a common frame, using the 'parent' attribute, and have the rest use that (or its children) as their parent. | |||
Well behaved UI AddOns will normally want their top-level parent frame, the highest-level frame that is not defined in another frame, to be set expressly to 'UIParent'. Failure to do so means, amongst other things, that the AddOn's frame won't vanish when the Hide UI key is pressed. | |||
=== Frame Levels === | === Frame Levels === | ||
| Line 117: | Line 131: | ||
Instead of going around and specifying that frame A should have frame level 12, and frame B frame level 15, Blizzard uses a set of predefined "groups" of frame levels called frameStrata. The valid values for frameStrata are "PARENT", "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN_DIALOG" and "TOOLTIP" (there may be more). For the values "BACKGROUND" through "TOOLTIP" the values are listed in their assumed ascendancy (i.e. it is assumed that "BACKGROUND" will be below "LOW"). The default value is "PARENT" if no frameStrata is specified. | Instead of going around and specifying that frame A should have frame level 12, and frame B frame level 15, Blizzard uses a set of predefined "groups" of frame levels called frameStrata. The valid values for frameStrata are "PARENT", "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN_DIALOG" and "TOOLTIP" (there may be more). For the values "BACKGROUND" through "TOOLTIP" the values are listed in their assumed ascendancy (i.e. it is assumed that "BACKGROUND" will be below "LOW"). The default value is "PARENT" if no frameStrata is specified. | ||
There is also a special attribute called toplevel - this means (hopefully) that the frame should be on top of any other frame (or, possibly, on top of any other frame in the same [[frameStrata]]). | There is also a special attribute called toplevel - this means (hopefully) that the frame should be on top of any other frame (or, possibly, on top of any other frame in the same [[XML/Frame|frameStrata]]). | ||
=== frameLevel and frameStrata === | === frameLevel and frameStrata === | ||