Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-07-12, 09:10 AM   #15
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
How to do tabs like this!



--- my gui



Uploaded with ImageShack.us

LUA Code:
  1. local _G = _G -- import globals for faster usage
  2.  
  3. -- Create an function so we can give all the frames texts in a smart way!
  4.  
  5. function CreateOptions(self, TextTitle, DescriptionsText) -- CreateOptions(self, "Header Text", "Description Text")
  6.     local title = self:CreateFontString(nil, "OVERLAY")
  7.     title:SetFontObject('GameFontNormalLarge')
  8.     title:SetPoint('TOPLEFT', 16, -16)
  9.     title:SetText(TextTitle) -- Header Text
  10.    
  11.     local title2 = self:CreateFontString(nil, "OVERLAY")
  12.     title2:SetFontObject('GameFontHighlightSmall')
  13.     title2:SetPoint('TOPLEFT', 17, -37)
  14.     title2:SetText(DescriptionsText) -- Description Text.
  15. end
  16.  
  17. function CloseButton(self) -- CloseButton(self, id)
  18.     local closeButton = CreateFrame("CheckButton", "CheckBoxButton", self, "UIPanelCloseButton")
  19.     closeButton:SetSize(26, 26)
  20.     closeButton:SetPoint("TOPRIGHT", self)
  21.     closeButton:SetNormalTexture("")
  22.     closeButton:SetHighlightTexture("")
  23.     closeButton:SetPushedTexture("")
  24.     closeButton:SetDisabledTexture("")
  25.     closeButton:SetBackdrop({
  26.         bgFile = AftermathhUI.media.backdrop,
  27.         insets = {top = 1, left = 1, bottom = 1, right = 1},
  28.     })
  29.    
  30.     CreateBorderLight(closeButton, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, -3)
  31.  
  32.     local closeButtonfont = closeButton:CreateFontString(nil, "OVERLAY")
  33.     closeButtonfont:SetFont(AftermathhUI.media.font, 14, AftermathhUI.media.fontflag)
  34.     if AftermathhUI.media.shadowoffset == true then
  35.         closeButtonfont:SetShadowOffset(1, -1)
  36.         closeButtonfont:SetShadowColor(0, 0, 0)
  37.     end
  38.     closeButtonfont:SetPoint("CENTER", 1, 1)
  39.     closeButtonfont:SetText("x")
  40.  
  41.     closeButton:HookScript("OnEnter", function(self)
  42.         closeButtonfont:SetTextColor(1, 0, 0)
  43.         ColorBorder(closeButton, 1, 0, 0)
  44.     end)
  45.     closeButton:HookScript("OnLeave", function(self)
  46.         closeButtonfont:SetTextColor(1, 1, 1)
  47.         ColorBorder(closeButton, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor)
  48.     end)
  49. end
  50.  
  51. function Checkbox(self, selfid, px, py, description, SetChecked, OnClick) -- Checkbox(self, 1, 14, -55, "Description Text", SetChecked, OnClick)
  52.     local checkbox = CreateFrame("CheckButton", "CheckBoxButton" .. selfid, self, "OptionsSmallCheckButtonTemplate")
  53.     checkbox:SetPoint("TOPLEFT", self, px, py)
  54.     checkbox:SetScript("OnClick", OnClick)
  55.     checkbox:SetWidth(28)
  56.     checkbox:SetHeight(28)
  57.     checkbox:SetFrameStrata("HIGH")
  58.     checkbox:SetChecked(SetChecked)
  59.     checkbox:SetHitRectInsets(0, -60, 0, 0)
  60.     --checkbox:GetNormalTexture():SetAlpha(0.6)
  61.     checkbox:SetNormalTexture("")
  62.     checkbox:SetPushedTexture("")
  63.     checkbox:SetHighlightTexture("")
  64.     checkbox:SetBackdrop({
  65.         bgFile = AftermathhUI.media.backdrop,
  66.         insets = {top = 1, left = 1, bottom = 1, right = 1},
  67.     })
  68.  
  69.     CreateBorderLight(checkbox, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, -4)
  70.    
  71.     checkbox:HookScript("OnEnter", function(self)
  72.         ColorBorder(checkbox, 1.0, 0.82, 0)
  73.     end)
  74.    
  75.     checkbox:HookScript("OnLeave", function(self)
  76.         ColorBorder(checkbox, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor)
  77.     end)
  78.    
  79.     local checkboxtexture = checkbox:CreateTexture(nil, "ARTWORK")
  80.     checkboxtexture:SetWidth(25)
  81.     checkboxtexture:SetHeight(22)
  82.     checkboxtexture:SetAlpha(0.9)
  83.     checkboxtexture:SetPoint("LEFT", 2, 1)
  84.     checkboxtexture:SetTexture("Interface\\RAIDFRAME\\ReadyCheck-Ready")
  85.     checkbox:SetCheckedTexture(checkboxtexture)
  86.    
  87.     local checkboxtext = self:CreateFontString(nil, "ARTWORK", "GameFontNormal")
  88.     checkboxtext:SetPoint("LEFT", checkbox, "RIGHT", 5, 1)
  89.     checkboxtext:SetFontObject("GameFontNormal")
  90.     checkboxtext:SetTextColor(1, 1, 1)
  91.     checkboxtext:SetText(description)
  92. end
  93.  
  94. function ShowBuffs_OnClick()
  95.  
  96. end
  97.  
  98. ------------------------- MAIN -------------------------------------------------
  99.  
  100. local AftermathhUIFrame = CreateFrame("Frame", "AftermathhUIFrame", UIParent)
  101. AftermathhUIFrame:SetSize(800, 550)
  102. AftermathhUIFrame:SetFrameStrata("HIGH")
  103. AftermathhUIFrame:SetFrameLevel(25)
  104. AftermathhUIFrame:SetBackdrop({
  105.     bgFile = AftermathhUI.media.blank,
  106.     insets = {top = -1, left = -1, bottom = -1, right = -1},
  107. })
  108. AftermathhUIFrame:SetBackdropColor(unpack(AftermathhUI.media.backdropcolor))
  109. AftermathhUIFrame:Hide()
  110.  
  111. ----- Make it moveable! --------
  112.  
  113. AftermathhUIFrame:SetClampedToScreen(true)
  114. AftermathhUIFrame:SetMovable(true)
  115. AftermathhUIFrame:SetUserPlaced(true)
  116. AftermathhUIFrame:EnableMouse(true)
  117. AftermathhUIFrame:RegisterForDrag("LeftButton")
  118. AftermathhUIFrame:SetHitRectInsets(-15, -15, -5, -5)
  119.  
  120. AftermathhUIFrame:ClearAllPoints()
  121. AftermathhUIFrame.ClearAllPoints = function() end
  122. AftermathhUIFrame:SetPoint("CENTER", UIParent)
  123. AftermathhUIFrame.SetPoint = function() end
  124.  
  125. AftermathhUIFrame:SetScript("OnDragStart", function(self)
  126.     AftermathhUIFrame:StartMoving()
  127. end)
  128.  
  129. AftermathhUIFrame:SetScript("OnDragStop", function(self)
  130.     AftermathhUIFrame:StopMovingOrSizing()
  131. end)
  132.  
  133. -----------------------
  134.  
  135. CreateOptions(AftermathhUIFrame, "AftermathhUI_GUI", "Welcome to AftermathhUI_GUI. Here you can find most of the options that are needed!")
  136.  
  137. CloseButton(AftermathhUIFrame)
  138.  
  139. CreateBorderLight(AftermathhUIFrame, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 2)
  140.  
  141. Checkbox(AftermathhUIFrame, 1, 14, -95, "Show PvP Icon.", AftermathhUI.ouf.showpvpicon)
  142. Checkbox(AftermathhUIFrame, 2, 14, -115, "Show Buffs.", AftermathhUI.ouf.showbuffs, ShowBuffs_OnClick)
  143. Checkbox(AftermathhUIFrame, 3, 14, -135, "Show Debuffs.", AftermathhUI.ouf.showdebuffs)
  144. Checkbox(AftermathhUIFrame, 4, 14, -155, "Only Show Player Debuffs.", AftermathhUI.ouf.onlyshowplayerdebuffs)
  145. Checkbox(AftermathhUIFrame, 5, 14, -175, "Show Aggroo.", AftermathhUI.ouf.showaggroo)
  146. Checkbox(AftermathhUIFrame, 6, 14, -195, "Show Debuff Highlight", AftermathhUI.ouf.showdebuffhighlight)
  147. Checkbox(AftermathhUIFrame, 7, 14, -215, "Tooltip On Mouseover (Player etc).", AftermathhUI.ouf.tooltiponouf)
  148. Checkbox(AftermathhUIFrame, 8, 14, -235, "Show Role Icon.", AftermathhUI.ouf.showroleicon)
  149. Checkbox(AftermathhUIFrame, 9, 14, -255, "Show Boss Frames.", AftermathhUI.ouf.bossframes)
  150. Checkbox(AftermathhUIFrame, 10, 14, -275, "Show Party Frames.", AftermathhUI.ouf.showparty)
  151. Checkbox(AftermathhUIFrame, 11, 14, -295, "Tooltip On Mouseover (Raidframes).", AftermathhUI.ouf.tooltiponraid)
  152. Checkbox(AftermathhUIFrame, 12, 14, -315, "Highlight On Mouseover (Raidframes).", AftermathhUI.ouf.highlightontarget)
  153. Checkbox(AftermathhUIFrame, 13, 14, -335, "Make Raid Frames Vertical.", AftermathhUI.ouf.raidframesvertical)
  154. Checkbox(AftermathhUIFrame, 14, 14, -355, "Aura Watch (Raidframes).", AftermathhUI.ouf.aurawatch)
  155. Checkbox(AftermathhUIFrame, 15, 14, -375, "Raid Debuffs.", AftermathhUI.ouf.raiddebuffs)
  156. Checkbox(AftermathhUIFrame, 16, 14, -395, "Show Aggro On Raidframes.", AftermathhUI.ouf.showaggroonraidframes)
  157. Checkbox(AftermathhUIFrame, 17, 14, -415, "Experiance Bar.", AftermathhUI.ouf.expbar)
  158. Checkbox(AftermathhUIFrame, 18, 14, -435, "Reputation Bar.", AftermathhUI.ouf.repbar)
  159. Checkbox(AftermathhUIFrame, 19, 14, -455, "Moveable Frames.", AftermathhUI.ouf.moveableframes)
  160. Checkbox(AftermathhUIFrame, 20, 14, -475, "Totembar from oUF.", AftermathhUI.ouf.totembar)
  161. Checkbox(AftermathhUIFrame, 21, 14, -495, "Heal Prediction.", AftermathhUI.ouf.healprediction)
  162. Checkbox(AftermathhUIFrame, 22, 14, -515, "Combat Feedback.", AftermathhUI.ouf.combatfeedback)
  163.  
  164. --- Coulum 2
  165.  
  166. Checkbox(AftermathhUIFrame, 23, 350, -95, "Classcolor on Castbar.", AftermathhUI.ouf.castbarclasscolor)
  167. Checkbox(AftermathhUIFrame, 24, 350, -115, "Show Safe Zone.", AftermathhUI.ouf.showsafezone)
  168. Checkbox(AftermathhUIFrame, 25, 350, -135, "Show Latency.", AftermathhUI.ouf.showlatency)
  169. Checkbox(AftermathhUIFrame, 26, 350, -155, "Target Castbar Icon.", AftermathhUI.ouf.targetcastbaricon)
  170. Checkbox(AftermathhUIFrame, 27, 350, -175, "Focus Castbar Icon.", AftermathhUI.ouf.focuscastbaricon)
  171. Checkbox(AftermathhUIFrame, 28, 350, -195, "Show Interrupt Highlight.", AftermathhUI.ouf.showinterrupthighlight)
  172.  
  173. local function AftermathhUIFrameOnEnter(self, fontsub)
  174.     self:HookScript("OnEnter", function(self)
  175.         ColorBorder(self, 1.0, 0.82, 0)
  176.     end)
  177.     self:HookScript("OnLeave", function(self)
  178.         ColorBorder(self, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor)
  179.     end)
  180. end
  181.  
  182. -------------------- SUB 1 ------------------------------------------
  183.  
  184. local AftermathhUIFrameSub1 = CreateFrame("Button", nil, AftermathhUIFrame)
  185. AftermathhUIFrameSub1:SetSize(73, 20)
  186. AftermathhUIFrameSub1:SetFrameStrata("HIGH")
  187. AftermathhUIFrameSub1:SetFrameLevel(26)
  188. AftermathhUIFrameSub1:SetBackdrop({
  189.     bgFile = AftermathhUI.media.texture2,
  190.     --insets = {top = -1, left = -1, bottom = -1, right = -1},
  191. })
  192. AftermathhUIFrameSub1:SetBackdropColor(.40, .40, .40, 1)
  193. AftermathhUIFrameSub1:SetPoint("TOPLEFT", AftermathhUIFrame, 19, -65)
  194. AftermathhUIFrameSub1:Hide()
  195.  
  196. CreateBorderLight(AftermathhUIFrameSub1, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 1)
  197.  
  198. AftermathhUIFrameOnEnter(AftermathhUIFrameSub1)
  199.  
  200. local AftermathhUIFrameSub1Font = AftermathhUIFrameSub1:CreateFontString(nil, "OVERLAY")
  201. AftermathhUIFrameSub1Font:SetFontObject('GameFontHighlightSmall')
  202. AftermathhUIFrameSub1Font:SetText("Unitframes")
  203. AftermathhUIFrameSub1Font:SetTextColor(1.0, 0.82, 0)
  204. AftermathhUIFrameSub1Font:SetPoint("CENTER")
  205.  
  206. ----------------------------- SUB 2 -------------------------------------
  207.  
  208. local AftermathhUIFrameSub2 = CreateFrame("Button", nil, AftermathhUIFrame)
  209. AftermathhUIFrameSub2:SetSize(73, 20)
  210. AftermathhUIFrameSub2:SetFrameStrata("HIGH")
  211. AftermathhUIFrameSub2:SetFrameLevel(26)
  212. AftermathhUIFrameSub2:SetBackdrop({
  213.     bgFile = AftermathhUI.media.texture2,
  214.     --insets = {top = -1, left = -1, bottom = -1, right = -1},
  215. })
  216. AftermathhUIFrameSub2:SetBackdropColor(.40, .40, .40, 1)
  217. AftermathhUIFrameSub2:SetPoint("TOPLEFT", AftermathhUIFrame, 97, -65)
  218. AftermathhUIFrameSub2:Hide()
  219.  
  220. CreateBorderLight(AftermathhUIFrameSub2, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 1)
  221.  
  222. AftermathhUIFrameOnEnter(AftermathhUIFrameSub2)
  223.  
  224. local AftermathhUIFrameSub2Font = AftermathhUIFrameSub2:CreateFontString(nil, "OVERLAY")
  225. AftermathhUIFrameSub2Font:SetFontObject('GameFontHighlightSmall')
  226. AftermathhUIFrameSub2Font:SetText("Buffs")
  227. AftermathhUIFrameSub2Font:SetTextColor(1.0, 0.82, 0)
  228. AftermathhUIFrameSub2Font:SetPoint("CENTER")
  229.  
  230. -------------------- SUB 3 -------------------------------------------------
  231.  
  232. local AftermathhUIFrameSub3 = CreateFrame("Button", nil, AftermathhUIFrame)
  233. AftermathhUIFrameSub3:SetSize(73, 20)
  234. AftermathhUIFrameSub3:SetFrameStrata("HIGH")
  235. AftermathhUIFrameSub3:SetFrameLevel(26)
  236. AftermathhUIFrameSub3:SetBackdrop({
  237.     bgFile = AftermathhUI.media.texture2,
  238.     --insets = {top = -1, left = -1, bottom = -1, right = -1},
  239. })
  240. AftermathhUIFrameSub3:SetBackdropColor(.40, .40, .40, 1)
  241. AftermathhUIFrameSub3:SetPoint("TOPLEFT", AftermathhUIFrame, 175, -65)
  242. AftermathhUIFrameSub3:Hide()
  243.  
  244. CreateBorderLight(AftermathhUIFrameSub3, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 1)
  245.  
  246. AftermathhUIFrameOnEnter(AftermathhUIFrameSub3)
  247.  
  248. local AftermathhUIFrameSub3Font = AftermathhUIFrameSub3:CreateFontString(nil, "OVERLAY")
  249. AftermathhUIFrameSub3Font:SetFontObject('GameFontHighlightSmall')
  250. AftermathhUIFrameSub3Font:SetText("Chat")
  251. AftermathhUIFrameSub3Font:SetTextColor(1.0, 0.82, 0)
  252. AftermathhUIFrameSub3Font:SetPoint("CENTER")
  253.  
  254.  
  255. -------------------------------------------------------------------------------------------
  256.  
  257. SlashCmdList['OPENAFTERMATHHUI'] = function()
  258.     --InterfaceOptionsFrame_OpenToCategory(AftermathhUI.panel)
  259.     AftermathhUIFrame:Show()
  260.     AftermathhUIFrameSub1:Show()
  261.     AftermathhUIFrameSub2:Show()
  262.     AftermathhUIFrameSub3:Show()
  263.    
  264. end
  265. SLASH_OPENAFTERMATHHUI1 = '/after'
  266. SLASH_OPENAFTERMATHHUI2 = '/aftermathhui'
  267.  
  268. SlashCmdList['CLOSEAFTERMATHHUI'] = function()
  269.     --InterfaceOptionsFrame_OpenToCategory(AftermathhUI.panel)
  270.     AftermathhUIFrame:Hide()
  271.     AftermathhUIFrameSub1:Hide()
  272.     AftermathhUIFrameSub2:Hide()
  273.     AftermathhUIFrameSub3:Hide()
  274. end
  275. SLASH_CLOSEAFTERMATHHUI1 = '/afterclose'
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » How to make an GUI.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off