This commit is contained in:
Will McGugan
2022-08-17 16:11:12 +01:00
parent 29422a6d0b
commit 2650dd500d
47 changed files with 428 additions and 32 deletions

9
docs/events/blur.md Normal file
View File

@@ -0,0 +1,9 @@
# Blur
The `Blur` event is sent to a widget when it loses focus.
- [ ] Bubbles
## Attributes
_No other attributes_

View File

@@ -0,0 +1,9 @@
# DescendantBlur
The `DescendantBlur` event is sent to a widget when one of its children loses focus.
- [x] Bubbles
## Attributes
_No other attributes_

View File

@@ -0,0 +1,9 @@
# DescendantFocus
The `DescendantFocus` event is sent to a widget when one of its children receives input focus.
- [x] Bubbles
## Attributes
_No other attributes_

9
docs/events/enter.md Normal file
View File

@@ -0,0 +1,9 @@
# Enter
The `Enter` event is sent to a widget when the mouse pointer first moves over a widget.
- [ ] Bubbles
## Attributes
_No other attributes_

9
docs/events/focus.md Normal file
View File

@@ -0,0 +1,9 @@
# Focus
The `Focus` event is sent to a widget when it receives input focus.
- [ ] Bubbles
## Attributes
_No other attributes_

9
docs/events/hide.md Normal file
View File

@@ -0,0 +1,9 @@
# Show
The `Hide` event is sent to a widget when it is hidden from view.
- [ ] Bubbles
## Attributes
_No additional attributes_

11
docs/events/key.md Normal file
View File

@@ -0,0 +1,11 @@
# Key
The `Key` event is sent to a widget when the user presses key on the keyboard.
- [x] Bubbles
## Attributes
| attribute | type | purpose |
| --------- | ---- | ------------------------ |
| `key` | str | The key that was pressed |

9
docs/events/leave.md Normal file
View File

@@ -0,0 +1,9 @@
# Leave
The `Leave` event is sent to a widget when the mouse pointer moves off a widget.
- [ ] Bubbles
## Attributes
_No other attributes_

11
docs/events/load.md Normal file
View File

@@ -0,0 +1,11 @@
# Mount
The `Load` event is sent to the app prior to switching the terminal in to application mode.
The load event is typically used to do any setup actions required by the app, that don't change the display.
- [ ] Bubbles
## Attributes
_No additional attributes_

View File

@@ -6,12 +6,6 @@ The mount event is typically used to set the initial state of a widget or to add
- [ ] Bubbles
## Parameters
## Attributes
`sender`
: The sender of the widget
## Code
::: textual.events.Mount
_No additional attributes_

View File

@@ -0,0 +1,11 @@
# MouseCapture
The `MouseCapture` event is sent to a widget when it is capturing mouse events from outside of its borders on the screen.
- [ ] Bubbles
## Attributes
| attribute | type | purpose |
| ---------------- | ------ | --------------------------------------------- |
| `mouse_position` | Offset | Mouse coordinates when the mouse was captured |

View File

@@ -0,0 +1,20 @@
# Click
The `Click` event is sent to a widget when the user clicks a mouse button.
- [x] Bubbles
## Attributes
| attribute | type | purpose |
| ---------- | ---- | ----------------------------------------- |
| `x` | int | Mouse x coordinate, relative to Widget |
| `y` | int | Mouse y coordinate, relative to Widget |
| `delta_x` | int | Change in x since last mouse event |
| `delta_y` | int | Change in x since last mouse event |
| `button` | int | Index of mouse button |
| `shift` | bool | Shift key pressed if True |
| `meta` | bool | Meta key pressed if True |
| `ctrl` | bool | Shift key pressed if True |
| `screen_x` | int | Mouse x coordinate relative to the screen |
| `screen_y` | int | Mouse y coordinate relative to the screen |

20
docs/events/mouse_down.md Normal file
View File

@@ -0,0 +1,20 @@
# MouseDown
The `MouseDown` event is sent to a widget when a mouse button is pressed.
- [x] Bubbles
## Attributes
| attribute | type | purpose |
| ---------- | ---- | ----------------------------------------- |
| `x` | int | Mouse x coordinate, relative to Widget |
| `y` | int | Mouse y coordinate, relative to Widget |
| `delta_x` | int | Change in x since last mouse event |
| `delta_y` | int | Change in x since last mouse event |
| `button` | int | Index of mouse button |
| `shift` | bool | Shift key pressed if True |
| `meta` | bool | Meta key pressed if True |
| `ctrl` | bool | Shift key pressed if True |
| `screen_x` | int | Mouse x coordinate relative to the screen |
| `screen_y` | int | Mouse y coordinate relative to the screen |

20
docs/events/mouse_move.md Normal file
View File

@@ -0,0 +1,20 @@
# MouseMove
The `MouseMove` event is sent to a widget when the mouse pointer is moved over a widget.
- [x] Bubbles
## Attributes
| attribute | type | purpose |
| ---------- | ---- | ----------------------------------------- |
| `x` | int | Mouse x coordinate, relative to Widget |
| `y` | int | Mouse y coordinate, relative to Widget |
| `delta_x` | int | Change in x since last mouse event |
| `delta_y` | int | Change in x since last mouse event |
| `button` | int | Index of mouse button |
| `shift` | bool | Shift key pressed if True |
| `meta` | bool | Meta key pressed if True |
| `ctrl` | bool | Shift key pressed if True |
| `screen_x` | int | Mouse x coordinate relative to the screen |
| `screen_y` | int | Mouse y coordinate relative to the screen |

View File

@@ -0,0 +1,11 @@
# MouseRelease
The `MouseRelease` event is sent to a widget it is no longer receiving mouse events outside of its borders.
- [ ] Bubbles
## Attributes
| attribute | type | purpose |
| ---------------- | ------ | -------------------------------------------- |
| `mouse_position` | Offset | Mouse coordinates when the mouse was release |

View File

@@ -0,0 +1,12 @@
# MouseScrollDown
The `MouseScrollDown` event is sent to a widget when scroll wheel (or trackpad equivalent) is moved _down_.
- [x] Bubbles
## Attributes
| attribute | type | purpose |
| --------- | ---- | -------------------------------------- |
| `x` | int | Mouse x coordinate, relative to Widget |
| `y` | int | Mouse y coordinate, relative to Widget |

View File

@@ -0,0 +1,12 @@
# MouseScrollUp
The `MouseScrollUp` event is sent to a widget when scroll wheel (or trackpad equivalent) is moved _up_.
- [x] Bubbles
## Attributes
| attribute | type | purpose |
| --------- | ---- | -------------------------------------- |
| `x` | int | Mouse x coordinate, relative to Widget |
| `y` | int | Mouse y coordinate, relative to Widget |

20
docs/events/mouse_up.md Normal file
View File

@@ -0,0 +1,20 @@
# MouseUp
The `MouseUp` event is sent to a widget when the user releases a mouse button.
- [x] Bubbles
## Attributes
| attribute | type | purpose |
| ---------- | ---- | ----------------------------------------- |
| `x` | int | Mouse x coordinate, relative to Widget |
| `y` | int | Mouse y coordinate, relative to Widget |
| `delta_x` | int | Change in x since last mouse event |
| `delta_y` | int | Change in x since last mouse event |
| `button` | int | Index of mouse button |
| `shift` | bool | Shift key pressed if True |
| `meta` | bool | Meta key pressed if True |
| `ctrl` | bool | Shift key pressed if True |
| `screen_x` | int | Mouse x coordinate relative to the screen |
| `screen_y` | int | Mouse y coordinate relative to the screen |

11
docs/events/paste.md Normal file
View File

@@ -0,0 +1,11 @@
# Paste
The `Paste` event is sent to a widget when the user pastes text.
- [ ] Bubbles
## Attributes
| attribute | type | purpose |
| --------- | ---- | ------------------------ |
| `text` | str | The text that was pasted |

View File

@@ -4,20 +4,10 @@ The `Resize` event is sent to a widget when its size changes and when it is firs
- [x] Bubbles
## Parameters
## Attributes
`event.size`
: The new size of the Widget.
`event.virtual_size`
: The virtual size (scrollable area) of the Widget.
`event.container_size`
: The size of the widget's container.
## Code
::: textual.events.Mount
| attribute | type | purpose |
| ---------------- | ---- | ------------------------------------------------- |
| `size` | Size | The new size of the Widget. |
| `virtual_size` | Size | The virtual size (scrollable area) of the Widget. |
| `container_size` | Size | The size of the container (parent widget). |

View File

@@ -0,0 +1,9 @@
# ScreenResume
The `ScreenResume` event is sent to a **Screen** when it becomes current.
- [ ] Bubbles
## Attributes
_No other attributes_

View File

@@ -0,0 +1,9 @@
# ScreenSuspend
The `ScreenSuspend` event is sent to a **Screen** when it is replaced by another screen.
- [ ] Bubbles
## Attributes
_No other attributes_

9
docs/events/show.md Normal file
View File

@@ -0,0 +1,9 @@
# Show
The `Show` event is sent to a widget when it becomes visible.
- [ ] Bubbles
## Attributes
_No additional attributes_