|
|
@ -13,9 +13,9 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
function UISpinBox:onMouseWheel(mousePos, direction)
|
|
|
|
function UISpinBox:onMouseWheel(mousePos, direction)
|
|
|
|
if direction == MouseWheelUp then
|
|
|
|
if direction == MouseWheelUp then
|
|
|
|
self:setValue(self.value + 1)
|
|
|
|
self:up()
|
|
|
|
elseif direction == MouseWheelDown then
|
|
|
|
elseif direction == MouseWheelDown then
|
|
|
|
self:setValue(self.value - 1)
|
|
|
|
self:down()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -59,6 +59,14 @@ function UISpinBox:onStyleApply(styleName, styleNode)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function UISpinBox:up()
|
|
|
|
|
|
|
|
self:setValue(self.value + 1)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function UISpinBox:down()
|
|
|
|
|
|
|
|
self:setValue(self.value - 1)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function UISpinBox:setValue(value)
|
|
|
|
function UISpinBox:setValue(value)
|
|
|
|
value = math.max(math.min(self.maximum, value), self.minimum)
|
|
|
|
value = math.max(math.min(self.maximum, value), self.minimum)
|
|
|
|
if value == self.value then return end
|
|
|
|
if value == self.value then return end
|
|
|
|