Add columnlist:SetColumnWidth

This commit is contained in:
Kenny Shields 2014-08-23 03:04:31 -04:00
parent f508625274
commit ac5818b102
2 changed files with 24 additions and 1 deletions

View File

@ -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

View File

@ -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