mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Fixed an issue with certain event callbacks
This commit is contained in:
parent
5fe9cdb806
commit
846f7cb60f
@ -280,9 +280,6 @@ function loveframes.debug.ExamplesMenu()
|
||||
list1:AddColumn("Column 2")
|
||||
list1:AddColumn("Column 3")
|
||||
list1:AddColumn("Column 4")
|
||||
list1.OnRowClicked = function(parent, row, rowdata)
|
||||
print(unpack(rowdata))
|
||||
end
|
||||
|
||||
for i=1, 20 do
|
||||
list1:AddRow("Row " ..i.. ", column 1", "Row " ..i.. ", column 2", "Row " ..i.. ", column 3", "Row " ..i.. ", column 4")
|
||||
|
@ -120,9 +120,11 @@ function button:mousereleased(x, y, button)
|
||||
|
||||
if hover == true and down == true and button == "l" and clickable == true then
|
||||
if enabled == true then
|
||||
if self.OnClick then
|
||||
self.OnClick(self, x, y)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.down = false
|
||||
|
||||
|
@ -75,6 +75,15 @@ function columnlistrow:draw()
|
||||
skin.DrawColumnListRow(self)
|
||||
end
|
||||
|
||||
local cwidth, cheight = self:GetParent():GetParent():GetColumnSize()
|
||||
local x = 5
|
||||
|
||||
for k, v in ipairs(self.columndata) do
|
||||
local height = self.font:getHeight("a")
|
||||
love.graphics.print(v, self.x + x, self.y + self.height/2 - height/2)
|
||||
x = x + cwidth
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
|
@ -71,8 +71,10 @@ function sliderbutton:update(dt)
|
||||
|
||||
if nvalue ~= pvalue then
|
||||
self.parent.value = loveframes.util.Round(nvalue, self.parent.decimals)
|
||||
if self.parent.OnValueChanged then
|
||||
self.parent.OnValueChanged(self.parent, self.parent.value)
|
||||
end
|
||||
end
|
||||
|
||||
if self.Update then
|
||||
self.Update(self, dt)
|
||||
|
@ -1166,15 +1166,6 @@ function skin.DrawColumnListRow(object)
|
||||
|
||||
end
|
||||
|
||||
local cwidth, cheight = self:GetParent():GetParent():GetColumnSize()
|
||||
local x = 5
|
||||
|
||||
for k, v in ipairs(self.columndata) do
|
||||
local height = self.font:getHeight("a")
|
||||
love.graphics.print(v, self.x + x, self.y + self.height/2 - height/2)
|
||||
x = x + cwidth
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- register the skin
|
||||
|
Loading…
Reference in New Issue
Block a user