2012-05-06 00:24:42 +00:00
|
|
|
--[[------------------------------------------------
|
2012-09-29 23:20:41 +00:00
|
|
|
-- Love Frames - A GUI library for LOVE --
|
2013-02-11 21:15:40 +00:00
|
|
|
-- Copyright (c) 2013 Kenny Shields --
|
2012-05-06 00:24:42 +00:00
|
|
|
--]]------------------------------------------------
|
|
|
|
|
2012-09-29 23:20:41 +00:00
|
|
|
-- columnlist class
|
2012-11-24 22:42:16 +00:00
|
|
|
local newobject = loveframes.NewObject("columnlist", "loveframes_object_columnlist", true)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: initialize()
|
|
|
|
- desc: intializes the element
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:initialize()
|
|
|
|
|
2012-12-28 12:19:02 +00:00
|
|
|
self.type = "columnlist"
|
|
|
|
self.width = 300
|
|
|
|
self.height = 100
|
|
|
|
self.columnheight = 16
|
2013-02-11 21:15:40 +00:00
|
|
|
self.buttonscrollamount = 200
|
2013-02-17 18:18:25 +00:00
|
|
|
self.mousewheelscrollamount = 1500
|
2012-12-28 12:19:02 +00:00
|
|
|
self.autoscroll = false
|
2013-02-11 21:15:40 +00:00
|
|
|
self.dtscrolling = true
|
2012-12-28 12:19:02 +00:00
|
|
|
self.internal = false
|
|
|
|
self.children = {}
|
|
|
|
self.internals = {}
|
|
|
|
self.OnRowClicked = nil
|
|
|
|
self.OnScroll = nil
|
2012-11-24 22:42:16 +00:00
|
|
|
|
|
|
|
local list = loveframes.objects["columnlistarea"]:new(self)
|
2012-05-06 00:24:42 +00:00
|
|
|
table.insert(self.internals, list)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: update(deltatime)
|
|
|
|
- desc: updates the object
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:update(dt)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
local state = loveframes.state
|
|
|
|
local selfstate = self.state
|
|
|
|
|
|
|
|
if state ~= selfstate then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local visible = self.visible
|
|
|
|
local alwaysupdate = self.alwaysupdate
|
|
|
|
|
2012-09-29 23:20:41 +00:00
|
|
|
if not visible then
|
|
|
|
if not alwaysupdate then
|
2012-05-06 00:24:42 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-12-28 12:19:02 +00:00
|
|
|
local parent = self.parent
|
|
|
|
local base = loveframes.base
|
|
|
|
local children = self.children
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local update = self.Update
|
2012-05-22 07:10:18 +00:00
|
|
|
|
2012-05-06 00:24:42 +00:00
|
|
|
self:CheckHover()
|
|
|
|
|
|
|
|
-- move to parent if there is a parent
|
2012-09-29 23:20:41 +00:00
|
|
|
if parent ~= base then
|
2012-05-06 00:24:42 +00:00
|
|
|
self.x = self.parent.x + self.staticx
|
|
|
|
self.y = self.parent.y + self.staticy
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(children) do
|
2012-05-06 00:24:42 +00:00
|
|
|
v:update(dt)
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(internals) do
|
2012-05-06 00:24:42 +00:00
|
|
|
v:update(dt)
|
|
|
|
end
|
|
|
|
|
2012-09-29 23:20:41 +00:00
|
|
|
if update then
|
|
|
|
update(self, dt)
|
2012-05-06 00:24:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: draw()
|
|
|
|
- desc: draws the object
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:draw()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
local state = loveframes.state
|
|
|
|
local selfstate = self.state
|
|
|
|
|
|
|
|
if state ~= selfstate then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local visible = self.visible
|
|
|
|
|
2012-09-29 23:20:41 +00:00
|
|
|
if not visible then
|
2012-05-06 00:24:42 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2012-12-28 12:19:02 +00:00
|
|
|
local children = self.children
|
|
|
|
local internals = self.internals
|
|
|
|
local skins = loveframes.skins.available
|
|
|
|
local skinindex = loveframes.config["ACTIVESKIN"]
|
|
|
|
local defaultskin = loveframes.config["DEFAULTSKIN"]
|
|
|
|
local selfskin = self.skin
|
|
|
|
local skin = skins[selfskin] or skins[skinindex]
|
|
|
|
local drawfunc = skin.DrawColumnList or skins[defaultskin].DrawColumnList
|
|
|
|
local draw = self.Draw
|
|
|
|
local drawcount = loveframes.drawcount
|
2012-09-29 23:20:41 +00:00
|
|
|
|
2012-10-22 14:19:02 +00:00
|
|
|
-- set the object's draw order
|
|
|
|
self:SetDrawOrder()
|
2012-09-02 00:56:32 +00:00
|
|
|
|
2012-09-29 23:20:41 +00:00
|
|
|
if draw then
|
|
|
|
draw(self)
|
2012-05-06 00:24:42 +00:00
|
|
|
else
|
2012-09-02 00:56:32 +00:00
|
|
|
drawfunc(self)
|
2012-05-06 00:24:42 +00:00
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(internals) do
|
2012-05-06 00:24:42 +00:00
|
|
|
v:draw()
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(children) do
|
2012-05-06 00:24:42 +00:00
|
|
|
v:draw()
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: mousepressed(x, y, button)
|
|
|
|
- desc: called when the player presses a mouse button
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:mousepressed(x, y, button)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
local state = loveframes.state
|
|
|
|
local selfstate = self.state
|
|
|
|
|
|
|
|
if state ~= selfstate then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local visible = self.visible
|
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
if not visible then
|
2012-05-22 07:10:18 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2012-12-28 12:19:02 +00:00
|
|
|
local hover = self.hover
|
2012-09-29 23:20:41 +00:00
|
|
|
local children = self.children
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
if hover and button == "l" then
|
2012-05-06 00:24:42 +00:00
|
|
|
local baseparent = self:GetBaseParent()
|
|
|
|
if baseparent and baseparent.type == "frame" then
|
|
|
|
baseparent:MakeTop()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(internals) do
|
2012-05-06 00:24:42 +00:00
|
|
|
v:mousepressed(x, y, button)
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(children) do
|
2012-05-06 00:24:42 +00:00
|
|
|
v:mousepressed(x, y, button)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: mousereleased(x, y, button)
|
|
|
|
- desc: called when the player releases a mouse button
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:mousereleased(x, y, button)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
local state = loveframes.state
|
|
|
|
local selfstate = self.state
|
|
|
|
|
|
|
|
if state ~= selfstate then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local visible = self.visible
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
if not visible then
|
2012-05-22 07:10:18 +00:00
|
|
|
return
|
2012-05-06 00:24:42 +00:00
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local children = self.children
|
|
|
|
local internals = self.internals
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(internals) do
|
|
|
|
v:mousereleased(x, y, button)
|
2012-05-06 00:24:42 +00:00
|
|
|
end
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
for k, v in ipairs(children) do
|
|
|
|
v:mousereleased(x, y, button)
|
2012-05-06 00:24:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: Adjustchildren()
|
|
|
|
- desc: adjusts the width of the object's children
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:AdjustColumns()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
local width = self.width
|
2012-12-28 12:19:02 +00:00
|
|
|
local bar = self.internals[1].bar
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-10-22 14:19:02 +00:00
|
|
|
if bar then
|
|
|
|
width = width - self.internals[1].internals[1].width
|
2012-05-06 00:24:42 +00:00
|
|
|
end
|
|
|
|
|
2012-12-28 12:19:02 +00:00
|
|
|
local children = self.children
|
2012-05-06 00:24:42 +00:00
|
|
|
local numchildren = #children
|
|
|
|
local columnwidth = width/numchildren
|
2012-12-28 12:19:02 +00:00
|
|
|
local x = 0
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
for k, v in ipairs(children) do
|
2013-02-11 21:15:40 +00:00
|
|
|
if bar then
|
2012-05-06 00:24:42 +00:00
|
|
|
v:SetWidth(columnwidth)
|
|
|
|
else
|
|
|
|
v:SetWidth(columnwidth)
|
|
|
|
end
|
|
|
|
v:SetPos(x, 0)
|
|
|
|
x = x + columnwidth
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: AddColumn(name)
|
|
|
|
- desc: gives the object a new column with the specified
|
|
|
|
name
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:AddColumn(name)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
|
|
|
local width = self.width
|
|
|
|
local height = self.height
|
2012-05-22 07:10:18 +00:00
|
|
|
|
2012-11-24 22:42:16 +00:00
|
|
|
loveframes.objects["columnlistheader"]:new(name, self)
|
2012-05-06 00:24:42 +00:00
|
|
|
self:AdjustColumns()
|
|
|
|
|
2012-12-25 02:34:39 +00:00
|
|
|
list:SetSize(width, height)
|
2012-05-22 07:10:18 +00:00
|
|
|
list:SetPos(0, 0)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: AddRow(...)
|
|
|
|
- desc: adds a row of data to the object's list
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:AddRow(...)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
2012-05-22 07:10:18 +00:00
|
|
|
|
|
|
|
list:AddRow(arg)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: Getchildrenize()
|
|
|
|
- desc: gets the size of the object's children
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:GetColumnSize()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-12-28 12:19:02 +00:00
|
|
|
local children = self.children
|
2012-05-22 07:10:18 +00:00
|
|
|
local numchildren = #self.children
|
|
|
|
|
|
|
|
if numchildren > 0 then
|
2012-10-22 14:19:02 +00:00
|
|
|
local column = self.children[1]
|
|
|
|
local colwidth = column.width
|
|
|
|
local colheight = column.height
|
2012-05-22 07:10:18 +00:00
|
|
|
return colwidth, colheight
|
2012-05-06 00:24:42 +00:00
|
|
|
else
|
|
|
|
return 0, 0
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetSize(width, height)
|
|
|
|
- desc: sets the object's size
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:SetSize(width, height)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
2012-05-22 07:10:18 +00:00
|
|
|
|
2012-05-06 00:24:42 +00:00
|
|
|
self.width = width
|
|
|
|
self.height = height
|
2013-02-24 16:59:03 +00:00
|
|
|
self:AdjustColumns()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
list:SetSize(width, height)
|
|
|
|
list:SetPos(0, 0)
|
2013-02-24 16:59:03 +00:00
|
|
|
list:CalculateSize()
|
|
|
|
list:RedoLayout()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetWidth(width)
|
|
|
|
- desc: sets the object's width
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:SetWidth(width)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
2012-05-22 07:10:18 +00:00
|
|
|
|
2012-05-06 00:24:42 +00:00
|
|
|
self.width = width
|
2013-02-24 16:59:03 +00:00
|
|
|
self:AdjustColumns()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
list:SetSize(width)
|
|
|
|
list:SetPos(0, 0)
|
2013-02-24 16:59:03 +00:00
|
|
|
list:CalculateSize()
|
|
|
|
list:RedoLayout()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetHeight(height)
|
|
|
|
- desc: sets the object's height
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:SetHeight(height)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
2012-05-22 07:10:18 +00:00
|
|
|
|
2012-05-06 00:24:42 +00:00
|
|
|
self.height = height
|
2013-02-24 16:59:03 +00:00
|
|
|
self:AdjustColumns()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
list:SetSize(height)
|
|
|
|
list:SetPos(0, 0)
|
2013-02-24 16:59:03 +00:00
|
|
|
list:CalculateSize()
|
|
|
|
list:RedoLayout()
|
2012-05-06 00:24:42 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetMaxColorIndex(num)
|
|
|
|
- desc: sets the object's max color index for
|
|
|
|
alternating row colors
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:SetMaxColorIndex(num)
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
2012-05-22 07:10:18 +00:00
|
|
|
|
|
|
|
list.colorindexmax = num
|
2012-05-06 00:24:42 +00:00
|
|
|
|
2012-05-17 10:40:29 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: Clear()
|
|
|
|
- desc: removes all items from the object's list
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:Clear()
|
2012-05-17 10:40:29 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
2012-05-22 07:10:18 +00:00
|
|
|
|
|
|
|
list:Clear()
|
2012-05-17 10:40:29 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetAutoScroll(bool)
|
|
|
|
- desc: sets whether or not the list's scrollbar should
|
|
|
|
auto scroll to the bottom when a new object is
|
|
|
|
added to the list
|
|
|
|
--]]---------------------------------------------------------
|
2012-11-24 22:42:16 +00:00
|
|
|
function newobject:SetAutoScroll(bool)
|
2012-05-17 10:40:29 +00:00
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
local internals = self.internals
|
2012-12-28 12:19:02 +00:00
|
|
|
local list = internals[1]
|
2012-09-29 23:20:41 +00:00
|
|
|
local scrollbar = list:GetScrollBar()
|
2012-05-22 07:10:18 +00:00
|
|
|
|
2012-05-17 10:40:29 +00:00
|
|
|
self.autoscroll = bool
|
|
|
|
|
2012-05-22 07:10:18 +00:00
|
|
|
if list then
|
2012-09-29 23:20:41 +00:00
|
|
|
if scrollbar then
|
|
|
|
scrollbar.autoscroll = bool
|
2012-05-22 07:10:18 +00:00
|
|
|
end
|
2012-05-17 10:40:29 +00:00
|
|
|
end
|
|
|
|
|
2012-11-24 22:42:16 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetButtonScrollAmount(speed)
|
|
|
|
- desc: sets the scroll amount of the object's scrollbar
|
|
|
|
buttons
|
|
|
|
--]]---------------------------------------------------------
|
|
|
|
function newobject:SetButtonScrollAmount(amount)
|
|
|
|
|
|
|
|
self.buttonscrollamount = amount
|
|
|
|
self.internals[1].buttonscrollamount = amount
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: GetButtonScrollAmount()
|
|
|
|
- desc: gets the scroll amount of the object's scrollbar
|
|
|
|
buttons
|
|
|
|
--]]---------------------------------------------------------
|
|
|
|
function newobject:GetButtonScrollAmount()
|
|
|
|
|
|
|
|
return self.buttonscrollamount
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetMouseWheelScrollAmount(amount)
|
|
|
|
- desc: sets the scroll amount of the mouse wheel
|
|
|
|
--]]---------------------------------------------------------
|
|
|
|
function newobject:SetMouseWheelScrollAmount(amount)
|
|
|
|
|
|
|
|
self.mousewheelscrollamount = amount
|
|
|
|
self.internals[1].mousewheelscrollamount = amount
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: GetMouseWheelScrollAmount()
|
|
|
|
- desc: gets the scroll amount of the mouse wheel
|
|
|
|
--]]---------------------------------------------------------
|
|
|
|
function newobject:GetButtonScrollAmount()
|
|
|
|
|
|
|
|
return self.mousewheelscrollamount
|
|
|
|
|
2012-12-25 02:34:39 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetColumnHeight(height)
|
|
|
|
- desc: sets the height of the object's columns
|
|
|
|
--]]---------------------------------------------------------
|
|
|
|
function newobject:SetColumnHeight(height)
|
|
|
|
|
|
|
|
local children = self.children
|
|
|
|
local internals = self.internals
|
|
|
|
local list = internals[1]
|
|
|
|
|
|
|
|
self.columnheight = height
|
|
|
|
|
|
|
|
for k, v in ipairs(children) do
|
|
|
|
v:SetHeight(height)
|
|
|
|
end
|
|
|
|
|
|
|
|
list:CalculateSize()
|
|
|
|
list:RedoLayout()
|
|
|
|
|
2013-02-11 21:15:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: SetDTScrolling(bool)
|
|
|
|
- desc: sets whether or not the object should use delta
|
|
|
|
time when scrolling
|
|
|
|
--]]---------------------------------------------------------
|
|
|
|
function newobject:SetDTScrolling(bool)
|
|
|
|
|
|
|
|
self.dtscrolling = bool
|
|
|
|
self.internals[1].dtscrolling = bool
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--[[---------------------------------------------------------
|
|
|
|
- func: GetDTScrolling()
|
|
|
|
- desc: gets whether or not the object should use delta
|
|
|
|
time when scrolling
|
|
|
|
--]]---------------------------------------------------------
|
|
|
|
function newobject:GetDTScrolling()
|
|
|
|
|
|
|
|
return self.dtscrolling
|
|
|
|
|
2012-05-06 00:24:42 +00:00
|
|
|
end
|