Here is part on my code, my problem is that i have trouble getting the CheckButton to function within my TabbedFrame, I hope that some 1 might be able to help me overcome this barrier.
XML:
Code:
<Frame name="MenuFrame" toplevel="true" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" parent="UIParent">
<Size>
<Anchors>
<Backdrop>
<Layers>
<Layer level="ARTWORK">
<Texture name="FrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<Anchors>
</Texture>
<FontString inherits="GameFontNormal" text="Menu">
<Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="CloseButton">
<Size>
<Anchors>
</Button>
<Frame name="TabPage1" hidden="false">
<Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString inherits="GameFontNormal" text="General Options">
<Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<CheckButton name="ToggleButton" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Scripts>
<OnLoad>
getglobal(this:GetName().."Text"):SetText("Enable Button");
</OnLoad>
<OnClick>
Toggle();
</OnClick>
</Scripts>
</CheckButton>
</Frames>
</Frame>
<Button name="$parentTab1" inherits="CharacterFrameTabButtonTemplate" id="1" text="General">
<Anchors>
<Anchor point="CENTER" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="60" y="-8"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PanelTemplates_SetTab(MenuFrame, 1);
TabPage1:Show();
TabPage2:Hide();
TabPage3:Hide();
TabPage4:Hide();
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnLoad>
this.elapsed = 0;
PanelTemplates_SetNumTabs(MenuFrame, 4);
PanelTemplates_SetTab(MenuFrame, 1);
</OnLoad>
<OnShow>
PlaySound("UChatScrollButton");
PanelTemplates_SetTab(MenuFrame, 1);
TabPage1:Show();
myTabPage2:Hide();
myTabPage3:Hide();
myTabPage4:Hide();
</OnShow>
<OnHide>
PlaySound("UChatScrollButton");
</OnHide>
<OnMouseDown>
if(arg1 == "LeftButton") then
this:StartMoving();
end
</OnMouseDown>
<OnMouseUp>
if(arg1 == "LeftButton") then
this:StopMovingOrSizing();
end
</OnMouseUp>
</Scripts>
</Frame>
LUA:
Code:
MyVariable = "true";
function OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
PanelTemplates_SetNumTabs(MenuFrame, 4);
PanelTemplates_SetTab(MenuFrame, 1);
TabPage1:Show();
TabPage2:Hide();
TabPage3:Hide();
TabPage4:Show();
end
function Event(event)
if (event == "PLAYER_ENTERING_WORLD") then
MenuFrame:Hide();
return;
elseif (event == "VARIABLES_LOADED") then
Menu_Vars();
end
end
function Menu_Vars()
ToggleButton:SetChecked(MyVariable);
end
function Toggle()
if(MyVariable == "true") then
MyVariable = "false";
ToggleButton:SetChecked(MyVariable);
else
MyVariable = "true";
ToggleButton:SetChecked(MyVariable);
A_Frame:Show();
end
end
As I understand from the guides and notes on wowwiki.com this should work, some 1 see anything I have missed? Any help would be apprisiated...