mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
Update annotations: dynamic_grid, input, lang_text, progress, radio_roup, slider, timer
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
--- Radio group module
|
||||
-- @module druid.radio_group
|
||||
-- @module RadioGroup
|
||||
-- @within BaseComponent
|
||||
-- @alias druid.radio_group
|
||||
|
||||
--- Component events
|
||||
-- @table Events
|
||||
-- @tfield druid_event on_radio_click On any checkbox click
|
||||
--- On any checkbox click
|
||||
-- @tfield druid_event on_radio_click
|
||||
|
||||
--- Array of checkbox components
|
||||
-- @tfield Checkbox[] checkboxes
|
||||
|
||||
--- Component fields
|
||||
-- @table Fields
|
||||
-- @tfield table checkboxes Array of checkbox components
|
||||
|
||||
local Event = require("druid.event")
|
||||
local component = require("druid.component")
|
||||
@@ -27,11 +26,11 @@ end
|
||||
|
||||
|
||||
--- Component init function
|
||||
-- @function radio_group:init
|
||||
-- @tparam node[] node Array of gui node
|
||||
-- @tparam RadioGroup self
|
||||
-- @tparam node[] nodes Array of gui node
|
||||
-- @tparam function callback Radio callback
|
||||
-- @tparam[opt=node] node[] click node Array of trigger nodes, by default equals to nodes
|
||||
function RadioGroup:init(nodes, callback, click_nodes)
|
||||
-- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes
|
||||
function RadioGroup.init(self, nodes, callback, click_nodes)
|
||||
self.druid = self:get_druid()
|
||||
self.checkboxes = {}
|
||||
|
||||
@@ -49,17 +48,17 @@ end
|
||||
|
||||
|
||||
--- Set radio group state
|
||||
-- @function radio_group:set_state
|
||||
-- @tparam RadioGroup self
|
||||
-- @tparam number index Index in radio group
|
||||
function RadioGroup:set_state(index)
|
||||
function RadioGroup.set_state(self, index)
|
||||
on_checkbox_click(self, index)
|
||||
end
|
||||
|
||||
|
||||
--- Return radio group state
|
||||
-- @function radio_group:get_state
|
||||
-- @tparam RadioGroup self
|
||||
-- @treturn number Index in radio group
|
||||
function RadioGroup:get_state()
|
||||
function RadioGroup.get_state(self)
|
||||
local result = -1
|
||||
|
||||
for i = 1, #self.checkboxes do
|
||||
|
Reference in New Issue
Block a user