Add columnlist:SetColumnResizeEnabled and columnlist:GetColumnResizeEnabled

This commit is contained in:
Kenny Shields 2014-09-10 20:55:00 -04:00
parent d30dca3233
commit b30b38f67b
2 changed files with 25 additions and 1 deletions

View File

@ -25,6 +25,7 @@ function newobject:initialize()
self.selectionenabled = true self.selectionenabled = true
self.multiselect = false self.multiselect = false
self.startadjustment = false self.startadjustment = false
self.canresizecolumns = true
self.children = {} self.children = {}
self.internals = {} self.internals = {}
self.resizecolumn = nil self.resizecolumn = nil
@ -910,3 +911,26 @@ function newobject:GetDefaultColumnWidth()
return self.defaultcolumnwidth return self.defaultcolumnwidth
end end
--[[---------------------------------------------------------
- func: SetColumnResizeEnabled(bool)
- desc: sets whether or not the object's columns can
be resized
--]]---------------------------------------------------------
function newobject:SetColumnResizeEnabled(bool)
self.canresizecolumns = bool
return self
end
--[[---------------------------------------------------------
- func: GetColumnResizeEnabled()
- desc: gets whether or not the object's columns can
be resized
--]]---------------------------------------------------------
function newobject:GetColumnResizeEnabled()
return self.canresizecolumns
end

View File

@ -154,7 +154,7 @@ end
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:mousepressed(x, y, button) function newobject:mousepressed(x, y, button)
if not self.parent.resizecolumn then if not self.parent.resizecolumn and self.parent.canresizecolumns then
local box = self.resizebox local box = self.resizebox
local col = loveframes.util.BoundingBox(x, box.x, y, box.y, 1, box.width, 1, box.height) local col = loveframes.util.BoundingBox(x, box.x, y, box.y, 1, box.width, 1, box.height)
if col then if col then