I should preface this by saying that I have no training in coding other then that from High School.
So please excuse my silly questions. Found this code thanks to Xchg of Silvermoon on
My question is what parts do I need to change so that I can individualize each set of Scroll Frames. As Im going to have Multiple Sets of Frames one for each capital City.
Code:
-- -- -- -- -- -- -- -- -- Find Menu Scroll Stormwind -- -- -- -- -- -- -- -- --
--parent frame
local frame = CreateFrame("Frame", "FindMenuScrollStormwind", FindMenu)
frame:SetSize(385, 150)
frame:SetPoint("CENTER", 0,15) -- Useing this setpoint you can move the Frame indepently of the Scroll Bar
local texture = frame:CreateTexture()
texture:SetAllPoints()
texture:SetTexture(0,0,0,0)
frame.background = texture
--scrollframe
scrollframe = CreateFrame("ScrollFrame", nil, frame)
scrollframe:SetPoint("TOPLEFT", 0, 0)
scrollframe:SetPoint("BOTTOMRIGHT", 0, 0)
local texture = scrollframe:CreateTexture()
texture:SetAllPoints()
texture:SetTexture(0,0,0,0)
frame.scrollframe = scrollframe
--scrollbar
scrollbar = CreateFrame("Slider", nil, scrollframe, "UIPanelScrollBarTemplate")
scrollbar:SetPoint("TOPLEFT", frame, "TOPRIGHT", 3, -23) -- This Moves the Up Arrow on the Scroll Bar
scrollbar:SetPoint("BOTTOMLEFT", frame, "BOTTOMRIGHT", 0, -23) -- This Moves the Down Arrow on the Scoll Bar
scrollbar:SetMinMaxValues(1, 200)
scrollbar:SetValueStep(1)
scrollbar.scrollStep = 1
scrollbar:SetValue(0)
scrollbar:SetWidth(15)
scrollbar:SetScript("OnValueChanged",
function (self, value)
self:GetParent():SetVerticalScroll(value)
end)
local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND")
scrollbg:SetAllPoints(scrollbar)
scrollbg:SetTexture(0, 0, 0, 0.4)
frame.scrollbar = scrollbar
--content frame
local content = CreateFrame("Frame", nil, scrollframe)
content:SetSize(128, 128)
--local texture = content:CreateTexture()
--texture:SetAllPoints()
--texture:SetTexture("Interface\\GLUES\\MainMenu\\Glues-BlizzardLogo")
--content.texture = texture
scrollframe.content = content
scrollframe:SetScrollChild(content)
-- Find Menu Options Buttons
--local button = CreateFrame("Button", "ButtonName", Parentframe,"UIPanelButtonTemplate")
--ButtonName:SetText("My Name is Button")
--ButtonName:SetPoint("point", "releventframe", "relativePoint", offsetx,offsety)
--ButtonName:SetWidth(110)
--ButtonName:SetHeight(50)
local button = CreateFrame("Button", "Battle_Pet_Trainer",content,"UIPanelButtonTemplate") -- Row 1 Column 1
Battle_Pet_Trainer:SetText("Battle Pet Trainer")
Battle_Pet_Trainer:SetPoint("TOPLEFT",0,0)
Battle_Pet_Trainer:SetWidth(120)
Battle_Pet_Trainer:SetHeight(50)
local button = CreateFrame("Button", "Reforge",content,"UIPanelButtonTemplate") -- Row 1 Column 2
Reforge:SetText("Reforge")
Reforge:SetPoint("LEFT", "Battle_Pet_Trainer", "RIGHT", 0,0)
Reforge:SetWidth(120)
Reforge:SetHeight(50)
local button = CreateFrame("Button", "Transmogrification",content,"UIPanelButtonTemplate") -- Row 1 Column 3
Transmogrification:SetText("Transmogrification")
Transmogrification:SetPoint("LEFT", "Reforge", "RIGHT", 0,0)
Transmogrification:SetWidth(120)
Transmogrification:SetHeight(50)
local button = CreateFrame("Button", "Void_Storage",content,"UIPanelButtonTemplate") -- Row 2 Column 1
Void_Storage:SetText("Void Storage")
Void_Storage:SetPoint("TOP", "Battle_Pet_Trainer", "BOTTOM", 0,0)
Void_Storage:SetWidth(120)
Void_Storage:SetHeight(50)
local button = CreateFrame("Button", "Auction_House",content,"UIPanelButtonTemplate") -- Row 2 Column 2
Auction_House:SetText("Auction House")
Auction_House:SetPoint("TOP", "Reforge", "BOTTOM", 0,0)
Auction_House:SetWidth(120)
Auction_House:SetHeight(50)
local button = CreateFrame("Button", "Bank",content,"UIPanelButtonTemplate") -- Row 2 Column 3
Bank:SetText("Bank")
Bank:SetPoint("TOP", "Transmogrification", "BOTTOM", 0,0)
Bank:SetWidth(120)
Bank:SetHeight(50)
local button = CreateFrame("Button", "Barber",content,"UIPanelButtonTemplate") -- Row 3 Column 1
Barber:SetText("Barber")
Barber:SetPoint("TOP", "Void_Storage", "BOTTOM", 0,0)
Barber:SetWidth(120)
Barber:SetHeight(50)
local button = CreateFrame("Button", "Class_Trainer",content,"UIPanelButtonTemplate") -- Row 3 Column 2
Class_Trainer:SetText("Class Trainer")
Class_Trainer:SetPoint("TOP", "Auction_House", "BOTTOM", 0,0)
Class_Trainer:SetWidth(120)
Class_Trainer:SetHeight(50)
local button = CreateFrame("Button", "Flight_Master",content,"UIPanelButtonTemplate") -- Row 3 Column 3
Flight_Master:SetText("Flight Master")
Flight_Master:SetPoint("TOP", "Bank", "BOTTOM", 0,0)
Flight_Master:SetWidth(120)
Flight_Master:SetHeight(50)
local button = CreateFrame("Button", "Guild_Master",content,"UIPanelButtonTemplate") -- Row 4 Column 1
Guild_Master:SetText("Guild Master")
Guild_Master:SetPoint("TOP", "Barber", "BOTTOM", 0,0)
Guild_Master:SetWidth(120)
Guild_Master:SetHeight(50)
local button = CreateFrame("Button", "Inn",content,"UIPanelButtonTemplate") -- Row 4 Column 2
Inn:SetText("Inn")
Inn:SetPoint("TOP", "Class_Trainer", "BOTTOM", 0,0)
Inn:SetWidth(120)
Inn:SetHeight(50)
local button = CreateFrame("Button", "MailBox",content,"UIPanelButtonTemplate") -- Row 4 Column 3
MailBox:SetText("MailBox")
MailBox:SetPoint("TOP", "Flight_Master", "BOTTOM", 0,0)
MailBox:SetWidth(120)
MailBox:SetHeight(50)
local button = CreateFrame("Button", "Points_of_Interest",content,"UIPanelButtonTemplate") -- Row 5 Column 1
Points_of_Interest:SetText("Points of Interest")
Points_of_Interest:SetPoint("TOP", "Guild_Master", "BOTTOM", 0,0)
Points_of_Interest:SetWidth(120)
Points_of_Interest:SetHeight(50)
local button = CreateFrame("Button", "Portals",content,"UIPanelButtonTemplate") -- Row 5 Column 2
Portals:SetText("Portals")
Portals:SetPoint("TOP", "Inn", "BOTTOM", 0,0)
Portals:SetWidth(120)
Portals:SetHeight(50)
local button = CreateFrame("Button", "Profession_Trainer",content,"UIPanelButtonTemplate") -- Row 5 Column 3
Profession_Trainer:SetText("Profession Trainer")
Profession_Trainer:SetPoint("TOP", "MailBox", "BOTTOM", 0,0)
Profession_Trainer:SetWidth(120)
Profession_Trainer:SetHeight(50)
local button = CreateFrame("Button", "Stable_Master",content,"UIPanelButtonTemplate") -- Row 6 Column 1
Stable_Master:SetText("Stable Master")
Stable_Master:SetPoint("TOP", "Points_of_Interest", "BOTTOM", 0,0)
Stable_Master:SetWidth(120)
Stable_Master:SetHeight(50)
local button = CreateFrame("Button", "Vendor",content,"UIPanelButtonTemplate") -- Row 6 Column 2
Vendor:SetText("Vendor")
Vendor:SetPoint("TOP", "Portals", "BOTTOM", 0,0)
Vendor:SetWidth(120)
Vendor:SetHeight(50)