Example #1
0
    def build_dlg(self):
        top = self.top

        button_frame = self.create_std_buttons(top)
        button_frame.pack(side=BOTTOM, fill=BOTH, expand=1)

        do_apply = self.do_apply

        frame = Frame(top)
        frame.pack(side=TOP, fill=X, expand=1, ipady=2)

        label = Label(frame, text=_("Origin:"), anchor=E)
        label.grid(row=0, column=0, sticky='E')
        f = Frame(frame)
        self.var_xorig = create_length_entry(top, f, do_apply)
        f.grid(row=0, column=1)
        label = Label(frame, text=',', width=1)
        label.grid(row=0, column=2)
        f = Frame(frame)
        self.var_yorig = create_length_entry(top, f, do_apply)
        f.grid(row=0, column=3)

        label = Label(frame, text=_("Widths:"), anchor=E)
        label.grid(row=1, column=0, sticky='E')
        f = Frame(frame)
        self.var_xwidth = create_length_entry(top, f, do_apply)
        f.grid(row=1, column=1)
        label = Label(frame, text='x', width=1)
        label.grid(row=1, column=2)
        f = Frame(frame)
        self.var_ywidth = create_length_entry(top, f, do_apply)
        f.grid(row=1, column=3)
Example #2
0
    def build_dlg(self):
	top = self.top

	button_frame = self.create_std_buttons(top)
	button_frame.pack(side = BOTTOM, fill = BOTH, expand = 1)

	do_apply = self.do_apply

	frame = Frame(top)
	frame.pack(side = TOP, fill = X, expand = 1, ipady = 2)

	label = Label(frame, text = _("Origin:"), anchor = E)
	label.grid(row = 0, column = 0, sticky = 'E')
	f = Frame(frame)
	self.var_xorig = create_length_entry(top, f, do_apply)
	f.grid(row = 0, column = 1)
	label = Label(frame, text = ',', width = 1)
	label.grid(row = 0, column = 2)
	f = Frame(frame)
	self.var_yorig = create_length_entry(top, f, do_apply)
	f.grid(row = 0, column = 3)

	label = Label(frame, text = _("Widths:"), anchor = E)
	label.grid(row = 1, column = 0, sticky = 'E')
	f = Frame(frame)
	self.var_xwidth = create_length_entry(top, f, do_apply)
	f.grid(row = 1, column = 1)
	label = Label(frame, text = 'x', width = 1)
	label.grid(row = 1, column = 2)
	f = Frame(frame)
	self.var_ywidth = create_length_entry(top, f, do_apply)
	f.grid(row = 1, column = 3)
Example #3
0
    def build_dlg(self):
        top = self.top

        button_frame = self.create_std_buttons(top)
        button_frame.grid(row=5, columnspan=2, sticky='ew')

        color_frame = Frame(top, relief=GROOVE, bd=2)
        color_frame.grid(row=0, columnspan=2, sticky='ew')
        label = Label(color_frame, text=_("Color"))
        label.pack(side=LEFT, expand=1, anchor=E)
        self.color_but = ColorButton(color_frame,
                                     width=3,
                                     height=1,
                                     command=self.set_line_color)
        self.color_but.SetColor(StandardColors.black)
        self.color_but.pack(side=LEFT, expand=1, anchor=W)
        self.var_color_none = IntVar(top)
        check = UpdatedCheckbutton(color_frame,
                                   text=_("None"),
                                   variable=self.var_color_none,
                                   command=self.do_apply)
        check.pack(side=LEFT, expand=1)

        width_frame = Frame(top, relief=GROOVE, bd=2)
        width_frame.grid(row=1, columnspan=2, sticky='ew')
        label = Label(width_frame, text=_("Width"))
        label.pack(side=LEFT, expand=1, anchor=E)

        self.var_width = create_length_entry(top,
                                             width_frame,
                                             self.set_line_width,
                                             scroll_pad=0)

        tkwin = self.main_window.canvas.tkwin
        gc, bitmap, dashlist = create_dash_images(self.top.tk, tkwin,
                                                  StandardDashes())
        self.opt_dash = MyOptionMenu2(top,
                                      dashlist,
                                      command=self.set_dash,
                                      entry_type='image',
                                      highlightthickness=0)
        self.opt_dash.grid(row=2, columnspan=2, sticky='ew', ipady=2)
        self.dash_gc = gc
        self.dash_bitmap = bitmap

        gc, bitmap, arrow1, arrow2 = create_arrow_images(
            self.top.tk, tkwin, StandardArrows())
        self.opt_arrow1 = MyOptionMenu2(top,
                                        arrow1,
                                        command=self.set_arrow,
                                        args=1,
                                        entry_type='image',
                                        highlightthickness=0)
        self.opt_arrow1.grid(row=3, column=0, sticky='ew', ipady=2)
        self.opt_arrow2 = MyOptionMenu2(top,
                                        arrow2,
                                        command=self.set_arrow,
                                        args=2,
                                        entry_type='image',
                                        highlightthickness=0)
        self.opt_arrow2.grid(row=3, column=1, sticky='ew', ipady=2)
        self.arrow_gc = gc
        self.arrow_bitmap = bitmap

        self.opt_join = MyOptionMenu2(top, [(pixmaps.JoinMiter, JoinMiter),
                                            (pixmaps.JoinRound, JoinRound),
                                            (pixmaps.JoinBevel, JoinBevel)],
                                      command=self.set_line_join,
                                      entry_type='bitmap',
                                      highlightthickness=0)
        self.opt_join.grid(row=4, column=0, sticky='ew')

        self.opt_cap = MyOptionMenu2(top,
                                     [(pixmaps.CapButt, CapButt),
                                      (pixmaps.CapRound, CapRound),
                                      (pixmaps.CapProjecting, CapProjecting)],
                                     command=self.set_line_cap,
                                     entry_type='bitmap',
                                     highlightthickness=0)
        self.opt_cap.grid(row=4, column=1, sticky='ew')
        self.opt_cap.SetValue(None)
Example #4
0
    def build_dlg(self):
        top = self.top

        button_frame = self.create_std_buttons(top)
        button_frame.grid(row = 5, columnspan = 2, sticky = 'ew')

        color_frame = Frame(top, relief = GROOVE, bd = 2)
        color_frame.grid(row = 0, columnspan = 2, sticky = 'ew')
        label = Label(color_frame, text = _("Color"))
        label.pack(side = LEFT, expand = 1, anchor = E)
        self.color_but = ColorButton(color_frame, width = 3, height = 1,
                                     command = self.set_line_color)
        self.color_but.SetColor(StandardColors.black)
        self.color_but.pack(side = LEFT, expand = 1, anchor = W)
        self.var_color_none = IntVar(top)
        check = UpdatedCheckbutton(color_frame, text = _("None"),
                                   variable = self.var_color_none,
                                   command = self.do_apply)
        check.pack(side = LEFT, expand = 1)

        width_frame = Frame(top, relief = GROOVE, bd = 2)
        width_frame.grid(row = 1, columnspan = 2, sticky = 'ew')
        label = Label(width_frame, text = _("Width"))
        label.pack(side = LEFT, expand = 1, anchor = E)

        self.var_width = create_length_entry(top, width_frame,
                                             self.set_line_width,
                                             scroll_pad = 0)

        tkwin = self.main_window.canvas.tkwin
        gc, bitmap, dashlist = create_dash_images(self.top.tk, tkwin,
                                                  StandardDashes())
        self.opt_dash = MyOptionMenu2(top, dashlist, command = self.set_dash,
                                      entry_type = 'image',
                                      highlightthickness = 0)
        self.opt_dash.grid(row = 2, columnspan = 2, sticky = 'ew', ipady = 2)
        self.dash_gc = gc
        self.dash_bitmap = bitmap

        gc, bitmap, arrow1, arrow2 = create_arrow_images(self.top.tk, tkwin,
                                                         StandardArrows())
        self.opt_arrow1 = MyOptionMenu2(top, arrow1, command = self.set_arrow,
                                        args = 1, entry_type = 'image',
                                        highlightthickness = 0)
        self.opt_arrow1.grid(row = 3, column = 0, sticky = 'ew', ipady = 2)
        self.opt_arrow2 = MyOptionMenu2(top, arrow2, command = self.set_arrow,
                                        args = 2, entry_type = 'image',
                                        highlightthickness = 0)
        self.opt_arrow2.grid(row = 3, column = 1, sticky = 'ew', ipady = 2)
        self.arrow_gc = gc
        self.arrow_bitmap = bitmap

        self.opt_join = MyOptionMenu2(top, [(pixmaps.JoinMiter, JoinMiter),
                                            (pixmaps.JoinRound, JoinRound),
                                            (pixmaps.JoinBevel, JoinBevel)],
                                      command = self.set_line_join,
                                      entry_type = 'bitmap',
                                      highlightthickness = 0)
        self.opt_join.grid(row = 4, column = 0, sticky = 'ew')

        self.opt_cap = MyOptionMenu2(top,
                                     [(pixmaps.CapButt, CapButt),
                                      (pixmaps.CapRound, CapRound),
                                      (pixmaps.CapProjecting, CapProjecting)],
                                     command = self.set_line_cap,
                                     entry_type = 'bitmap',
                                     highlightthickness = 0)
        self.opt_cap.grid(row = 4, column = 1, sticky = 'ew')
        self.opt_cap.SetValue(None)