From 6bbdde17a83a38ce50020a34b6ff4b89d6cebb06 Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Tue, 5 Mar 2013 14:46:01 -0500 Subject: [PATCH] Version 0.9.5.4 - Alpha (see changelog.txt) --- changelog.txt | 9 +++++++++ init.lua | 2 +- objects/list.lua | 7 ++++--- objects/multichoice.lua | 30 +++++++++++++++++++++++++++++- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index b4398e8..69ea1ed 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +================================================ +Version 0.9.5.4 - Alpha (March 5 - 2013) +================================================ +[ADDED] a new multichoice method: RemoveChoice(choice) +[ADDED] a new multichoice method: Clear() + +[FIXED] a bug with list:RemoveItem that would cause an error when providing an argument that wasn't a number +[FIXED] the list object not resizing correctly when using list:RemoveItem and providing a number as an argument + ================================================ Version 0.9.5.3 - Alpha (February 25 - 2013) ================================================ diff --git a/init.lua b/init.lua index 26be26a..89f109e 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ loveframes = {} -- library info loveframes.info = {} loveframes.info.author = "Kenny Shields" -loveframes.info.version = "0.9.5.3" +loveframes.info.version = "0.9.5.4" loveframes.info.stage = "Alpha" -- library configurations diff --git a/objects/list.lua b/objects/list.lua index a251a5e..f03834f 100644 --- a/objects/list.lua +++ b/objects/list.lua @@ -279,11 +279,12 @@ function newobject:RemoveItem(data) item:Remove() end else - object:Remove() - self:CalculateSize() - self:RedoLayout() + data:Remove() end + self:CalculateSize() + self:RedoLayout() + end --[[--------------------------------------------------------- diff --git a/objects/multichoice.lua b/objects/multichoice.lua index deade7d..75196ef 100644 --- a/objects/multichoice.lua +++ b/objects/multichoice.lua @@ -176,6 +176,24 @@ function newobject:AddChoice(choice) end +--[[--------------------------------------------------------- + - func: RemoveChoice(choice) + - desc: removes the specified choice from the object's + list of choices +--]]--------------------------------------------------------- +function newobject:RemoveChoice(choice) + + local choices = self.choices + + for k, v in ipairs(choices) do + if v == choice then + table.remove(choices, k) + break + end + end + +end + --[[--------------------------------------------------------- - func: SetChoice(choice) - desc: sets the current choice @@ -372,4 +390,14 @@ function newobject:GetSortFunction() return self.sortfunc end - \ No newline at end of file + +--[[--------------------------------------------------------- + - func: Clear() + - desc: removes all choices from the object's list + of choices +--]]--------------------------------------------------------- +function newobject:Clear() + + self.choices = {} + +end \ No newline at end of file