예제 #1
0
 def create_type_dpi(self):
     # Make spinbox for dpi
     dpi_box = QW_QSpinBox()
     dpi_box.setRange(1, 9999999)
     set_box_value(dpi_box, rcParams['figure.dpi'])
     dpi_box.setToolTip("DPI (dots per inch) to use for the projection "
                        "figure")
     return(dpi_box)
예제 #2
0
    def create_type_int(self):
        """
        Creates the field box for values of type 'int' and returns it.

        """

        # Create a spinbox for integers
        int_box = QW_QSpinBox()
        int_box.setRange(-9999999, 9999999)
        int_box.setToolTip("Integer value for this entry type")
        return (int_box)
예제 #3
0
    def create_option_proj_res(self):
        """
        Creates the 'proj_res' option and returns it.

        This option sets the value of the 'proj_res' projection parameter.

        """

        # Make spinbox for option proj_res
        proj_res_box = QW_QSpinBox()
        proj_res_box.setRange(0, 9999999)
        proj_res_box.setToolTip(proj_res_doc)
        self.create_entry('proj_res', proj_res_box,
                          self.proj_defaults['proj_res'])

        # Return resolution box
        return('Resolution:', proj_res_box)
예제 #4
0
    def create_option_proj_depth(self):
        """
        Creates the 'proj_depth' option and returns it.

        This option sets the value of the 'proj_depth' projection parameter.

        """

        # Make spinbox for option proj_depth
        proj_depth_box = QW_QSpinBox()
        proj_depth_box.setRange(0, 9999999)
        proj_depth_box.setToolTip(proj_depth_doc)
        self.create_entry('proj_depth', proj_depth_box,
                          self.proj_defaults['proj_depth'])

        # Return depth box
        return('Depth:', proj_depth_box)
예제 #5
0
    def create_option_text_fonts(self):     # pragma: no cover
        """
        Creates the 'text_fonts' option and returns it.

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

        """

        # PLAIN TEXT
        # Create a font families combobox
        plain_box = QW.QFontComboBox()
        plain_box.setFontFilters(QW.QFontComboBox.MonospacedFonts)
        plain_box.setEditable(True)
        plain_box.setInsertPolicy(plain_box.NoInsert)
        plain_box.completer().setCompletionMode(QW.QCompleter.PopupCompletion)

        # Create a font size spinbox
        plain_size = QW_QSpinBox()
        plain_size.setRange(7, 9999999)
        plain_size.setSuffix(" pts")

        # RICH TEXT
        # Create a font families combobox
        rich_box = QW.QFontComboBox()
        rich_box.setEditable(True)
        rich_box.setInsertPolicy(rich_box.NoInsert)
        rich_box.completer().setCompletionMode(QW.QCompleter.PopupCompletion)

        # Create a font size spinbox
        rich_size = QW_QSpinBox()
        rich_size.setRange(7, 9999999)
        rich_size.setSuffix(" pts")

        # Create a grid for the families and size boxes
        font_grid = QW.QGridLayout()
        font_grid.setColumnStretch(1, 2)
        font_grid.setColumnStretch(3, 1)

        # Add everything to this grid
        font_grid.addWidget(QW.QLabel("Plain text:"), 0, 0)
        font_grid.addWidget(plain_box, 0, 1)
        font_grid.addWidget(QW.QLabel("Size:"), 0, 2)
        font_grid.addWidget(plain_size, 0, 3)
        font_grid.addWidget(QW.QLabel("Rich text:"), 1, 0)
        font_grid.addWidget(rich_box, 1, 1)
        font_grid.addWidget(QW.QLabel("Size:"), 1, 2)
        font_grid.addWidget(rich_size, 1, 3)

        font_grid.addWidget(QW.QLabel("NOTE: Does not work yet"), 2, 0, 1, 4)

        # Return the grid
        return(font_grid,)