mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Annotations update [4]
This commit is contained in:
parent
c99b97f392
commit
24bb39481d
@ -598,7 +598,7 @@ self:set_nodes(nodes)</pre>
|
|||||||
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
<a href="../modules/BaseComponent.html#">BaseComponent</a>
|
||||||
</li>
|
</li>
|
||||||
<li><span class="parameter">druid_style</span>
|
<li><span class="parameter">druid_style</span>
|
||||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a> or <span class="type">nil</span></span>
|
||||||
Druid style module
|
Druid style module
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
<td class="summary">Return side vector to correct node shifting</td>
|
<td class="summary">Return side vector to correct node shifting</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap><a href="#add">add(self, node, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</a></td>
|
<td class="name" nowrap><a href="#add">add(self, node, index, shift_policy, is_instant)</a></td>
|
||||||
<td class="summary">Add new node to the grid</td>
|
<td class="summary">Add new node to the grid</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -122,7 +122,7 @@
|
|||||||
<td class="summary">The <a href="../modules/DynamicGrid.html#">DynamicGrid</a> constructor</td>
|
<td class="summary">The <a href="../modules/DynamicGrid.html#">DynamicGrid</a> constructor</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="name" nowrap><a href="#remove">remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</a></td>
|
<td class="name" nowrap><a href="#remove">remove(self, index, shift_policy, is_instant)</a></td>
|
||||||
<td class="summary">Remove the item from the grid.</td>
|
<td class="summary">Remove the item from the grid.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -213,7 +213,7 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>
|
<dt>
|
||||||
<a name = "add"></a>
|
<a name = "add"></a>
|
||||||
<strong>add(self, node, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</strong>
|
<strong>add(self, node, index, shift_policy, is_instant)</strong>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
Add new node to the grid
|
Add new node to the grid
|
||||||
@ -234,14 +234,12 @@
|
|||||||
The node position. By default add as last node
|
The node position. By default add as last node
|
||||||
</li>
|
</li>
|
||||||
<li><span class="parameter">shift_policy</span>
|
<li><span class="parameter">shift_policy</span>
|
||||||
<span class="types"><span class="type">number</span></span>
|
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
|
||||||
How shift nodes, if required. See const.SHIFT
|
How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||||
(<em>default</em> SHIFT.RIGHT)
|
|
||||||
</li>
|
</li>
|
||||||
<li><span class="parameter">is_instant</span>
|
<li><span class="parameter">is_instant</span>
|
||||||
<span class="types"><span class="type">boolean</span></span>
|
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
|
||||||
If true, update node positions instantly
|
If true, update node positions instantly
|
||||||
(<em>default</em> false)
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -487,7 +485,7 @@
|
|||||||
</dd>
|
</dd>
|
||||||
<dt>
|
<dt>
|
||||||
<a name = "remove"></a>
|
<a name = "remove"></a>
|
||||||
<strong>remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</strong>
|
<strong>remove(self, index, shift_policy, is_instant)</strong>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
Remove the item from the grid. Note that gui node will be not deleted
|
Remove the item from the grid. Note that gui node will be not deleted
|
||||||
@ -504,14 +502,12 @@
|
|||||||
The grid node index to remove
|
The grid node index to remove
|
||||||
</li>
|
</li>
|
||||||
<li><span class="parameter">shift_policy</span>
|
<li><span class="parameter">shift_policy</span>
|
||||||
<span class="types"><span class="type">number</span></span>
|
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
|
||||||
How shift nodes, if required. See const.SHIFT
|
How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||||
(<em>default</em> SHIFT.RIGHT)
|
|
||||||
</li>
|
</li>
|
||||||
<li><span class="parameter">is_instant</span>
|
<li><span class="parameter">is_instant</span>
|
||||||
<span class="types"><span class="type">boolean</span></span>
|
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
|
||||||
If true, update node positions instantly
|
If true, update node positions instantly
|
||||||
(<em>default</em> false)
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -109,6 +109,10 @@
|
|||||||
<td class="name" nowrap><a href="#placeholder">placeholder</a></td>
|
<td class="name" nowrap><a href="#placeholder">placeholder</a></td>
|
||||||
<td class="summary">On input field text change to max length string callback(self, input_text)</td>
|
<td class="summary">On input field text change to max length string callback(self, input_text)</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="name" nowrap><a href="#root">root</a></td>
|
||||||
|
<td class="summary">Root node</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
@ -162,7 +166,7 @@
|
|||||||
<a href="../modules/RichInput.html#">RichInput</a>
|
<a href="../modules/RichInput.html#">RichInput</a>
|
||||||
</li>
|
</li>
|
||||||
<li><span class="parameter">placeholder_text</span>
|
<li><span class="parameter">placeholder_text</span>
|
||||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
|
||||||
The placeholder text
|
The placeholder text
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -255,6 +259,26 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
<dt>
|
||||||
|
<a name = "root"></a>
|
||||||
|
<strong>root</strong>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
Root node
|
||||||
|
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><span class="parameter">root</span>
|
||||||
|
<span class="types"><span class="type">node</span></span>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ function druid__base_component.set_nodes(self, nodes) end
|
|||||||
--- Set current component style table.
|
--- Set current component style table.
|
||||||
--- Invoke `on_style_change` on component, if exist. Component should handle their style changing and store all style params
|
--- Invoke `on_style_change` on component, if exist. Component should handle their style changing and store all style params
|
||||||
---@param self druid.base_component @{BaseComponent}
|
---@param self druid.base_component @{BaseComponent}
|
||||||
---@param druid_style table Druid style module
|
---@param druid_style table|nil Druid style module
|
||||||
---@return druid.base_component @{BaseComponent}
|
---@return druid.base_component @{BaseComponent}
|
||||||
function druid__base_component.set_style(self, druid_style) end
|
function druid__base_component.set_style(self, druid_style) end
|
||||||
|
|
||||||
@ -451,8 +451,8 @@ function druid__dynamic_grid._get_side_vector(self, side, is_forward) end
|
|||||||
---@param self druid.dynamic_grid @{DynamicGrid}
|
---@param self druid.dynamic_grid @{DynamicGrid}
|
||||||
---@param node node Gui node
|
---@param node node Gui node
|
||||||
---@param index number|nil The node position. By default add as last node
|
---@param index number|nil The node position. By default add as last node
|
||||||
---@param shift_policy number How shift nodes, if required. See const.SHIFT
|
---@param shift_policy number|nil How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||||
---@param is_instant boolean If true, update node positions instantly
|
---@param is_instant boolean|nil If true, update node positions instantly
|
||||||
function druid__dynamic_grid.add(self, node, index, shift_policy, is_instant) end
|
function druid__dynamic_grid.add(self, node, index, shift_policy, is_instant) end
|
||||||
|
|
||||||
--- Clear grid nodes array.
|
--- Clear grid nodes array.
|
||||||
@ -505,8 +505,8 @@ function druid__dynamic_grid.init(self, parent) end
|
|||||||
--- Note that gui node will be not deleted
|
--- Note that gui node will be not deleted
|
||||||
---@param self druid.dynamic_grid @{DynamicGrid}
|
---@param self druid.dynamic_grid @{DynamicGrid}
|
||||||
---@param index number The grid node index to remove
|
---@param index number The grid node index to remove
|
||||||
---@param shift_policy number How shift nodes, if required. See const.SHIFT
|
---@param shift_policy number|nil How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||||
---@param is_instant boolean If true, update node positions instantly
|
---@param is_instant boolean|nil If true, update node positions instantly
|
||||||
---@return node The deleted gui node from grid
|
---@return node The deleted gui node from grid
|
||||||
function druid__dynamic_grid.remove(self, index, shift_policy, is_instant) end
|
function druid__dynamic_grid.remove(self, index, shift_policy, is_instant) end
|
||||||
|
|
||||||
@ -933,6 +933,7 @@ function druid__radio_group.set_state(self, index, is_instant) end
|
|||||||
---@field druid druid_instance The component druid instance
|
---@field druid druid_instance The component druid instance
|
||||||
---@field input druid.input On input field text change callback(self, input_text)
|
---@field input druid.input On input field text change callback(self, input_text)
|
||||||
---@field placeholder druid.text On input field text change to max length string callback(self, input_text)
|
---@field placeholder druid.text On input field text change to max length string callback(self, input_text)
|
||||||
|
---@field root node Root node
|
||||||
local druid__rich_input = {}
|
local druid__rich_input = {}
|
||||||
|
|
||||||
--- The @{RichInput} constructor
|
--- The @{RichInput} constructor
|
||||||
@ -943,7 +944,7 @@ function druid__rich_input.init(self, template, nodes) end
|
|||||||
|
|
||||||
--- Set placeholder text
|
--- Set placeholder text
|
||||||
---@param self druid.rich_input @{RichInput}
|
---@param self druid.rich_input @{RichInput}
|
||||||
---@param placeholder_text string The placeholder text
|
---@param placeholder_text string|nil The placeholder text
|
||||||
function druid__rich_input.set_placeholder(self, placeholder_text) end
|
function druid__rich_input.set_placeholder(self, placeholder_text) end
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ end
|
|||||||
-- Invoke `on_style_change` on component, if exist. Component should handle
|
-- Invoke `on_style_change` on component, if exist. Component should handle
|
||||||
-- their style changing and store all style params
|
-- their style changing and store all style params
|
||||||
-- @tparam BaseComponent self @{BaseComponent}
|
-- @tparam BaseComponent self @{BaseComponent}
|
||||||
-- @tparam table druid_style Druid style module
|
-- @tparam table|nil druid_style Druid style module
|
||||||
-- @treturn BaseComponent @{BaseComponent}
|
-- @treturn BaseComponent @{BaseComponent}
|
||||||
function BaseComponent.set_style(self, druid_style)
|
function BaseComponent.set_style(self, druid_style)
|
||||||
self._meta.style = druid_style or {}
|
self._meta.style = druid_style or {}
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
--- The component druid instance
|
--- The component druid instance
|
||||||
-- @tfield DruidInstance druid @{DruidInstance}
|
-- @tfield DruidInstance druid @{DruidInstance}
|
||||||
|
|
||||||
|
--- Root node
|
||||||
|
-- @tfield node root
|
||||||
|
|
||||||
--- On input field text change callback(self, input_text)
|
--- On input field text change callback(self, input_text)
|
||||||
-- @tfield Input input @{Input}
|
-- @tfield Input input @{Input}
|
||||||
|
|
||||||
@ -69,6 +72,8 @@ function RichInput.init(self, template, nodes)
|
|||||||
self:set_template(template)
|
self:set_template(template)
|
||||||
self:set_nodes(nodes)
|
self:set_nodes(nodes)
|
||||||
self.druid = self:get_druid()
|
self.druid = self:get_druid()
|
||||||
|
self.root = self:get_node(SCHEME.ROOT)
|
||||||
|
|
||||||
self.input = self.druid:new_input(self:get_node(SCHEME.BUTTON), self:get_node(SCHEME.INPUT))
|
self.input = self.druid:new_input(self:get_node(SCHEME.BUTTON), self:get_node(SCHEME.INPUT))
|
||||||
self.cursor = self:get_node(SCHEME.CURSOR)
|
self.cursor = self:get_node(SCHEME.CURSOR)
|
||||||
|
|
||||||
@ -85,7 +90,7 @@ end
|
|||||||
|
|
||||||
--- Set placeholder text
|
--- Set placeholder text
|
||||||
-- @tparam RichInput self @{RichInput}
|
-- @tparam RichInput self @{RichInput}
|
||||||
-- @tparam string placeholder_text The placeholder text
|
-- @tparam string|nil placeholder_text The placeholder text
|
||||||
function RichInput.set_placeholder(self, placeholder_text)
|
function RichInput.set_placeholder(self, placeholder_text)
|
||||||
self.placeholder:set_to(placeholder_text)
|
self.placeholder:set_to(placeholder_text)
|
||||||
return self
|
return self
|
||||||
|
@ -141,8 +141,8 @@ end
|
|||||||
-- @tparam DynamicGrid self @{DynamicGrid}
|
-- @tparam DynamicGrid self @{DynamicGrid}
|
||||||
-- @tparam node node Gui node
|
-- @tparam node node Gui node
|
||||||
-- @tparam number|nil index The node position. By default add as last node
|
-- @tparam number|nil index The node position. By default add as last node
|
||||||
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
|
-- @tparam number|nil shift_policy How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||||
-- @tparam[opt=false] boolean is_instant If true, update node positions instantly
|
-- @tparam boolean|nil is_instant If true, update node positions instantly
|
||||||
function DynamicGrid.add(self, node, index, shift_policy, is_instant)
|
function DynamicGrid.add(self, node, index, shift_policy, is_instant)
|
||||||
shift_policy = shift_policy or const.SHIFT.RIGHT
|
shift_policy = shift_policy or const.SHIFT.RIGHT
|
||||||
local delta = shift_policy -- -1 or 1 or 0
|
local delta = shift_policy -- -1 or 1 or 0
|
||||||
@ -183,8 +183,8 @@ end
|
|||||||
--- Remove the item from the grid. Note that gui node will be not deleted
|
--- Remove the item from the grid. Note that gui node will be not deleted
|
||||||
-- @tparam DynamicGrid self @{DynamicGrid}
|
-- @tparam DynamicGrid self @{DynamicGrid}
|
||||||
-- @tparam number index The grid node index to remove
|
-- @tparam number index The grid node index to remove
|
||||||
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
|
-- @tparam number|nil shift_policy How shift nodes, if required. Default: const.SHIFT.RIGHT
|
||||||
-- @tparam[opt=false] boolean is_instant If true, update node positions instantly
|
-- @tparam boolean|nil is_instant If true, update node positions instantly
|
||||||
-- @treturn node The deleted gui node from grid
|
-- @treturn node The deleted gui node from grid
|
||||||
function DynamicGrid.remove(self, index, shift_policy, is_instant)
|
function DynamicGrid.remove(self, index, shift_policy, is_instant)
|
||||||
shift_policy = shift_policy or const.SHIFT.RIGHT
|
shift_policy = shift_policy or const.SHIFT.RIGHT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user