mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Add columnlist:SetColumnResizeEnabled and columnlist:GetColumnResizeEnabled
This commit is contained in:
parent
d30dca3233
commit
b30b38f67b
@ -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
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user