mirror of
https://codeberg.org/1414codeforge/yui.git
synced 2025-06-05 22:19:11 +02:00
[*] add documentation
This commit is contained in:
21
slider.lua
21
slider.lua
@@ -1,3 +1,11 @@
|
||||
--- Implements a scrollable slider widget
|
||||
--
|
||||
-- @classmod yui.Slider
|
||||
-- @copyright 2022, The DoubleFourteen Code Forge
|
||||
-- @author Lorenzo Cogotti, Andrea Pasquini
|
||||
--
|
||||
--- Slider widget receives the following callbacks: @{yui.Widget.WidgetCallbacks|onEnter}(), @{yui.Widget.WidgetCallbacks|onChange}(), @{yui.Widget.WidgetCallbacks|onLeave}().
|
||||
|
||||
local BASE = (...):gsub('slider$', '')
|
||||
|
||||
local Widget = require(BASE..'widget')
|
||||
@@ -6,7 +14,20 @@ local core = require(BASE..'core')
|
||||
local Slider = setmetatable({}, Widget)
|
||||
Slider.__index = Slider
|
||||
|
||||
--- Attributes accepted by the @{Slider} widget beyond the standard @{yui.Widget.WidgetAttributes|attributes}
|
||||
-- and @{yui.Widget.WidgetCallbacks|callbacks}.
|
||||
--
|
||||
-- @field min (number) min value of the slider
|
||||
-- @field max (number) max value of the slider
|
||||
-- @field vertical (boolean) true for vertical slider, false or nil for horizontal slider
|
||||
-- @field value (number) default value
|
||||
-- @field step (number) number of slider's steps
|
||||
-- @field cornerRadius (number) radius for rounded corners
|
||||
-- @table SliderAttributes
|
||||
|
||||
|
||||
--- Slider constructor
|
||||
-- @param args (@{SliderAttributes}) widget attributes
|
||||
function Slider.new(args)
|
||||
local self = setmetatable(args, Slider)
|
||||
|
||||
|
Reference in New Issue
Block a user