mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 02:17:52 +02:00
Update annotations
This commit is contained in:
parent
9dd3a029ad
commit
48bd0da429
@ -39,7 +39,7 @@ end
|
||||
|
||||
--- Set checkbox group state
|
||||
-- @function checkbox_group:set_state
|
||||
-- @tparam bool[] state Array of checkbox state
|
||||
-- @tparam bool[] indexes Array of checkbox state
|
||||
function M.set_state(self, indexes)
|
||||
for i = 1, #indexes do
|
||||
if self.checkboxes[i] then
|
||||
|
@ -48,7 +48,7 @@ end
|
||||
|
||||
--- Set radio group state
|
||||
-- @function radio_group:set_state
|
||||
-- @tparam bool[] state Array of checkbox state
|
||||
-- @tparam number index Index in radio group
|
||||
function M.set_state(self, index)
|
||||
on_checkbox_click(self, index)
|
||||
end
|
||||
@ -56,7 +56,7 @@ end
|
||||
|
||||
--- Return radio group state
|
||||
-- @function radio_group:get_state
|
||||
-- @treturn bool[] Array if checkboxes state
|
||||
-- @treturn number Index in radio group
|
||||
function M.get_state(self)
|
||||
local result = -1
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
-- @table Events
|
||||
-- @tfield druid_event on_scroll On scroll move callback
|
||||
-- @tfield druid_event on_scroll_to On scroll_to function callback
|
||||
-- @tfield druid_event on_point_scroll On scroll_to_index function callbck
|
||||
-- @tfield druid_event on_point_scroll On scroll_to_index function callback
|
||||
|
||||
--- Component fields
|
||||
-- @table Fields
|
||||
|
@ -128,12 +128,27 @@ function Druid.create(self, component, ...)
|
||||
end
|
||||
|
||||
|
||||
--- Call on final function on gui_script. It will call on_remove
|
||||
-- on all druid components
|
||||
-- @function druid:final
|
||||
function Druid.final(self)
|
||||
local components = self.components[const.ALL]
|
||||
|
||||
for i = #components, 1, -1 do
|
||||
if components[i].on_remove then
|
||||
components[i]:on_remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Remove component from druid instance.
|
||||
-- Component `on_remove` function will be invoked, if exist.
|
||||
-- @function druid:remove
|
||||
-- @tparam Component component Component instance
|
||||
function Druid.remove(self, component)
|
||||
local all_components = self.components[const.ALL]
|
||||
|
||||
for i = #all_components, 1, -1 do
|
||||
if all_components[i] == component then
|
||||
if component.on_remove then
|
||||
@ -204,9 +219,11 @@ function Druid.on_message(self, message_id, message, sender)
|
||||
end
|
||||
end
|
||||
else
|
||||
local components = self.components[const.ON_MESSAGE] or const.EMPTY_TABLE
|
||||
for i = 1, #components do
|
||||
components[i]:on_message(message_id, message, sender)
|
||||
local components = self.components[const.ON_MESSAGE]
|
||||
if components then
|
||||
for i = 1, #components do
|
||||
components[i]:on_message(message_id, message, sender)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
BIN
media/scroll_outline.png
Normal file
BIN
media/scroll_outline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
media/scroll_scheme.png
Normal file
BIN
media/scroll_scheme.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Loading…
x
Reference in New Issue
Block a user