docs(buttons): buttons section of docs split to appearance and queue buttons
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 16 KiB |
BIN
docs/assets/widget_screenshots/buttons_queue.png
Normal file
After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 151 KiB |
@ -1,18 +1,9 @@
|
||||
(user.widgets.buttons)=
|
||||
(user.widgets.buttons_appearance)=
|
||||
|
||||
# Buttons
|
||||
# Appearance Buttons
|
||||
|
||||
`````{tab} Overview
|
||||
|
||||
This section consolidates various custom buttons used within the BEC GUIs, providing essential controls for managing operations and processes. These buttons are designed for easy integration into different layouts within the BEC environment, allowing users to embed functional controls into their applications seamlessly.
|
||||
|
||||
## Stop Button
|
||||
|
||||
The `Stop Button` is a specialized control that provides an immediate interface to halt ongoing operations in the BEC Client. It is essential for scenarios where operations need to be terminated quickly, such as in the case of an error or when an operation needs to be interrupted by the user.
|
||||
|
||||
**Key Features:**
|
||||
- **Immediate Termination**: Instantly halts the execution of the current script or process.
|
||||
- **Queue Management**: Clears any pending operations in the scan queue, ensuring the system is reset and ready for new tasks.
|
||||
This section consolidates various buttons designed to manage the appearance of the BEC GUI, allowing users to easily switch themes, select colors, and choose colormaps.
|
||||
|
||||
## Dark Mode Button
|
||||
|
||||
@ -30,12 +21,10 @@ The `Dark Mode Button` is a toggle control that allows users to switch between l
|
||||
```
|
||||
````
|
||||
|
||||
|
||||
**Key Features:**
|
||||
- **Theme Switching**: Enables users to switch between light and dark themes with a single click.
|
||||
- **Configurable from BECDesigner**: The defaults for the dark mode can be set in the BECDesigner, allowing users to customize the startup appearance of the GUI.
|
||||
|
||||
|
||||
## Color Button
|
||||
|
||||
The `Color Button` is a user interface element that provides a dialog to select colors. This button, adapted from `pyqtgraph`, is a simple yet powerful tool to integrate color selection functionality into the BEC GUIs.
|
||||
@ -50,31 +39,66 @@ The `Colormap Selector` is a specialized combobox that allows users to select a
|
||||
**Key Features:**
|
||||
- **Colormap Selection**: Provides a dropdown to select from all available colormaps in `pyqtgraph`.
|
||||
- **Visual Preview**: Displays a small preview of the colormap next to its name, enhancing usability.
|
||||
|
||||
|
||||
|
||||
`````
|
||||
|
||||
````{tab} Examples
|
||||
|
||||
Integrating the `StopButton` into a BEC GUI layout is straightforward. The following example demonstrates how to embed a `StopButton` within a custom GUI layout using `QtWidgets`.
|
||||
Integrating these buttons into a BEC GUI layout is straightforward. The following examples demonstrate how to embed these buttons within a custom GUI layout using `QtWidgets`.
|
||||
|
||||
## Example 1 - Embedding a Stop Button in a Custom GUI Layout
|
||||
|
||||
This example shows how to create a simple GUI layout with a `StopButton` integrated, allowing the user to halt processes directly from the interface.
|
||||
## Example 1 - Adding a Dark Mode Button
|
||||
|
||||
```python
|
||||
from qtpy.QtWidgets import QWidget, QVBoxLayout
|
||||
from bec_widgets.widgets.buttons import StopButton
|
||||
from bec_widgets.widgets.buttons import DarkModeButton
|
||||
|
||||
class MyGui(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget
|
||||
self.setLayout(QVBoxLayout(self))
|
||||
|
||||
# Create and add the StopButton to the layout
|
||||
self.stop_button = StopButton()
|
||||
self.layout().addWidget(self.stop_button)
|
||||
# Create and add the DarkModeButton to the layout
|
||||
self.dark_mode_button = DarkModeButton()
|
||||
self.layout().addWidget(self.dark_mode_button)
|
||||
|
||||
# Example of how this custom GUI might be used:
|
||||
my_gui = MyGui()
|
||||
my_gui.show()
|
||||
```
|
||||
|
||||
## Example 2 - Adding a Color Button
|
||||
|
||||
```python
|
||||
from qtpy.QtWidgets import QWidget, QVBoxLayout
|
||||
from bec_widgets.widgets.buttons import ColorButton
|
||||
|
||||
class MyGui(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setLayout(QVBoxLayout(self))
|
||||
|
||||
# Create and add the ColorButton to the layout
|
||||
self.color_button = ColorButton()
|
||||
self.layout().addWidget(self.color_button)
|
||||
|
||||
# Example of how this custom GUI might be used:
|
||||
my_gui = MyGui()
|
||||
my_gui.show()
|
||||
```
|
||||
|
||||
## Example 3 - Adding a Colormap Selector
|
||||
|
||||
```python
|
||||
from qtpy.QtWidgets import QWidget, QVBoxLayout
|
||||
from bec_widgets.widgets.buttons import ColormapSelector
|
||||
|
||||
class MyGui(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setLayout(QVBoxLayout(self))
|
||||
|
||||
# Create and add the ColormapSelector to the layout
|
||||
self.colormap_selector = ColormapSelector()
|
||||
self.layout().addWidget(self.colormap_selector)
|
||||
|
||||
# Example of how this custom GUI might be used:
|
||||
my_gui = MyGui()
|
||||
@ -84,7 +108,8 @@ my_gui.show()
|
||||
|
||||
````{tab} API
|
||||
```{eval-rst}
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.StopButton.rst
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.DarkModeButton.rst
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.ColorButton.rst
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.ColormapSelector.rst
|
||||
```
|
||||
````
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
134
docs/user/widgets/buttons_queue/button_queue.md
Normal file
@ -0,0 +1,134 @@
|
||||
(user.widgets.buttons_queue)=
|
||||
|
||||
# Queue Control Buttons
|
||||
|
||||
`````{tab} Overview
|
||||
This section consolidates various buttons designed to manage the BEC scan queue, providing essential controls for operations like stopping, resuming, aborting, and resetting the scan queue.
|
||||
|
||||
## Stop Button
|
||||
|
||||
The `Stop Button` is a specialized control that provides an immediate interface to halt ongoing operations in the BEC Client. It is essential for scenarios where operations need to be terminated quickly, such as in the case of an error or when an operation needs to be interrupted by the user.
|
||||
|
||||
**Key Features:**
|
||||
- **Immediate Termination**: Instantly halts the execution of the current script or process.
|
||||
- **Queue Management**: Stops the current scan or the entire scan queue.
|
||||
|
||||
## Resume Button
|
||||
|
||||
The `Resume Button` allows users to continue the paused scan queue. It’s useful in scenarios where the scan queue has been halted and needs to be resumed.
|
||||
|
||||
**Key Features:**
|
||||
- **Queue Continuation**: Resumes the scan queue after a pause.
|
||||
- **Toolbar and Button Options**: Can be configured as a toolbar button or a standard push button.
|
||||
|
||||
## Abort Button
|
||||
|
||||
The `Abort Button` provides an interface to abort a specific scan or the entire queue. This is useful for scenarios where an operation needs to be terminated but in a controlled manner.
|
||||
|
||||
**Key Features:**
|
||||
- **Scan Abortion**: Aborts the current scan or a specific scan in the queue.
|
||||
- **Toolbar and Button Options**: Can be configured as a toolbar button or a standard push button.
|
||||
|
||||
## Reset Queue Button
|
||||
|
||||
The `Reset Button` is used to reset the scan queue. It prompts the user for confirmation before resetting, ensuring that the action is intentional.
|
||||
|
||||
**Key Features:**
|
||||
- **Queue Reset**: Resets the entire scan queue.
|
||||
- **Confirmation Dialog**: Prompts the user to confirm the reset action to prevent accidental resets.
|
||||
- **Toolbar and Button Options**: Can be configured as a toolbar button or a standard push button.
|
||||
`````
|
||||
|
||||
````{tab} Examples
|
||||
|
||||
Integrating these buttons into a BEC GUI layout is straightforward. The following examples demonstrate how to embed these buttons within a custom GUI layout using `QtWidgets`.
|
||||
|
||||
### Example 1 - Embedding a Stop Button in a Custom GUI Layout
|
||||
|
||||
```python
|
||||
from qtpy.QtWidgets import QWidget, QVBoxLayout
|
||||
from bec_widgets.widgets.buttons import StopButton
|
||||
|
||||
class MyGui(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setLayout(QVBoxLayout(self))
|
||||
|
||||
# Create and add the StopButton to the layout
|
||||
self.stop_button = StopButton()
|
||||
self.layout().addWidget(self.stop_button)
|
||||
|
||||
# Example of how this custom GUI might be used:
|
||||
my_gui = MyGui()
|
||||
my_gui.show()
|
||||
```
|
||||
|
||||
### Example 2 - Embedding a Resume Button in a Custom GUI Layout
|
||||
|
||||
```python
|
||||
from qtpy.QtWidgets import QWidget, QVBoxLayout
|
||||
from bec_widgets.widgets.buttons import ResumeButton
|
||||
|
||||
class MyGui(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget
|
||||
|
||||
# Create and add the ResumeButton to the layout
|
||||
self.resume_button = ResumeButton()
|
||||
self.layout().addWidget(self.resume_button)
|
||||
|
||||
# Example of how this custom GUI might be used:
|
||||
my_gui = MyGui()
|
||||
my_gui.show()
|
||||
```
|
||||
|
||||
### Example 3 - Adding an Abort Button
|
||||
|
||||
```python
|
||||
from qtpy.QtWidgets import QWidget, QVBoxLayout
|
||||
from bec_widgets.widgets.buttons import AbortButton
|
||||
|
||||
class MyGui(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setLayout(QVBoxLayout(self))
|
||||
|
||||
# Create and add the AbortButton to the layout
|
||||
self.abort_button = AbortButton()
|
||||
self.layout().addWidget(self.abort_button)
|
||||
|
||||
# Example of how this custom GUI might be used:
|
||||
my_gui = MyGui()
|
||||
my_gui.show()
|
||||
```
|
||||
|
||||
### Example 4 - Adding a Reset Queue Button
|
||||
|
||||
```python
|
||||
from qtpy.QtWidgets import QWidget, QVBoxLayout
|
||||
from bec_widgets.widgets.buttons import ResetButton
|
||||
|
||||
class MyGui(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setLayout(QVBoxLayout(self))
|
||||
|
||||
# Create and add the ResetButton to the layout
|
||||
self.reset_button = ResetButton()
|
||||
self.layout().addWidget(self.reset_button)
|
||||
|
||||
# Example of how this custom GUI might be used:
|
||||
my_gui = MyGui()
|
||||
my_gui.show()
|
||||
```
|
||||
````
|
||||
|
||||
````{tab} API
|
||||
```{eval-rst}
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.StopButton.rst
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.ResumeButton.rst
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.AbortButton.rst
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.ResetButton.rst
|
||||
```
|
||||
````
|
@ -135,12 +135,20 @@ Various utility widgets to enhance user experience.
|
||||
````{grid} 3
|
||||
:gutter: 2
|
||||
|
||||
```{grid-item-card} Buttons
|
||||
:link: user.widgets.buttons
|
||||
```{grid-item-card} Buttons Appearance
|
||||
:link: user.widgets.buttons_appearance
|
||||
:link-type: ref
|
||||
:img-top: /assets/widget_screenshots/buttons.png
|
||||
|
||||
Various service buttons.
|
||||
Various buttons which manage the appearance of the BEC GUI.
|
||||
```
|
||||
|
||||
```{grid-item-card} Buttons Queue
|
||||
:link: user.widgets.buttons_queue
|
||||
:link-type: ref
|
||||
:img-top: /assets/widget_screenshots/buttons_queue.png
|
||||
|
||||
Various buttons which manage the control of the BEC Queue.
|
||||
```
|
||||
|
||||
```{grid-item-card} Device Input Widgets
|
||||
@ -215,7 +223,8 @@ scan_control/scan_control.md
|
||||
progress_bar/ring_progress_bar.md
|
||||
bec_status_box/bec_status_box.md
|
||||
queue/queue.md
|
||||
buttons/buttons.md
|
||||
buttons_appearance/buttons_appearance.md
|
||||
buttons_queue/buttons_queue.md
|
||||
device_browser/device_browser.md
|
||||
positioner_box/positioner_box.md
|
||||
text_box/text_box.md
|
||||
|