Esempio n. 1
0
 def create_widgets(self, master):
     self.frame = ttk.Frame(master)
     self.columnsLabel = TkUtil.Label(self.frame, text="Columns",
             underline=2)
     self.columnsSpinbox = Spinbox(self.frame,
             textvariable=self.columns, from_=Board.MIN_COLUMNS,
             to=Board.MAX_COLUMNS, width=3, justify=tk.RIGHT,
             validate="all")
     self.columnsSpinbox.config(validatecommand=(
         self.columnsSpinbox.register(self.validate_int),
             "columnsSpinbox", "%P"))
     self.rowsLabel = TkUtil.Label(self.frame, text="Rows",
             underline=0)
     self.rowsSpinbox = Spinbox(self.frame, textvariable=self.rows,
             from_=Board.MIN_ROWS, to=Board.MAX_ROWS, width=3,
             justify=tk.RIGHT, validate="all")
     self.rowsSpinbox.config(validatecommand=(
         self.rowsSpinbox.register(self.validate_int),
             "rowsSpinbox", "%P"))
     self.maxColorsLabel = TkUtil.Label(self.frame, text="Max. Colors",
             underline=0)
     self.maxColorsSpinbox = Spinbox(self.frame,
             textvariable=self.maxColors, from_=Board.MIN_MAX_COLORS,
             to=Board.MAX_MAX_COLORS, width=3, justify=tk.RIGHT,
             validate="all")
     self.maxColorsSpinbox.config(validatecommand=(
         self.maxColorsSpinbox.register(self.validate_int),
             "maxColorsSpinbox", "%P"))
Esempio n. 2
0
    def create_general_widgets(self, master):
        self.shapeLabel = TkUtil.Label(master, text="Shape", underline=0)
        self.shapeCombobox = ttk.Combobox(master,
                                          textvariable=self.options.shapeName,
                                          state="readonly",
                                          values=sorted(
                                              Shapes.ShapeForName.keys()))
        self.columnsLabel = TkUtil.Label(master, text="Columns", underline=2)
        self.columnsSpinbox = Spinbox(master,
                                      textvariable=self.columns,
                                      from_=Board.MIN_COLUMNS,
                                      to=Board.MAX_COLUMNS,
                                      width=3,
                                      justify=tk.RIGHT,
                                      validate="all")
        self.columnsSpinbox.config(
            validatecommand=(self.columnsSpinbox.register(self.validate_int),
                             "columnsSpinbox", "%P"))

        self.rowsLabel = TkUtil.Label(master, text="Rows", underline=0)
        self.rowsSpinbox = Spinbox(master,
                                   textvariable=self.rows,
                                   from_=Board.MIN_ROWS,
                                   to=Board.MAX_ROWS,
                                   width=3,
                                   justify=tk.RIGHT,
                                   validate="all")
        self.rowsSpinbox.config(
            validatecommand=(self.rowsSpinbox.register(self.validate_int),
                             "rowsSpinbox", "%P"))

        self.maxColorsLabel = TkUtil.Label(master,
                                           text="Max. Colors",
                                           underline=0)
        self.maxColorsSpinbox = Spinbox(master,
                                        textvariable=self.maxColors,
                                        from_=Board.MIN_MAX_COLORS,
                                        to=Board.MAX_MAX_COLORS,
                                        width=3,
                                        justify=tk.RIGHT,
                                        validate="all")
        self.maxColorsSpinbox.config(
            validatecommand=(self.maxColorsSpinbox.register(self.validate_int),
                             "maxColorsSpinbox", "%P"))
Esempio n. 3
0
 def create_widgets(self):
     self.findLabel = TkUtil.Label(self, text="Find:", underline=1)
     self.findEntry = ttk.Entry(self, width=25)
     self.replaceLabel = TkUtil.Label(self, text="Replace:", underline=1)
     self.replaceEntry = ttk.Entry(self, width=25)
     self.caseSensitiveCheckbutton = TkUtil.Checkbutton(
         self,
         text="Case Sensitive",
         underline=5,
         variable=self.caseSensitive)
     self.wholeWordsCheckbutton = TkUtil.Checkbutton(
         self, text="Whole Words", underline=0, variable=self.wholeWords)
     self.findButton = TkUtil.Button(self,
                                     text="Find",
                                     underline=0,
                                     command=self.find,
                                     default=tk.ACTIVE,
                                     state=tk.DISABLED)
     self.replaceButton = TkUtil.Button(self,
                                        text="Replace",
                                        underline=0,
                                        command=self.replace,
                                        state=tk.DISABLED)
     self.closeButton = TkUtil.Button(self,
                                      text="Close",
                                      underline=0,
                                      command=self.close)
     if TkUtil.x11():
         self.extendButton = TkUtil.ToggleButton(self,
                                                 text="Extend",
                                                 underline=1,
                                                 command=self.toggle_extend)
     else:
         self.extendButton = ttk.Button(self,
                                        text="Extend",
                                        underline=1,
                                        command=self.toggle_extend,
                                        image=self.images[UNEXTEND],
                                        compound=tk.LEFT)
     self.extensionWidgets = (self.replaceLabel, self.replaceEntry,
                              self.replaceButton)
Esempio n. 4
0
    def create_advanced_widgets(self, master):
        self.delayLabel = TkUtil.Label(master, text="Delay (ms)", underline=0)
        self.delaySpinbox = Spinbox(master,
                                    textvariable=self.delay,
                                    from_=Board.MIN_DELAY,
                                    to=Board.MAX_DELAY,
                                    increment=25,
                                    width=4,
                                    justify=tk.RIGHT,
                                    validate="all")
        self.delaySpinbox.config(
            validatecommand=(self.delaySpinbox.register(self.validate_int),
                             "delaySpinbox", "%P"))

        self.zoomLabel = TkUtil.Label(master, text="Zoom (%)", underline=0)
        self.zoomSpinbox = Spinbox(master,
                                   textvariable=self.options.zoom,
                                   from_=Board.MIN_ZOOM,
                                   to=Board.MAX_ZOOM,
                                   increment=Board.ZOOM_INC,
                                   width=4,
                                   justify=tk.RIGHT,
                                   validate="all")
        self.zoomSpinbox.config(
            validatecommand=(self.zoomSpinbox.register(self.validate_int),
                             "zoomSpinbox", "%P"))

        self.showToolbarCheckbutton = TkUtil.Checkbutton(
            master,
            text="Show Toolbar",
            underline=5,
            variable=self.showToolbar)

        self.restoreCheckbutton = TkUtil.Checkbutton(master,
                                                     text="Restore Position",
                                                     underline=0,
                                                     variable=self.restore)