From b30b38f67b26e2fc06995eb46e60fd0efde397f5 Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Wed, 10 Sep 2014 20:55:00 -0400 Subject: [PATCH] Add columnlist:SetColumnResizeEnabled and columnlist:GetColumnResizeEnabled --- objects/columnlist.lua | 24 +++++++++++++++++++ .../internal/columnlist/columnlistheader.lua | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/objects/columnlist.lua b/objects/columnlist.lua index 22221c7..614b022 100644 --- a/objects/columnlist.lua +++ b/objects/columnlist.lua @@ -25,6 +25,7 @@ function newobject:initialize() self.selectionenabled = true self.multiselect = false self.startadjustment = false + self.canresizecolumns = true self.children = {} self.internals = {} self.resizecolumn = nil @@ -909,4 +910,27 @@ function newobject:GetDefaultColumnWidth() return self.defaultcolumnwidth +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 \ No newline at end of file diff --git a/objects/internal/columnlist/columnlistheader.lua b/objects/internal/columnlist/columnlistheader.lua index 2d9e846..829f0e8 100644 --- a/objects/internal/columnlist/columnlistheader.lua +++ b/objects/internal/columnlist/columnlistheader.lua @@ -154,7 +154,7 @@ end --]]--------------------------------------------------------- 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 col = loveframes.util.BoundingBox(x, box.x, y, box.y, 1, box.width, 1, box.height) if col then