mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Add columnlist:SetColumnWidth
This commit is contained in:
parent
f508625274
commit
ac5818b102
@ -14,6 +14,7 @@ Version 0.9.9 - Alpha (Release Date TBD)
|
||||
[ADDED] a new columnlistarea method: GetVerticalScrollBar()
|
||||
[ADDED] a new columnlistarea method: GetHorizontalScrollBar()
|
||||
[ADDED] a new columnlist method: GetTotalColumnWidth()
|
||||
[ADDED] a new columnlist method: SetColumnWidth(id, width)
|
||||
[ADDED] a new columnlist method: GetColumnWidth(id)
|
||||
|
||||
[FIXED] bug that would cause tabbuttons to be positioned incorrectly when scrolling with the mouse wheel
|
||||
|
@ -825,7 +825,7 @@ end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: GetTotalColumnWidth()
|
||||
- desc: gets the combined width of the objects columns
|
||||
- desc: gets the combined width of the object's columns
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:GetTotalColumnWidth()
|
||||
|
||||
@ -839,6 +839,28 @@ function newobject:GetTotalColumnWidth()
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: SetColumnWidth(id, width)
|
||||
- desc: sets the width of the specified column
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:SetColumnWidth(id, width)
|
||||
|
||||
local column = self.children[id]
|
||||
if column then
|
||||
column.width = width
|
||||
local x = 0
|
||||
for k, v in ipairs(self.children) do
|
||||
v:SetPos(x)
|
||||
x = x + v.width
|
||||
end
|
||||
self.internals[1]:CalculateSize()
|
||||
self.internals[1]:RedoLayout()
|
||||
end
|
||||
|
||||
return self
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: GetColumnWidth(id)
|
||||
- desc: gets the width of the specified column
|
||||
|
Loading…
Reference in New Issue
Block a user