#128 element changes and show number after setting min/max for spinbox
This commit is contained in:
@@ -17,7 +17,7 @@ local config = require("coordinator.config")
|
|||||||
local coordinator = require("coordinator.coordinator")
|
local coordinator = require("coordinator.coordinator")
|
||||||
local renderer = require("coordinator.renderer")
|
local renderer = require("coordinator.renderer")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "alpha-v0.6.14"
|
local COORDINATOR_VERSION = "alpha-v0.6.15"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
|||||||
@@ -178,6 +178,16 @@ function element.new(args)
|
|||||||
function protected.set_value(value)
|
function protected.set_value(value)
|
||||||
end
|
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
|
-- enable the control
|
||||||
function protected.enable()
|
function protected.enable()
|
||||||
end
|
end
|
||||||
@@ -316,6 +326,18 @@ function element.new(args)
|
|||||||
protected.set_value(value)
|
protected.set_value(value)
|
||||||
end
|
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
|
-- enable the element
|
||||||
function public.enable()
|
function public.enable()
|
||||||
protected.enabled = true
|
protected.enabled = true
|
||||||
|
|||||||
@@ -150,13 +150,17 @@ local function spinbox(args)
|
|||||||
-- set minimum input value
|
-- set minimum input value
|
||||||
---@param min integer minimum allowed value
|
---@param min integer minimum allowed value
|
||||||
function e.set_min(min)
|
function e.set_min(min)
|
||||||
if min >= 0 then args.min = min end
|
if min >= 0 then
|
||||||
|
args.min = min
|
||||||
|
show_num()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set maximum input value
|
-- set maximum input value
|
||||||
---@param max integer maximum allowed value
|
---@param max integer maximum allowed value
|
||||||
function e.set_max(max)
|
function e.set_max(max)
|
||||||
args.max = max
|
args.max = max
|
||||||
|
show_num()
|
||||||
end
|
end
|
||||||
|
|
||||||
return e.get()
|
return e.get()
|
||||||
|
|||||||
Reference in New Issue
Block a user