#128 element changes and show number after setting min/max for spinbox

This commit is contained in:
Mikayla Fischler 2022-11-17 12:00:00 -05:00
parent 9c32074b56
commit 29793ba7c4
3 changed files with 28 additions and 2 deletions

View File

@ -17,7 +17,7 @@ local config = require("coordinator.config")
local coordinator = require("coordinator.coordinator")
local renderer = require("coordinator.renderer")
local COORDINATOR_VERSION = "alpha-v0.6.14"
local COORDINATOR_VERSION = "alpha-v0.6.15"
local print = util.print
local println = util.println

View File

@ -178,6 +178,16 @@ function element.new(args)
function protected.set_value(value)
end
-- set minimum input value
---@param min integer minimum allowed value
function protected.set_min(min)
end
-- set maximum input value
---@param max integer maximum allowed value
function protected.set_max(max)
end
-- enable the control
function protected.enable()
end
@ -316,6 +326,18 @@ function element.new(args)
protected.set_value(value)
end
-- set minimum input value
---@param min integer minimum allowed value
function public.set_min(min)
protected.set_min(min)
end
-- set maximum input value
---@param max integer maximum allowed value
function public.set_max(max)
protected.set_max(max)
end
-- enable the element
function public.enable()
protected.enabled = true

View File

@ -150,13 +150,17 @@ local function spinbox(args)
-- set minimum input value
---@param min integer minimum allowed value
function e.set_min(min)
if min >= 0 then args.min = min end
if min >= 0 then
args.min = min
show_num()
end
end
-- set maximum input value
---@param max integer maximum allowed value
function e.set_max(max)
args.max = max
show_num()
end
return e.get()