mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Rename columnlist:AdjustColumns to columnlist:PositionColumns
This commit is contained in:
parent
c159ae7828
commit
62f95614f4
@ -231,31 +231,16 @@ function newobject:mousereleased(x, y, button)
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: Adjustchildren()
|
||||
- desc: adjusts the width of the object's children
|
||||
- func: PositionColumns()
|
||||
- desc: positions the object's columns
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:AdjustColumns()
|
||||
function newobject:PositionColumns()
|
||||
|
||||
local width = self.width
|
||||
local vbody = self.internals[1]:GetVerticalScrollBody()
|
||||
|
||||
if varea then
|
||||
width = width - vbody.width
|
||||
end
|
||||
|
||||
local children = self.children
|
||||
local numchildren = #children
|
||||
local columnwidth = width/numchildren
|
||||
local x = 0
|
||||
|
||||
for k, v in ipairs(children) do
|
||||
if bar then
|
||||
v:SetWidth(columnwidth)
|
||||
else
|
||||
v:SetWidth(columnwidth)
|
||||
end
|
||||
for k, v in ipairs(self.children) do
|
||||
v:SetPos(x, 0)
|
||||
x = x + columnwidth
|
||||
x = x + v.width
|
||||
end
|
||||
|
||||
return self
|
||||
@ -275,7 +260,7 @@ function newobject:AddColumn(name)
|
||||
local height = self.height
|
||||
|
||||
loveframes.objects["columnlistheader"]:new(name, self)
|
||||
self:AdjustColumns()
|
||||
self:PositionColumns()
|
||||
|
||||
list:SetSize(width, height)
|
||||
list:SetPos(0, 0)
|
||||
@ -340,7 +325,7 @@ function newobject:SetSize(width, height, r1, r2)
|
||||
self.height = height
|
||||
end
|
||||
|
||||
self:AdjustColumns()
|
||||
self:PositionColumns()
|
||||
|
||||
list:SetSize(width, height)
|
||||
list:SetPos(0, 0)
|
||||
@ -366,7 +351,7 @@ function newobject:SetWidth(width, relative)
|
||||
self.width = width
|
||||
end
|
||||
|
||||
self:AdjustColumns()
|
||||
self:PositionColumns()
|
||||
|
||||
list:SetSize(width)
|
||||
list:SetPos(0, 0)
|
||||
@ -392,7 +377,7 @@ function newobject:SetHeight(height, relative)
|
||||
self.height = height
|
||||
end
|
||||
|
||||
self:AdjustColumns()
|
||||
self:PositionColumns()
|
||||
|
||||
list:SetSize(height)
|
||||
list:SetPos(0, 0)
|
||||
@ -744,7 +729,7 @@ function newobject:SizeToChildren(max)
|
||||
end
|
||||
|
||||
self:SetSize(width, height)
|
||||
self:AdjustColumns()
|
||||
self:PositionColumns()
|
||||
return self
|
||||
|
||||
end
|
||||
|
@ -352,7 +352,7 @@ function newobject:AddRow(data)
|
||||
table.insert(self.children, loveframes.objects["columnlistrow"]:new(self, data))
|
||||
self:CalculateSize()
|
||||
self:RedoLayout()
|
||||
self.parent:AdjustColumns()
|
||||
self.parent:PositionColumns()
|
||||
|
||||
end
|
||||
|
||||
@ -411,7 +411,7 @@ function newobject:Clear()
|
||||
self.children = {}
|
||||
self:CalculateSize()
|
||||
self:RedoLayout()
|
||||
self.parent:AdjustColumns()
|
||||
self.parent:PositionColumns()
|
||||
self.rowcolorindex = 1
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user