Version 0.9.1.6 - Alpha (see changelog.txt)

This commit is contained in:
Kenny Shields 2012-05-17 06:40:29 -04:00
parent 8dec80ae63
commit 834b7a1d48
8 changed files with 118 additions and 18 deletions

View File

@ -1,3 +1,17 @@
================================================
Version 0.9.1.6 - Alpha (May 17 - 2012)
================================================
[ADDED] a new column list method: Clear()
[ADDED] a new column list method: SetAutoScroll(bool)
[ADDED] "autoscroll" property for the column list object
[ADDED] a new column list area method: Clear()
[ADDED] a new skin function: DrawOverTextInput()
[FIXED] not being able to move the column list object's scrollbar by clicking on it's scroll area
[FIXED] column list rows color indexs becoming disorderd when the list was sorted via a column list header
[CHANGED] a few minor things in the default skins
================================================
Version 0.9.1.5 - Alpha (May 16 - 2012)
================================================

View File

@ -9,7 +9,7 @@ loveframes = {}
-- library info
loveframes.info = {}
loveframes.info.author = "Nikolai Resokav"
loveframes.info.version = "0.9.1.5"
loveframes.info.version = "0.9.1.6"
loveframes.info.stage = "Alpha"
-- library configurations

View File

@ -16,6 +16,7 @@ function columnlist:initialize()
self.type = "columnlist"
self.width = 300
self.height = 100
self.autoscroll = false
self.internal = false
self.children = {}
self.internals = {}
@ -289,3 +290,29 @@ function columnlist:SetMaxColorIndex(num)
self.internals[1].colorindexmax = num
end
--[[---------------------------------------------------------
- func: Clear()
- desc: removes all items from the object's list
--]]---------------------------------------------------------
function columnlist:Clear()
self.internals[1]:Clear()
end
--[[---------------------------------------------------------
- func: SetAutoScroll(bool)
- desc: sets whether or not the list's scrollbar should
auto scroll to the bottom when a new object is
added to the list
--]]---------------------------------------------------------
function columnlist:SetAutoScroll(bool)
self.autoscroll = bool
if self.internals[1]:GetScrollBar() ~= false then
self.internals[1]:GetScrollBar().autoscroll = bool
end
end

View File

@ -14,6 +14,7 @@ columnlistarea:include(loveframes.templates.default)
function columnlistarea:initialize(parent)
self.type = "columnlistarea"
self.display = "vertical"
self.parent = parent
self.width = 80
self.height = 25
@ -208,6 +209,7 @@ function columnlistarea:CalculateSize()
if bar == false then
table.insert(self.internals, scrollbody:new(self, "vertical"))
self.bar = true
self:GetScrollBar().autoscroll = self.parent.autoscroll
end
else
@ -261,6 +263,10 @@ function columnlistarea:RedoLayout()
end
--[[---------------------------------------------------------
- func: AddRow(data)
- desc: adds a row to the object
--]]---------------------------------------------------------
function columnlistarea:AddRow(data)
local row = columnlistrow:new(self, data)
@ -287,7 +293,17 @@ end
--]]---------------------------------------------------------
function columnlistarea:GetScrollBar()
return self.internals[1].internals[1].internals[1]
if self.bar ~= false then
local scrollbar = self.internals[1].internals[1].internals[1]
return scrollbar
else
return false
end
end
@ -297,6 +313,10 @@ end
--]]---------------------------------------------------------
function columnlistarea:Sort(column, desc)
self.rowcolorindex = 1
local colorindexmax = self.rowcolorindexmax
table.sort(self.children, function(a, b)
if desc then
return a.columndata[column] < b.columndata[column]
@ -305,7 +325,34 @@ function columnlistarea:Sort(column, desc)
end
end)
for k, v in ipairs(self.children) do
local colorindex = self.rowcolorindex
v.colorindex = colorindex
if colorindex == colorindexmax then
self.rowcolorindex = 1
else
self.rowcolorindex = colorindex + 1
end
end
self:CalculateSize()
self:RedoLayout()
end
--[[---------------------------------------------------------
- func: Clear()
- desc: removes all items from the object's list
--]]---------------------------------------------------------
function columnlistarea:Clear()
self.children = {}
self:CalculateSize()
self:RedoLayout()
self.parent:AdjustColumns()
end

View File

@ -527,4 +527,8 @@ function list:SetAutoScroll(bool)
self.autoscroll = bool
if self:GetScrollBar() ~= false then
self:GetScrollBar().autoscroll = bool
end
end

View File

@ -113,6 +113,10 @@ function textinput:draw()
love.graphics.setStencil()
if self.Draw == nil then
skin.DrawOverTextInput(self)
end
end
--[[---------------------------------------------------------

View File

@ -762,7 +762,7 @@ end
function skin.DrawOverMultiChoiceList(object)
love.graphics.setColor(unpack(skin.controls.multichoicelist_border_color))
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight(), true)
end
@ -808,12 +808,6 @@ end
--]]---------------------------------------------------------
function skin.DrawText(object)
--love.graphics.setColor(0, 0, 0, 255)
--love.graphics.rectangle("fill", object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
--love.graphics.setFont(object.font)
--love.graphics.setColor(255, 255, 255, 255)
--love.graphics.print(object.text, object:GetX(), object:GetY())
end
--[[---------------------------------------------------------
@ -850,6 +844,14 @@ function skin.DrawTextInput(object)
end
end
--[[---------------------------------------------------------
- func: DrawOverTextInput(object)
- desc: draws over the text input object
--]]---------------------------------------------------------
function skin.DrawOverTextInput(object)
love.graphics.setColor(unpack(skin.controls.textinput_border_color))
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
@ -1170,7 +1172,7 @@ end
function skin.DrawOverColumnListArea(object)
love.graphics.setColor(unpack(skin.controls.columnlist_border_color))
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight(), true, false, true, true)
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
end

View File

@ -763,7 +763,7 @@ end
function skin.DrawOverMultiChoiceList(object)
love.graphics.setColor(unpack(skin.controls.multichoicelist_border_color))
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight(), true)
end
@ -809,12 +809,6 @@ end
--]]---------------------------------------------------------
function skin.DrawText(object)
--love.graphics.setColor(0, 0, 0, 255)
--love.graphics.rectangle("fill", object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
--love.graphics.setFont(object.font)
--love.graphics.setColor(255, 255, 255, 255)
--love.graphics.print(object.text, object:GetX(), object:GetY())
end
--[[---------------------------------------------------------
@ -851,6 +845,14 @@ function skin.DrawTextInput(object)
end
end
--[[---------------------------------------------------------
- func: DrawOverTextInput(object)
- desc: draws over the text input object
--]]---------------------------------------------------------
function skin.DrawOverTextInput(object)
love.graphics.setColor(unpack(skin.controls.textinput_border_color))
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
@ -1171,7 +1173,7 @@ end
function skin.DrawOverColumnListArea(object)
love.graphics.setColor(unpack(skin.controls.columnlist_border_color))
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight(), true, false, true, true)
skin.OutlinedRectangle(object:GetX(), object:GetY(), object:GetWidth(), object:GetHeight())
end