local _, core = ...; -- Namespace

local AceGUI = LibStub("AceGUI-3.0")


function core.JewelcraftingLevelling(container)




local function DrawGroup1(container)
 
--core.JewelcraftingShadowlandsValue(container)
core.JewelcraftingLevellingShadowlands(container)
  
end


local function DrawGroup2(container)

core.JewelcraftingLevellingBFA(container)

end

local function DrawGroup3(container)

core.JewelcraftingLevellingLegion(container)

end

local function DrawGroup4(container)

core.JewelcraftingLevellingWod(container)

end

local function DrawGroup5(container)

core.JewelcraftingLevellingMop(container)

end

local function DrawGroup6(container)

core.JewelcraftingLevellingCata(container)

end

local function DrawGroup7(container)

core.JewelcraftingLevellingWotlk(container)

end

local function DrawGroup8(container)

core.JewelcraftingLevellingTBC(container)

end

local function DrawGroup9(container)

core.JewelcraftingLevellingVanilla(container)

end


local function SelectGroup(container, event, group)
   container:ReleaseChildren()
   if group == "tab1" then
      DrawGroup1(container)
   elseif group == "tab2" then
      DrawGroup2(container)
   
      elseif group == "tab3" then
      DrawGroup3(container)
   
      elseif group == "tab4" then
      DrawGroup4(container)
   
      elseif group == "tab5" then
      DrawGroup5(container)
   
      elseif group == "tab6" then
      DrawGroup6(container)
   
      elseif group == "tab7" then
      DrawGroup7(container)
   
      elseif group == "tab8" then
      DrawGroup8(container)
   
      elseif group == "tab9" then
      DrawGroup9(container)
   end
end


local frame = AceGUI:Create("Frame")
frame:SetTitle("Jewelcrafting Levelling Guide")
frame:SetStatusText("|cff00C78CWorthIt-Guides")
frame:SetWidth(400)
frame:SetHeight(500)
frame:SetCallback("OnClose", function(widget) AceGUI:Release(widget) end)


frame:SetLayout("Fill")



--[[ Scroll Frame 
local scrollcontainer = AceGUI:Create("SimpleGroup") 
scrollcontainer:SetFullWidth(true)
scrollcontainer:SetFullHeight(true) 
scrollcontainer:SetLayout("Fill") 

frame:AddChild(scrollcontainer)

scroll = AceGUI:Create("ScrollFrame")
scroll:SetLayout("Fill") -- probably?
scrollcontainer:AddChild(scroll)
]]--

local tab =  AceGUI:Create("TabGroup")
tab:SetLayout("Flow")
tab:SetTabs({{text="Shadowlands", value="tab1"}, {text="BFA", value="tab2"}, {text="Legion", value="tab3"}, {text="Wod", value="tab4"}, {text="Mop", value="tab5"}, {text="Cata", value="tab6"}, {text="Wotlk", value="tab7"}, {text="TBC", value="tab8"}, {text="Vanilla", value="tab9"}})
tab:SetCallback("OnGroupSelected", SelectGroup)
tab:SelectTab("tab1")

frame:AddChild(tab)











end