diff Gui.lua @ 1:21c58930f74e

Refactoring
author John@Yosemite-PC
date Fri, 02 Mar 2012 22:32:12 -0500
parents
children 7bfbff27a3d7
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Gui.lua	Fri Mar 02 22:32:12 2012 -0500
@@ -0,0 +1,76 @@
+
+local ChangeTab = function(container, event, group)
+    container:ReleaseChildren()
+    if group == "tab2" then
+        local desc = AceGUI:Create("Label")
+        desc:SetText("This is Tab 1")
+        desc:SetFullWidth(true)
+        container:AddChild(desc)
+
+        local button = AceGUI:Create("Button")
+        button:SetText("Tab 1 Button")
+        button:SetWidth(200)
+        container:AddChild(button)
+    elseif group == "tab1" then
+        local item2 = {string="item2!", color = {r=1,g=0,b=0.5} }
+        local itemList = {"Item1", item2, "Item3", "Item4"}
+
+        local myMultiSelect = AceGUI:Create("MultiSelect")
+        myMultiSelect:SetLabel("My Multi Select")
+        myMultiSelect:SetWidth(200)
+        myMultiSelect:SetHeight(400)
+        myMultiSelect:SetItemList(itemList)
+        myMultiSelect:SetMultiSelect(false)
+        container:AddChild(myMultiSelect)
+    end
+end
+
+function bsk:CreateGUI()
+
+    -- Create a container frame
+    self.frame = AceGUI:Create("Frame")
+    self.frame:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end)
+    self.frame:SetTitle("BSK")
+    self.frame:SetLayout("Flow")
+    self.frame:SetHeight(700) 
+    self.frame:SetWidth(350)
+    local tab = AceGUI:Create("TabGroup")
+    tab:SetLayout("Flow")
+    tab:SetTabs(
+        {
+            {
+                text="Tab 1",
+                value="tab1"
+            },
+
+            {
+                text="Tab 2",
+                value="tab2"
+            },
+            {
+                text="Tab 3",
+                value="tab3"
+            },
+            {
+                text="Tab 4",
+                value="tab4"
+            }
+        }
+    )
+	tab.width = "fill"
+	tab.height = "fill"
+
+    tab:SetCallback("OnGroupSelected",ChangeTab)
+    tab:SelectTab("tab1")
+    self.frame:AddChild(tab)
+
+    -- Create a button
+    --local btn = AceGUI:Create("Button")
+    --btn:SetWidth(170)
+    --btn:SetText("Button !")
+    --btn:SetCallback("OnClick", function() print("Click!") end)
+    -- Add the button to the container
+    --self.frame:AddChild(btn)
+end
+
+