Builder classes#
Builder classes manage the creation of widgets and layout for the respective frames.
The gui.frames.builders sub-package includes builders for all GUI frame classes.
The builders to create and arrange the widgets have been separated simply for improved code organisation. They will create the user interface “shells” without any connections and functionality.
- class pydidas.gui.frames.builders.CompositeCreatorFrameBuilder#
Create the layout and add all widgets required for the CompositeCreatorFrame.
- class pydidas.gui.frames.builders.DefineDiffractionExpFrameBuilder#
Class to populate the DefineDiffractionExpFrame with widgets.
- classmethod build_frame(frame: BaseFrame)#
Populate the input frame with the required widgets.
- Parameters:
frame (BaseFrame) – The DefineDiffractionExpFrame instance.
- classmethod create_detector_header()#
Create header items (label / buttons) for the detector.
- classmethod create_geometry_header()#
Create header items (label / buttons) for the detector.
- class pydidas.gui.frames.builders.ImageMathFrameBuilder#
Create all widgets and initialize their state.
- Parameters:
self (pydidas.gui.ImageMathFrame) – The ImageMathFrame instance.
- classmethod create_combo_button_row(reference: str, label_text: str, combo_choices: list, button_text: str, button_icon: None | str = None)#
Create a combined widget with label, combobox and a button.
- Parameters:
reference (str) – The widget reference
label_text (str) – The text for the label.
combo_choices (list) – The choices to be displayed in the QComboBox.
button_text (str) – The button text.
button_icon (Union[None, str]) – The button icon.
- class pydidas.gui.frames.builders.QuickIntegrationFrameBuilder#
The QuickIntegrationFrameBuilder can be used to populate the QuickIntegrationFrame with widgets.
- classmethod populate_frame(frame)#
Populate the given frame with widgets.
Note: This method is reliant upon passing the correct type of frame.
- Parameters:
frame (pydidas.gui.frames.QuickIntegrationFrame) – The frame to be populated.
- class pydidas.gui.frames.builders.UtilitiesFrameBuilder#
Create all widgets and initialize their state.
- Parameters:
self (pydidas.gui.DefineScanFrame) – The DefineScanFrame instance.
- class pydidas.gui.frames.builders.WorkflowEditFrameBuilder#
Builder for the WorkflowEditFrame.
- pydidas.gui.frames.builders.build_header_config()#
Get information to build the frame.
- Returns:
The list with the information required to build the frame. The list include the callable method name, the arguments and the keyword arguments.
- Return type:
list[list[str, tuple, dict]]
- pydidas.gui.frames.builders.build_scan_dim_groups(start_row: int)#
Build the scan dimension groups.
- Parameters:
start_row (int) – The row to start the scan dimension groups.
- pydidas.gui.frames.builders.column_width_factor(two_columns: bool) int #
Get the width factor based on the number of visible columns.
- Parameters:
dim_columns (int) – The number of columns
- Returns:
The resulting total width factor for font metrics.
- Return type:
float
- pydidas.gui.frames.builders.create_splitter(filesystem_browser: QWidget, data_viewer: QWidget, frame_width: int) QSplitter #
Create a splitter widget for the frame.
- Parameters:
filesystem_browser (QtWidgets.QWidget) – The filesystem browser widget.
data_viewer (QtWidgets.QWidget) – The data viewer widget.
frame_width (int) – The width of the frame.
- Returns:
The splitter widget.
- Return type:
QtWidgets.QSplitter
- pydidas.gui.frames.builders.get_WorkflowRunFrame_build_config(frame: BaseFrame) list[list[str, tuple[str], dict]] #
Return the build configuration for the ViewResultsFrame.
- Parameters:
frame (BaseFrame) – The ViewResultsFrame instance.
- Returns:
The build configuration in form of a list. Each list entry consists of the widget creation method name, the method arguments and the method keywords.
- Return type:
list[list[str, tuple[str], dict]]
- pydidas.gui.frames.builders.get_WorkflowTestFrame_build_config(frame: BaseFrame) list[list[str, tuple[str], dict]] #
Return the build configuration for the WorkflowTestFrame.
- Parameters:
frame (BaseFrame) – The WorkflowTestFrame instance.
- Returns:
The build configuration in form of a list. Each list entry consists of the widget creation method name, the method arguments and the method
- Return type:
list[list[str, tuple[str], dict]]
- pydidas.gui.frames.builders.get_widget_creation_information() list[list[str, tuple, dict]] #
Get the widget creation information for the DataBrowsingFrame.
- Returns:
The widget creation information. Each list entry includes all the necessary information to create a single widget in the form of a list with the following entries:
The widget creation method name.
The arguments for the widget creation method.
The keyword arguments for the widget creation method.
- Return type:
list[list[str, tuple, dict]]