diff --git a/changelog.txt b/changelog.txt index 45f1368..05bfd5f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,7 +11,7 @@ Version 0.9.9 - Alpha (Release Date TBD) [ADDED] toggle functionality to the button object [ADDED] resizing functinality to the columnlistheader object [ADDED] horizontal scrolling to the columnlist object -[ADDED] a new columnlistarea method: GetVerticalScrollBar() +[ADDED] a new columnlistarea method: GetVerticalScrollBody() [ADDED] a new columnlistarea method: GetHorizontalScrollBar() [ADDED] a new columnlist method: GetTotalColumnWidth() [ADDED] a new columnlist method: SetColumnWidth(id, width) diff --git a/objects/columnlist.lua b/objects/columnlist.lua index 2c9611a..508ec67 100644 --- a/objects/columnlist.lua +++ b/objects/columnlist.lua @@ -110,13 +110,13 @@ function newobject:draw() end local stencilfunc - local vbar = self.internals[1]:GetVerticalScrollBar() + local vbody = self.internals[1]:GetVerticalScrollBody() local hbar = self.internals[1]:GetHorizontalScrollBar() local width = self.width local height = self.height - if vbar then - width = width - vbar.width + if vbody then + width = width - vbody.width end if hbar then @@ -237,10 +237,10 @@ end function newobject:AdjustColumns() local width = self.width - local vbar = self.internals[1]:GetVerticalScrollBar() + local vbody = self.internals[1]:GetVerticalScrollBody() - if vbar then - width = width - self.internals[1].internals[1].width + if varea then + width = width - vbody.width end local children = self.children diff --git a/objects/internal/columnlist/columnlistarea.lua b/objects/internal/columnlist/columnlistarea.lua index 35ce377..45afbbd 100644 --- a/objects/internal/columnlist/columnlistarea.lua +++ b/objects/internal/columnlist/columnlistarea.lua @@ -110,7 +110,7 @@ function newobject:draw() local sheight = height if self.vbar then - swidth = swidth - self:GetVerticalScrollBar():GetWidth() + swidth = swidth - self:GetVerticalScrollBody():GetWidth() end if self.hbar then @@ -250,20 +250,20 @@ function newobject:CalculateSize() end else if self.vbar then - self:GetVerticalScrollBar():Remove() + self:GetVerticalScrollBody():Remove() self.vbar = false self.offsety = 0 end end local vbarwidth = 0 - local vbar = self:GetVerticalScrollBar() - if vbar then - vbarwidth = vbar.width + local vbody = self:GetVerticalScrollBody() + if vbody then + vbarwidth = vbody.width end if self.itemwidth > (width - vbarwidth) then - if vbar then + if vbody then self.itemwidth = self.itemwidth + vbarwidth end self.extrawidth = self.itemwidth - width @@ -299,18 +299,18 @@ function newobject:RedoLayout() v.staticx = 0 v.staticy = starty if self.vbar then - local vbar = self:GetVerticalScrollBar() - vbar.staticx = self.width - vbar.width + local vbody = self:GetVerticalScrollBody() + vbody.staticx = self.width - vbody.width if self.hbar then - vbar.height = self.height - self:GetHorizontalScrollBar().height + vbody.height = self.height - self:GetHorizontalScrollBar().height else - vbar.height = self.height + vbody.height = self.height end end if self.hbar then local hbar = self:GetHorizontalScrollBar() - if self.vbar then - hbar.width = self.width - self:GetVerticalScrollBar().width + if self.vbody then + hbar.width = self.width - self:GetVerticalScrollBody().width else hbar.width = self.width end @@ -409,10 +409,10 @@ function newobject:Clear() end --[[--------------------------------------------------------- - - func: GetVerticalScrollBar() - - desc: gets the object's vertical scrollbar + - func: GetVerticalScrollBody() + - desc: gets the object's vertical scroll area --]]--------------------------------------------------------- -function newobject:GetVerticalScrollBar() +function newobject:GetVerticalScrollBody() for k, v in ipairs(self.internals) do if v.bartype == "vertical" then diff --git a/objects/internal/columnlist/columnlistheader.lua b/objects/internal/columnlist/columnlistheader.lua index 7e94a1a..7d881e0 100644 --- a/objects/internal/columnlist/columnlistheader.lua +++ b/objects/internal/columnlist/columnlistheader.lua @@ -70,10 +70,10 @@ function newobject:update(dt) local update = self.Update local parent = self.parent local list = parent.internals[1] - local vbar = list:GetVerticalScrollBar() + local vbody = list:GetVerticalScrollBody() local width = list.width - if vbar then - width = width - vbar.width + if vbody then + width = width - vbody.width end self.clickbounds = {x = list.x, y = list.y, width = width, height = list.height}