annotate Gui.lua @ 37:6362fe301d43

Storing class name in the persons so we can color them in later Exposing some data lists, but this will likely be retracted later in favor of interface functions
author John@Yosemite-PC
date Tue, 13 Mar 2012 23:17:18 -0400
parents 21c58930f74e
children 7bfbff27a3d7
rev   line source
John@1 1
John@1 2 local ChangeTab = function(container, event, group)
John@1 3 container:ReleaseChildren()
John@1 4 if group == "tab2" then
John@1 5 local desc = AceGUI:Create("Label")
John@1 6 desc:SetText("This is Tab 1")
John@1 7 desc:SetFullWidth(true)
John@1 8 container:AddChild(desc)
John@1 9
John@1 10 local button = AceGUI:Create("Button")
John@1 11 button:SetText("Tab 1 Button")
John@1 12 button:SetWidth(200)
John@1 13 container:AddChild(button)
John@1 14 elseif group == "tab1" then
John@1 15 local item2 = {string="item2!", color = {r=1,g=0,b=0.5} }
John@1 16 local itemList = {"Item1", item2, "Item3", "Item4"}
John@1 17
John@1 18 local myMultiSelect = AceGUI:Create("MultiSelect")
John@1 19 myMultiSelect:SetLabel("My Multi Select")
John@1 20 myMultiSelect:SetWidth(200)
John@1 21 myMultiSelect:SetHeight(400)
John@1 22 myMultiSelect:SetItemList(itemList)
John@1 23 myMultiSelect:SetMultiSelect(false)
John@1 24 container:AddChild(myMultiSelect)
John@1 25 end
John@1 26 end
John@1 27
John@1 28 function bsk:CreateGUI()
John@1 29
John@1 30 -- Create a container frame
John@1 31 self.frame = AceGUI:Create("Frame")
John@1 32 self.frame:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end)
John@1 33 self.frame:SetTitle("BSK")
John@1 34 self.frame:SetLayout("Flow")
John@1 35 self.frame:SetHeight(700)
John@1 36 self.frame:SetWidth(350)
John@1 37 local tab = AceGUI:Create("TabGroup")
John@1 38 tab:SetLayout("Flow")
John@1 39 tab:SetTabs(
John@1 40 {
John@1 41 {
John@1 42 text="Tab 1",
John@1 43 value="tab1"
John@1 44 },
John@1 45
John@1 46 {
John@1 47 text="Tab 2",
John@1 48 value="tab2"
John@1 49 },
John@1 50 {
John@1 51 text="Tab 3",
John@1 52 value="tab3"
John@1 53 },
John@1 54 {
John@1 55 text="Tab 4",
John@1 56 value="tab4"
John@1 57 }
John@1 58 }
John@1 59 )
John@1 60 tab.width = "fill"
John@1 61 tab.height = "fill"
John@1 62
John@1 63 tab:SetCallback("OnGroupSelected",ChangeTab)
John@1 64 tab:SelectTab("tab1")
John@1 65 self.frame:AddChild(tab)
John@1 66
John@1 67 -- Create a button
John@1 68 --local btn = AceGUI:Create("Button")
John@1 69 --btn:SetWidth(170)
John@1 70 --btn:SetText("Button !")
John@1 71 --btn:SetCallback("OnClick", function() print("Click!") end)
John@1 72 -- Add the button to the container
John@1 73 --self.frame:AddChild(btn)
John@1 74 end
John@1 75
John@1 76