mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-08 03:41:11 -04:00
docs - add missing inherited fields and events to widgets
This commit is contained in:
parent
759cea3051
commit
c4506d2d67
@ -49,3 +49,50 @@ Properties
|
|||||||
- boolean (true)
|
- boolean (true)
|
||||||
- | Modulate `alpha` with parents `alpha`.
|
- | Modulate `alpha` with parents `alpha`.
|
||||||
| If the parent has `inheritAlpha` set to `true`, the value after modulating is passed to the child.
|
| If the parent has `inheritAlpha` set to `true`, the value after modulating is passed to the child.
|
||||||
|
|
||||||
|
Events
|
||||||
|
------
|
||||||
|
|
||||||
|
Base widget events are special, they can propagate up to the parent widget.
|
||||||
|
This can be prevented by changing the `propagateEvents` property, or by assigning an event handler.
|
||||||
|
The event is still allowed to propagate if the event handler returns `true`.
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
:widths: 20 20 60
|
||||||
|
|
||||||
|
* - name
|
||||||
|
- first argument type
|
||||||
|
- description
|
||||||
|
* - keyPress
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was pressed with this widget in focus
|
||||||
|
* - keyRelease
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was released with this widget in focus
|
||||||
|
* - mouseMove
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- | Mouse cursor moved on this widget
|
||||||
|
| `MouseEvent.button` is the mouse button being held
|
||||||
|
| (nil when simply moving, and not dragging)
|
||||||
|
* - mouseClick
|
||||||
|
- nil
|
||||||
|
- Widget was clicked with left mouse button
|
||||||
|
* - mouseDoubleClick
|
||||||
|
- nil
|
||||||
|
- Widget was double clicked with left mouse button
|
||||||
|
* - mousePress
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was pressed on this widget
|
||||||
|
* - mouseRelease
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was released on this widget
|
||||||
|
* - focusGain
|
||||||
|
- nil
|
||||||
|
- Widget gained focus (either through mouse or keyboard)
|
||||||
|
* - focusLoss
|
||||||
|
- nil
|
||||||
|
- Widget lost focus
|
||||||
|
* - textInput
|
||||||
|
- string
|
||||||
|
- Text input with this widget in focus
|
||||||
|
@ -13,6 +13,38 @@ Properties
|
|||||||
* - name
|
* - name
|
||||||
- type (default value)
|
- type (default value)
|
||||||
- description
|
- description
|
||||||
|
* - position
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner in pixels.
|
||||||
|
* - size
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size in pixels.
|
||||||
|
* - relativePosition
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner as a fraction of the parent's size.
|
||||||
|
* - relativeSize
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size by a fraction of its parent's size.
|
||||||
|
* - anchor
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the widget's position by a fraction of its size.
|
||||||
|
| Useful for centering or aligning to a corner.
|
||||||
|
* - visible
|
||||||
|
- boolean (true)
|
||||||
|
- Defines if the widget is visible
|
||||||
|
* - propagateEvents
|
||||||
|
- boolean (true)
|
||||||
|
- Allows base widget events to propagate to the widget's parent.
|
||||||
|
* - alpha
|
||||||
|
- number (1.0)
|
||||||
|
- | Set the opacity of the widget and its contents.
|
||||||
|
| If `inheritAlpha` is set to `true`, this becomes the maximum alpha value the widget can take.
|
||||||
|
* - inheritAlpha
|
||||||
|
- boolean (true)
|
||||||
|
- | Modulate `alpha` with parents `alpha`.
|
||||||
|
| If the parent has `inheritAlpha` set to `true`, the value after modulating is passed to the child.
|
||||||
* - horizontal
|
* - horizontal
|
||||||
- bool (false)
|
- bool (false)
|
||||||
- | Flex aligns its children in a row (main axis is horizontal) if true,
|
- | Flex aligns its children in a row (main axis is horizontal) if true,
|
||||||
@ -28,6 +60,53 @@ Properties
|
|||||||
- ui.ALIGNMENT (Start)
|
- ui.ALIGNMENT (Start)
|
||||||
- How to arrange the children in the cross axis.
|
- How to arrange the children in the cross axis.
|
||||||
|
|
||||||
|
Events
|
||||||
|
------
|
||||||
|
|
||||||
|
Base widget events are special, they can propagate up to the parent widget.
|
||||||
|
This can be prevented by changing the `propagateEvents` property, or by assigning an event handler.
|
||||||
|
The event is still allowed to propagate if the event handler returns `true`.
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
:widths: 20 20 60
|
||||||
|
|
||||||
|
* - name
|
||||||
|
- first argument type
|
||||||
|
- description
|
||||||
|
* - keyPress
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was pressed with this widget in focus
|
||||||
|
* - keyRelease
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was released with this widget in focus
|
||||||
|
* - mouseMove
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- | Mouse cursor moved on this widget
|
||||||
|
| `MouseEvent.button` is the mouse button being held
|
||||||
|
| (nil when simply moving, and not dragging)
|
||||||
|
* - mouseClick
|
||||||
|
- nil
|
||||||
|
- Widget was clicked with left mouse button
|
||||||
|
* - mouseDoubleClick
|
||||||
|
- nil
|
||||||
|
- Widget was double clicked with left mouse button
|
||||||
|
* - mousePress
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was pressed on this widget
|
||||||
|
* - mouseRelease
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was released on this widget
|
||||||
|
* - focusGain
|
||||||
|
- nil
|
||||||
|
- Widget gained focus (either through mouse or keyboard)
|
||||||
|
* - focusLoss
|
||||||
|
- nil
|
||||||
|
- Widget lost focus
|
||||||
|
* - textInput
|
||||||
|
- string
|
||||||
|
- Text input with this widget in focus
|
||||||
|
|
||||||
External
|
External
|
||||||
--------
|
--------
|
||||||
.. list-table::
|
.. list-table::
|
||||||
|
@ -13,6 +13,38 @@ Properties
|
|||||||
* - name
|
* - name
|
||||||
- type (default value)
|
- type (default value)
|
||||||
- description
|
- description
|
||||||
|
* - position
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner in pixels.
|
||||||
|
* - size
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size in pixels.
|
||||||
|
* - relativePosition
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner as a fraction of the parent's size.
|
||||||
|
* - relativeSize
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size by a fraction of its parent's size.
|
||||||
|
* - anchor
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the widget's position by a fraction of its size.
|
||||||
|
| Useful for centering or aligning to a corner.
|
||||||
|
* - visible
|
||||||
|
- boolean (true)
|
||||||
|
- Defines if the widget is visible
|
||||||
|
* - propagateEvents
|
||||||
|
- boolean (true)
|
||||||
|
- Allows base widget events to propagate to the widget's parent.
|
||||||
|
* - alpha
|
||||||
|
- number (1.0)
|
||||||
|
- | Set the opacity of the widget and its contents.
|
||||||
|
| If `inheritAlpha` is set to `true`, this becomes the maximum alpha value the widget can take.
|
||||||
|
* - inheritAlpha
|
||||||
|
- boolean (true)
|
||||||
|
- | Modulate `alpha` with parents `alpha`.
|
||||||
|
| If the parent has `inheritAlpha` set to `true`, the value after modulating is passed to the child.
|
||||||
* - resource
|
* - resource
|
||||||
- ui.texture
|
- ui.texture
|
||||||
- The texture resource to display
|
- The texture resource to display
|
||||||
@ -25,3 +57,50 @@ Properties
|
|||||||
* - color
|
* - color
|
||||||
- util.color (``rgb(1, 1, 1)``)
|
- util.color (``rgb(1, 1, 1)``)
|
||||||
- Modulate constant color with the color of the image texture.
|
- Modulate constant color with the color of the image texture.
|
||||||
|
|
||||||
|
Events
|
||||||
|
------
|
||||||
|
|
||||||
|
Base widget events are special, they can propagate up to the parent widget.
|
||||||
|
This can be prevented by changing the `propagateEvents` property, or by assigning an event handler.
|
||||||
|
The event is still allowed to propagate if the event handler returns `true`.
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
:widths: 20 20 60
|
||||||
|
|
||||||
|
* - name
|
||||||
|
- first argument type
|
||||||
|
- description
|
||||||
|
* - keyPress
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was pressed with this widget in focus
|
||||||
|
* - keyRelease
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was released with this widget in focus
|
||||||
|
* - mouseMove
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- | Mouse cursor moved on this widget
|
||||||
|
| `MouseEvent.button` is the mouse button being held
|
||||||
|
| (nil when simply moving, and not dragging)
|
||||||
|
* - mouseClick
|
||||||
|
- nil
|
||||||
|
- Widget was clicked with left mouse button
|
||||||
|
* - mouseDoubleClick
|
||||||
|
- nil
|
||||||
|
- Widget was double clicked with left mouse button
|
||||||
|
* - mousePress
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was pressed on this widget
|
||||||
|
* - mouseRelease
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was released on this widget
|
||||||
|
* - focusGain
|
||||||
|
- nil
|
||||||
|
- Widget gained focus (either through mouse or keyboard)
|
||||||
|
* - focusLoss
|
||||||
|
- nil
|
||||||
|
- Widget lost focus
|
||||||
|
* - textInput
|
||||||
|
- string
|
||||||
|
- Text input with this widget in focus
|
||||||
|
@ -13,6 +13,38 @@ Properties
|
|||||||
* - name
|
* - name
|
||||||
- type (default value)
|
- type (default value)
|
||||||
- description
|
- description
|
||||||
|
* - position
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner in pixels.
|
||||||
|
* - size
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size in pixels.
|
||||||
|
* - relativePosition
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner as a fraction of the parent's size.
|
||||||
|
* - relativeSize
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size by a fraction of its parent's size.
|
||||||
|
* - anchor
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the widget's position by a fraction of its size.
|
||||||
|
| Useful for centering or aligning to a corner.
|
||||||
|
* - visible
|
||||||
|
- boolean (true)
|
||||||
|
- Defines if the widget is visible
|
||||||
|
* - propagateEvents
|
||||||
|
- boolean (true)
|
||||||
|
- Allows base widget events to propagate to the widget's parent.
|
||||||
|
* - alpha
|
||||||
|
- number (1.0)
|
||||||
|
- | Set the opacity of the widget and its contents.
|
||||||
|
| If `inheritAlpha` is set to `true`, this becomes the maximum alpha value the widget can take.
|
||||||
|
* - inheritAlpha
|
||||||
|
- boolean (true)
|
||||||
|
- | Modulate `alpha` with parents `alpha`.
|
||||||
|
| If the parent has `inheritAlpha` set to `true`, the value after modulating is passed to the child.
|
||||||
* - autoSize
|
* - autoSize
|
||||||
- boolean (true)
|
- boolean (true)
|
||||||
- | Adjusts this widget's size to fit the text exactly.
|
- | Adjusts this widget's size to fit the text exactly.
|
||||||
@ -44,3 +76,50 @@ Properties
|
|||||||
* - textShadowColor
|
* - textShadowColor
|
||||||
- util.color (``rgb(0, 0, 0)``)
|
- util.color (``rgb(0, 0, 0)``)
|
||||||
- The color of the text shadow.
|
- The color of the text shadow.
|
||||||
|
|
||||||
|
Events
|
||||||
|
------
|
||||||
|
|
||||||
|
Base widget events are special, they can propagate up to the parent widget.
|
||||||
|
This can be prevented by changing the `propagateEvents` property, or by assigning an event handler.
|
||||||
|
The event is still allowed to propagate if the event handler returns `true`.
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
:widths: 20 20 60
|
||||||
|
|
||||||
|
* - name
|
||||||
|
- first argument type
|
||||||
|
- description
|
||||||
|
* - keyPress
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was pressed with this widget in focus
|
||||||
|
* - keyRelease
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was released with this widget in focus
|
||||||
|
* - mouseMove
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- | Mouse cursor moved on this widget
|
||||||
|
| `MouseEvent.button` is the mouse button being held
|
||||||
|
| (nil when simply moving, and not dragging)
|
||||||
|
* - mouseClick
|
||||||
|
- nil
|
||||||
|
- Widget was clicked with left mouse button
|
||||||
|
* - mouseDoubleClick
|
||||||
|
- nil
|
||||||
|
- Widget was double clicked with left mouse button
|
||||||
|
* - mousePress
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was pressed on this widget
|
||||||
|
* - mouseRelease
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was released on this widget
|
||||||
|
* - focusGain
|
||||||
|
- nil
|
||||||
|
- Widget gained focus (either through mouse or keyboard)
|
||||||
|
* - focusLoss
|
||||||
|
- nil
|
||||||
|
- Widget lost focus
|
||||||
|
* - textInput
|
||||||
|
- string
|
||||||
|
- Text input with this widget in focus
|
||||||
|
@ -13,6 +13,38 @@ Properties
|
|||||||
* - name
|
* - name
|
||||||
- type (default value)
|
- type (default value)
|
||||||
- description
|
- description
|
||||||
|
* - position
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner in pixels.
|
||||||
|
* - size
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size in pixels.
|
||||||
|
* - relativePosition
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the position of the widget from its parent's
|
||||||
|
| top-left corner as a fraction of the parent's size.
|
||||||
|
* - relativeSize
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- Increases the widget's size by a fraction of its parent's size.
|
||||||
|
* - anchor
|
||||||
|
- util.vector2 (0, 0)
|
||||||
|
- | Offsets the widget's position by a fraction of its size.
|
||||||
|
| Useful for centering or aligning to a corner.
|
||||||
|
* - visible
|
||||||
|
- boolean (true)
|
||||||
|
- Defines if the widget is visible
|
||||||
|
* - propagateEvents
|
||||||
|
- boolean (true)
|
||||||
|
- Allows base widget events to propagate to the widget's parent.
|
||||||
|
* - alpha
|
||||||
|
- number (1.0)
|
||||||
|
- | Set the opacity of the widget and its contents.
|
||||||
|
| If `inheritAlpha` is set to `true`, this becomes the maximum alpha value the widget can take.
|
||||||
|
* - inheritAlpha
|
||||||
|
- boolean (true)
|
||||||
|
- | Modulate `alpha` with parents `alpha`.
|
||||||
|
| If the parent has `inheritAlpha` set to `true`, the value after modulating is passed to the child.
|
||||||
* - text
|
* - text
|
||||||
- string ('')
|
- string ('')
|
||||||
- The text to display.
|
- The text to display.
|
||||||
@ -52,6 +84,38 @@ Events
|
|||||||
* - name
|
* - name
|
||||||
- first argument type
|
- first argument type
|
||||||
- description
|
- description
|
||||||
|
* - keyPress
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was pressed with this widget in focus
|
||||||
|
* - keyRelease
|
||||||
|
- `KeyboardEvent <../openmw_input.html##(KeyboardEvent)>`_
|
||||||
|
- A key was released with this widget in focus
|
||||||
|
* - mouseMove
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- | Mouse cursor moved on this widget
|
||||||
|
| `MouseEvent.button` is the mouse button being held
|
||||||
|
| (nil when simply moving, and not dragging)
|
||||||
|
* - mouseClick
|
||||||
|
- nil
|
||||||
|
- Widget was clicked with left mouse button
|
||||||
|
* - mouseDoubleClick
|
||||||
|
- nil
|
||||||
|
- Widget was double clicked with left mouse button
|
||||||
|
* - mousePress
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was pressed on this widget
|
||||||
|
* - mouseRelease
|
||||||
|
- `MouseEvent <../openmw_ui.html##(MouseEvent)>`_
|
||||||
|
- A mouse button was released on this widget
|
||||||
|
* - focusGain
|
||||||
|
- nil
|
||||||
|
- Widget gained focus (either through mouse or keyboard)
|
||||||
|
* - focusLoss
|
||||||
|
- nil
|
||||||
|
- Widget lost focus
|
||||||
|
* - textInput
|
||||||
|
- string
|
||||||
|
- Text input with this widget in focus
|
||||||
* - textChanged
|
* - textChanged
|
||||||
- string
|
- string
|
||||||
- Displayed text changed (e. g. by user input)
|
- Displayed text changed (e. g. by user input)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user