graphics elements comments

This commit is contained in:
Mikayla Fischler 2022-09-12 15:58:43 -04:00
parent 1bf21564f9
commit 70d9da847e
7 changed files with 16 additions and 0 deletions

View File

@ -92,6 +92,8 @@ local function data(args)
end end
end end
-- set the value
---@param val any new value
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
-- initial value draw -- initial value draw

View File

@ -41,6 +41,7 @@ local function hbar(args)
end end
-- handle data changes -- handle data changes
---@param fraction number 0.0 to 1.0
function e.on_update(fraction) function e.on_update(fraction)
e.value = fraction e.value = fraction
@ -109,6 +110,8 @@ local function hbar(args)
e.on_update(e.value) e.on_update(e.value)
end end
-- set the percentage value
---@param val number 0.0 to 1.0
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
-- initialize to 0 -- initialize to 0

View File

@ -60,6 +60,8 @@ local function icon(args)
e.window.blit(blit_cmd.text, blit_cmd.fgd, blit_cmd.bkg) e.window.blit(blit_cmd.text, blit_cmd.fgd, blit_cmd.bkg)
end end
-- set indicator state
---@param val integer indicator state
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
-- initial icon draw -- initial icon draw

View File

@ -40,6 +40,8 @@ local function indicator_light(args)
end end
end end
-- set indicator state
---@param val boolean indicator state
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
-- write label and initial indicator light -- write label and initial indicator light

View File

@ -66,6 +66,8 @@ local function state_indicator(args)
e.window.blit(blit_cmd.text, blit_cmd.fgd, blit_cmd.bkg) e.window.blit(blit_cmd.text, blit_cmd.fgd, blit_cmd.bkg)
end end
-- set indicator state
---@param val integer indicator state
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
-- initial draw -- initial draw

View File

@ -51,6 +51,8 @@ local function tristate_indicator_light(args)
end end
end end
-- set indicator state
---@param val integer indicator state
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
-- write label and initial indicator light -- write label and initial indicator light

View File

@ -32,6 +32,7 @@ local function vbar(args)
local two_thirds = util.strrep("\x83", e.frame.w) local two_thirds = util.strrep("\x83", e.frame.w)
-- handle data changes -- handle data changes
---@param fraction number 0.0 to 1.0
function e.on_update(fraction) function e.on_update(fraction)
e.value = fraction e.value = fraction
@ -91,6 +92,8 @@ local function vbar(args)
e.on_update(e.value) e.on_update(e.value)
end end
-- set the percentage value
---@param val number 0.0 to 1.0
function e.set_value(val) e.on_update(val) end function e.set_value(val) e.on_update(val) end
return e.get() return e.get()