WoW:XML/CheckButton: Difference between revisions

m
(Created page with 'Derived from: Button Elements: CheckedTexture, DisabledCheckedTexture Attributes: checked Note: For checkb…')
 
Line 1: Line 1:
Derived from: [[XML/Button|Button]]
{{uixmlelem}}


Elements: [[XML/CheckedTexture|CheckedTexture]], [[XML/DisabledCheckedTexture|DisabledCheckedTexture]]
== Inheritance ==
: Inherited by: none, Inherits: <[[XML/Button|Button]]>, Runtime object: [[UIOBJECT_CheckButton|CheckButton]]
: Defined in: [[XML/Frames|Frames]], [[XML/Ui|Ui]]


Attributes: checked
== Elements ==
* <[[XML/CheckedTexture|CheckedTexture]]>
* <[[XML/DisabledCheckedTexture|DisabledCheckedTexture]]>


Note: For checkbuttons, setting the label of the checkbutton works differently from normal buttons. Using MyCheckButton:SetText("monkey"); will not give you a visible result. Instead, you need to address the text property of the checkbuttons invisible FontString frame. The FontString frame is named "<checkButtonName>Text", so to address it, use the following lua code:
== Attributes ==
* checked
 
== Details ==
For checkbuttons, setting the label of the checkbutton works differently from normal buttons. Using MyCheckButton:SetText("monkey"); will not give you a visible result. Instead, you need to address the text property of the checkbuttons invisible FontString frame. The FontString frame is named "<nowiki><checkButtonName></nowiki>Text", so to address it, use the following Lua code:
getglobal(MyCheckButton:GetName() .. "Text"):SetText("Monkey");
getglobal(MyCheckButton:GetName() .. "Text"):SetText("Monkey");


== Example ==
Included in [[XML/Backdrop|Backdrop]]
<pre>
<CheckButton name="$parentCheckButton" inherits="OptionsCheckButtonTemplate" checked="true">
  <Anchors>
    <Anchor point="LEFT">
    <Offset>
      <AbsDimension x="20" y="0" />
    </Offset>
    </Anchor>
  </Anchors>
</CheckButton>
</pre>


==== Example ====
[[Image:wow_checkbutton.jpg]]
Included in [[XML/Frame/Backdrop|Backdrop]]
<CheckButton name="$parentCheckButton" inherits="OptionsCheckButtonTemplate" checked="true">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="20" y="0"></AbsDimension>
</Offset>
</Anchor>
</Anchors>
</CheckButton>
 
[[Image:Checkbutton.jpg]]
[[Category:XML elements]]
[[Category:XML elements]]