mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update properties API docs
This commit is contained in:
150
api/components/widgets/properties_panel/property_slider_api.md
Normal file
150
api/components/widgets/properties_panel/property_slider_api.md
Normal file
@@ -0,0 +1,150 @@
|
||||
# druid.widget.property_slider API
|
||||
|
||||
> at /druid/widget/properties_panel/properties/property_slider.lua
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text_function](#set_text_function)
|
||||
- [set_text_property](#set_text_property)
|
||||
- [on_change](#on_change)
|
||||
- [set_value](#set_value)
|
||||
- [get_value](#get_value)
|
||||
- [update_value](#update_value)
|
||||
- [set_number_type](#set_number_type)
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [container](#container)
|
||||
- [druid](#druid)
|
||||
- [text_name](#text_name)
|
||||
- [text_value](#text_value)
|
||||
- [slider](#slider)
|
||||
- [on_change_value](#on_change_value)
|
||||
- [selected](#selected)
|
||||
- [min](#min)
|
||||
- [max](#max)
|
||||
- [step](#step)
|
||||
|
||||
|
||||
|
||||
### init
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:init()
|
||||
```
|
||||
|
||||
### set_text_function
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_text_function(callback)
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(fun(value: number):string)*:
|
||||
|
||||
### set_text_property
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_text_property(text)
|
||||
```
|
||||
|
||||
Sets the text property of the slider
|
||||
|
||||
- **Parameters:**
|
||||
- `text` *(string)*:
|
||||
|
||||
### on_change
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:on_change(callback)
|
||||
```
|
||||
|
||||
Sets the callback function for when the slider value changes
|
||||
|
||||
- **Parameters:**
|
||||
- `callback` *(fun(value: number))*:
|
||||
|
||||
### set_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_value(value, [is_instant])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `value` *(number)*:
|
||||
- `[is_instant]` *(any)*:
|
||||
|
||||
### get_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:get_value()
|
||||
```
|
||||
|
||||
- **Returns:**
|
||||
- `` *(number)*:
|
||||
|
||||
### update_value
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:update_value([value])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[value]` *(any)*:
|
||||
|
||||
### set_number_type
|
||||
|
||||
---
|
||||
```lua
|
||||
property_slider:set_number_type([min], [max], [step])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[min]` *(any)*:
|
||||
- `[max]` *(any)*:
|
||||
- `[step]` *(any)*:
|
||||
|
||||
|
||||
## Fields
|
||||
<a name="root"></a>
|
||||
- **root** (_node_)
|
||||
|
||||
<a name="container"></a>
|
||||
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
|
||||
|
||||
<a name="druid"></a>
|
||||
- **druid** (_druid.instance_): The Druid Factory used to create components
|
||||
|
||||
<a name="text_name"></a>
|
||||
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_value"></a>
|
||||
- **text_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="slider"></a>
|
||||
- **slider** (_druid.slider_): Basic Druid slider component. Creates a draggable node over a line with progress reporting.
|
||||
|
||||
<a name="on_change_value"></a>
|
||||
- **on_change_value** (_event_): fun(value:number)
|
||||
|
||||
<a name="selected"></a>
|
||||
- **selected** (_node_)
|
||||
|
||||
<a name="min"></a>
|
||||
- **min** (_integer_)
|
||||
|
||||
<a name="max"></a>
|
||||
- **max** (_integer_)
|
||||
|
||||
<a name="step"></a>
|
||||
- **step** (_number_)
|
||||
|
Reference in New Issue
Block a user