m
Move page script moved page XML/Frame to WoW:XML/Frame without leaving a redirect
mNo edit summary |
m (Move page script moved page XML/Frame to WoW:XML/Frame without leaving a redirect) |
||
| (5 intermediate revisions by one other user not shown) | |||
| 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. 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 === | ||