diff --git a/coordinator/startup.lua b/coordinator/startup.lua index 9564160..bdb0a17 100644 --- a/coordinator/startup.lua +++ b/coordinator/startup.lua @@ -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 diff --git a/graphics/element.lua b/graphics/element.lua index 33decff..d987a7a 100644 --- a/graphics/element.lua +++ b/graphics/element.lua @@ -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 diff --git a/graphics/elements/controls/spinbox_numeric.lua b/graphics/elements/controls/spinbox_numeric.lua index 10f74bd..3bce169 100644 --- a/graphics/elements/controls/spinbox_numeric.lua +++ b/graphics/elements/controls/spinbox_numeric.lua @@ -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()