This commit is contained in:
BeniS
2013-02-01 14:21:20 +13:00
parent e7012031eb
commit 469df27d9b
2 changed files with 24 additions and 4 deletions

View File

@@ -591,12 +591,24 @@ function moveStackableItem(item, toPos)
spinbox:setValue(0)
spinbox:hideButtons()
spinbox:focus()
spinbox.firstEdit = true
local spinBoxValueChange = function(self, value)
scrollbar:setValue(value)
end
spinbox.onValueChange = spinBoxValueChange
local check = function()
if spinbox.firstEdit then
spinbox:setValue(spinbox:getMaximum())
spinbox.firstEdit = false
end
end
g_keyboard.bindKeyPress("Up", function() check() spinbox:up() end, spinbox)
g_keyboard.bindKeyPress("Down", function() check() spinbox:down() end, spinbox)
g_keyboard.bindKeyPress("PageUp", function() check() spinbox:setValue(spinbox:getValue()+10) end, spinbox)
g_keyboard.bindKeyPress("PageDown", function() check() spinbox:setValue(spinbox:getValue()-10) end, spinbox)
scrollbar.onValueChange = function(self, value)
itembox:setItemCount(value)
spinbox.onValueChange = nil