From 8ee4ba4a74081178513c11f56fd0a8ed0e45379b Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Sat, 23 Aug 2014 21:17:09 -0400 Subject: [PATCH] Add columnlist:SetDefaultColumnWidth and columnlist:GetDefaultColumnWidth --- objects/columnlist.lua | 22 +++++++++++++++++++ .../internal/columnlist/columnlistheader.lua | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/objects/columnlist.lua b/objects/columnlist.lua index 9a0b101..b0ed59f 100644 --- a/objects/columnlist.lua +++ b/objects/columnlist.lua @@ -15,6 +15,7 @@ function newobject:initialize() self.type = "columnlist" self.width = 300 self.height = 100 + self.defaultcolumnwidth = 100 self.columnheight = 16 self.buttonscrollamount = 200 self.mousewheelscrollamount = 1500 @@ -885,4 +886,25 @@ function newobject:ResizeColumns() self.internals[1]:RedoLayout() end +end + +--[[--------------------------------------------------------- + - func: SetDefaultColumnWidth(width) + - desc: sets the object's default column width +--]]--------------------------------------------------------- +function newobject:SetDefaultColumnWidth(width) + + self.defaultcolumnwidth = width + return self + +end + +--[[--------------------------------------------------------- + - func: GetDefaultColumnWidth() + - desc: gets the object's default column width +--]]--------------------------------------------------------- +function newobject:GetDefaultColumnWidth() + + return self.defaultcolumnwidth + end \ No newline at end of file diff --git a/objects/internal/columnlist/columnlistheader.lua b/objects/internal/columnlist/columnlistheader.lua index 7d881e0..2d9e846 100644 --- a/objects/internal/columnlist/columnlistheader.lua +++ b/objects/internal/columnlist/columnlistheader.lua @@ -16,7 +16,7 @@ function newobject:initialize(name, parent) self.parent = parent self.name = name self.state = parent.state - self.width = 80 + self.width = parent.defaultcolumnwidth self.height = parent.columnheight self.columnid = 0 self.hover = false