Пример #1
0
 def create_type_rel_ypos(self):
     # Make a double spinbox for arrow relative y-position
     y_pos_box = QW_QDoubleSpinBox()
     y_pos_box.setRange(0, 1)
     y_pos_box.setDecimals(4)
     y_pos_box.setToolTip("Relative y-position of the arrow.")
     return(y_pos_box)
Пример #2
0
 def create_type_fh_arrowwidth(self):
     # Make a double spinbox for arrow head width
     head_length_box = QW_QDoubleSpinBox()
     head_length_box.setRange(0, 9999999)
     head_length_box.setDecimals(4)
     head_length_box.setToolTip("Scaling factor for the width of the "
                                "plotted arrow head")
     return(head_length_box)
Пример #3
0
 def create_type_ft_arrowwidth(self):
     # Make a double spinbox for arrow tail width
     tail_length_box = QW_QDoubleSpinBox()
     tail_length_box.setRange(0, 9999999)
     tail_length_box.setDecimals(4)
     tail_length_box.setToolTip("Scaling factor for the width of the "
                                "plotted arrow tail")
     return(tail_length_box)
Пример #4
0
 def create_type_markersize(self):
     # Make a double spinbox for markersize
     markersize_box = QW_QDoubleSpinBox()
     markersize_box.setRange(0, 9999999)
     markersize_box.setSuffix(" pts")
     markersize_box.setToolTip("Size of the plotted markers")
     set_box_value(markersize_box, rcParams['lines.markersize'])
     return(markersize_box)
Пример #5
0
 def create_type_ft_arrowlength(self):
     # Make a double spinbox for arrow tail length
     tail_length_box = QW_QDoubleSpinBox()
     tail_length_box.setRange(0, 9999999)
     tail_length_box.setDecimals(2)
     tail_length_box.setToolTip("Length of the plotted arrow tail relative "
                                "to the length of its head")
     return(tail_length_box)
Пример #6
0
 def create_type_linewidth(self):
     # Make a double spinbox for linewidth
     linewidth_box = QW_QDoubleSpinBox()
     linewidth_box.setRange(0, 9999999)
     linewidth_box.setSuffix(" pts")
     set_box_value(linewidth_box, rcParams['lines.linewidth'])
     linewidth_box.setToolTip("Width of the plotted line")
     return(linewidth_box)
Пример #7
0
    def create_type_float(self):
        """
        Creates the field box for values of type 'float' and returns it.

        """

        # Create a spinbox for floats
        float_box = QW_QDoubleSpinBox()
        float_box.setRange(-9999999, 9999999)
        float_box.setDecimals(6)
        float_box.setToolTip("Float value for this entry type")
        return (float_box)
Пример #8
0
 def create_type_alpha(self):
     # Make double spinbox for alpha
     alpha_box = QW_QDoubleSpinBox()
     alpha_box.setRange(0, 1)
     set_box_value(alpha_box, 1)
     alpha_box.setToolTip("Alpha value to use for the plotted data")
     return(alpha_box)
Пример #9
0
    def init(self):
        """
        Sets up the figure size entry after it has been initialized.

        This function is mainly responsible for simply creating the two double
        spinboxes that allow for the width and height to be set.

        """

        # Create the box_layout
        box_layout = QW.QHBoxLayout(self)
        box_layout.setContentsMargins(0, 0, 0, 0)
        self.setToolTip("Figure size dimensions to use for the projection "
                        "figure")

        # Create two double spinboxes for the width and height
        # WIDTH
        width_box = QW_QDoubleSpinBox()
        width_box.setRange(1, 9999999)
        width_box.setSuffix("'")
        width_box.setStepType(width_box.AdaptiveDecimalStepType)
        width_box.setToolTip("Width (in inches) of projection figure")
        self.width_box = width_box

        # HEIGHT
        height_box = QW_QDoubleSpinBox()
        height_box.setRange(1, 9999999)
        height_box.setSuffix("'")
        height_box.setToolTip("Height (in inches) of projection figure")
        self.height_box = height_box

        # Also create a textlabel with 'X'
        x_label = QW.QLabel('X')
        x_label.setSizePolicy(QW.QSizePolicy.Fixed, QW.QSizePolicy.Fixed)

        # Add everything to the box_layout
        box_layout.addWidget(width_box)
        box_layout.addWidget(x_label)
        box_layout.addWidget(height_box)

        # Set default value
        set_box_value(self, rcParams['figure.figsize'])
Пример #10
0
    def create_option_dpi(self):    # pragma: no cover
        """
        Creates the 'dpi' option and returns it.

        This option allows for the DPI used in the GUI to be modified.

        """

        # Make a checkbox for setting a custom DPI scaling
        dpi_check = QW.QCheckBox("Custom DPI scaling:")
        dpi_check.setToolTip("Set this to enable custom DPI scaling of the "
                             "GUI")
        self.create_entry('dpi_flag', dpi_check, False)

        # Make a spinbox for setting the DPI scaling
        dpi_box = QW_QDoubleSpinBox()
        dpi_box.setRange(0, 100)
        dpi_box.setSuffix("x")
        dpi_box.setSpecialValueText("Auto")
        dpi_box.setToolTip("Custom DPI scaling factor to use. "
                           "'1.0' is no scaling. "
                           "'Auto' is automatic scaling.")
        dpi_check.toggled.connect(dpi_box.setEnabled)
        dpi_box.setEnabled(False)
        self.create_entry('dpi_scaling', dpi_box, 1.0)

        # Return DPI box
        return(dpi_check, dpi_box)