mNo edit summary Tag: WoW API docs |
m (→Example) Tag: WoW API docs |
||
Line 59: | Line 59: | ||
</onlyinclude> |
</onlyinclude> |
||
− | + | == Example == |
|
Included in [[XML/Frame/Backdrop|Backdrop]] |
Included in [[XML/Frame/Backdrop|Backdrop]] |
||
<Button name="$parentButtonClose" inherits="OptionsButtonTemplate" text="Close"> |
<Button name="$parentButtonClose" inherits="OptionsButtonTemplate" text="Close"> |
Revision as of 00:47, 1 June 2020
The API is no longer being updated here until further notice. |
<Button> constructs a Button widget that responds to clicks, displays a label, and displays textures whether it is pushed, depressed (normal) or hovered (highlight).
Inheritance
- <LayoutFrame>
- <Frame>
- <Button>
- <CheckButton>
- <ItemButton>
- <Button>
- <Frame>
Elements
<Button> resides in the same places as a <Frame> and can use all of its structure, plus the following:
<UI> <Button> <NormalTexture /> <PushedTexture /> <DisabledTexture /> <HighlightTexture /> <ButtonText /> <NormalFont /> <HighlightFont /> <DisabledFont /> <NormalColor /> <HighlightColor /> <DisabledColor /> <PushedTextOffset /> <Scripts> <OnClick /> <OnDoubleClick /> <PostClick /> <PreClick /> </Scripts> </Button> <Frame> <Frames> <Button /> </Frames> </Frame> </UI>
Attributes
<Button> has all the attributes of <Frame> plus the following:
XML attribute | Type | Default | Lua equivalent |
---|---|---|---|
text | xs:string | Button:SetText(text) | |
registerForClicks | xs:string | Button:RegisterForClicks(registerForClicks) | |
motionScriptsWhileDisabled | xs:boolean | Button:SetMotionScriptsWhileDisabled(motionScriptsWhileDisabled) |
Example
Included in Backdrop
<Button name="$parentButtonClose" inherits="OptionsButtonTemplate" text="Close"> <Anchors> <Anchor point="BOTTOMRIGHT"> <Offset> <AbsDimension x="-12" y="16"/> </Offset> </Anchor> </Anchors> <Scripts> <OnClick> autoInviteMainConfigFrame:Hide(); </OnClick> </Scripts> </Button>
Patch changes
- Patch 3.3.0 (2009-12-08): Attribute motionScriptsWhileDisabled added.[1]
- Patch 3.2.2 (2009-09-22): Attribute registerForClicks added.[2]
- Patch 1.11.0 (2006-06-19): Element <ButtonText> added.[3]
- Patch 1.1.0 (2004-11-07): Included in the original World of Warcraft release[4]
References
- ^ 2009-12-08, UI.xsd, version 3.3.0.10958, near line 490, archived at Townlong-Yak
- ^ 2009-09-25, UI.xsd, version 3.2.2.10505, near line 483, archived at Townlong-Yak
- ^ 2006-06-20, UI.xsd, version 1.11.0.5428, near line 411, archived at Townlong-Yak
- ^ 2004-12-06, UI.xsd, version 1.1.2.4115, near line 366, archived at Townlong-Yak