- tab buttons are now scrollable via the mouse wheel

- added the SetActiveSkin function to the util library
This commit is contained in:
Kenny Shields 2012-05-06 14:09:37 -04:00
parent 846f7cb60f
commit 5877855d4e
2 changed files with 47 additions and 5 deletions

View File

@ -138,12 +138,40 @@ function tabs:mousepressed(x, y, button)
return
end
if self.hover == true and button == "l" then
if self.hover == true then
local baseparent = self:GetBaseParent()
if button == "l" then
if baseparent and baseparent.type == "frame" then
baseparent:MakeTop()
local baseparent = self:GetBaseParent()
if baseparent and baseparent.type == "frame" then
baseparent:MakeTop()
end
end
end
if button == "wu" then
local buttonheight = self:GetHeightOfButtons()
local col = loveframes.util.BoundingBox(self.x, x, self.y, y, self.width, 1, buttonheight, 1)
local visible = self.internals[#self.internals - 1]:GetVisible()
if col == true and visible == true then
self.offsetx = self.offsetx + 5
end
end
if button == "wd" then
local buttonheight = self:GetHeightOfButtons()
local col = loveframes.util.BoundingBox(self.x, x, self.y, y, self.width, 1, buttonheight, 1)
local visible = self.internals[#self.internals]:GetVisible()
if col == true and visible == true then
self.offsetx = self.offsetx - 5
end
end

View File

@ -6,6 +6,20 @@
-- util library
loveframes.util = {}
--[[---------------------------------------------------------
- func: SetActiveSkin(name)
- desc: sets the active skin
--]]---------------------------------------------------------
function loveframes.util.SetActiveSkin(name)
loveframes.config["ACTIVESKIN"] = name
end
--[[---------------------------------------------------------
- func: GetActiveSkin()
- desc: gets the active skin
--]]---------------------------------------------------------
function loveframes.util.GetActiveSkin()
local index = loveframes.config["ACTIVESKIN"]