Last active
December 12, 2022 15:37
-
-
Save Meorawr/cb878a33f2191cedb56790d1e9091c4e to your computer and use it in GitHub Desktop.
Tab System Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MyAddon_TabSystemDemoFrameMixin = {} | |
| function MyAddon_TabSystemDemoFrameMixin:OnLoad() | |
| TabSystemOwnerMixin.OnLoad(self) | |
| self:SetTabSystem(self.TabSystem) | |
| self.tabIndexPage1 = self:AddNamedTab("Page 1", self.TabPage1) | |
| self.tabIndexPage2 = self:AddNamedTab("Page 2 (with truncated text)", self.TabPage2) | |
| self.tabIndexPage3 = self:AddNamedTab("Page 3", self.TabPage3) | |
| self:SetTab(self.tabIndexPage2) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Ui> | |
| <Include file="MyAddon_TabSystemDemoFrame.lua"/> | |
| <Frame name="MyAddon_TabSystemDemoFrame" inherits="TabSystemOwnerTemplate" mixin="MyAddon_TabSystemDemoFrameMixin"> | |
| <Size x="300" y="300"/> | |
| <Anchors> | |
| <Anchor point="CENTER"/> | |
| </Anchors> | |
| <Frames> | |
| <Frame parentKey="TabSystem" inherits="TabSystemTemplate"> | |
| <KeyValues> | |
| <KeyValue key="minTabWidth" value="100" type="number"/> | |
| <KeyValue key="tabTemplate" value="TabSystemButtonTemplate" type="string"/> | |
| </KeyValues> | |
| <Anchors> | |
| <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT"/> | |
| </Anchors> | |
| </Frame> | |
| <Frame parentKey="TabPage1" setAllPoints="true"> | |
| <Layers> | |
| <Layer level="BACKGROUND"> | |
| <Texture setAllPoints="true"> | |
| <Color r="1"/> | |
| </Texture> | |
| </Layer> | |
| </Layers> | |
| </Frame> | |
| <Frame parentKey="TabPage2" setAllPoints="true"> | |
| <Layers> | |
| <Layer level="BACKGROUND"> | |
| <Texture setAllPoints="true"> | |
| <Color g="1"/> | |
| </Texture> | |
| </Layer> | |
| </Layers> | |
| </Frame> | |
| <Frame parentKey="TabPage3" setAllPoints="true"> | |
| <Layers> | |
| <Layer level="BACKGROUND"> | |
| <Texture setAllPoints="true"> | |
| <Color b="1"/> | |
| </Texture> | |
| </Layer> | |
| </Layers> | |
| </Frame> | |
| </Frames> | |
| <Scripts> | |
| <OnLoad method="OnLoad"/> | |
| </Scripts> | |
| </Frame> | |
| </Ui> |
Meorawr
commented
Dec 12, 2022
Author

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment