Пример #1
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)
Пример #2
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)
Пример #3
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)
Пример #4
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'])