Exemplo n.º 1
0
    def build_dlg(self):
	top = self.top

	button = UpdatedButton(top, text = _("Close"), name = 'close',
				       command = self.close_dlg)
	button.pack(side = BOTTOM, expand = 0, fill = X)
	button = UpdatedButton(top, text = _("Apply"),
			       command = self.apply_style,
			       sensitivecb = self.can_apply)
	button.pack(side = BOTTOM, expand = 0, fill = X)
	self.Subscribe(SELECTION, button.Update)

	button = UpdatedButton(top, text = _("Delete"),
			       command = self.remove_style,
			       sensitivecb = self.can_remove)
	button.pack(side = BOTTOM, expand = 0, fill = X)

	list_frame = Frame(top)
	list_frame.pack(side = TOP, expand = 1, fill = BOTH)

	sb_vert = Scrollbar(list_frame, takefocus = 0)
	sb_vert.pack(side = RIGHT, fill = Y)
	styles = UpdatedListbox(list_frame, name = 'list')
	styles.pack(expand = 1, fill = BOTH)
	styles.Subscribe(COMMAND, self.apply_style)
	sb_vert['command'] = (styles, 'yview')
	styles['yscrollcommand'] = (sb_vert, 'set')
	self.styles = styles
Exemplo n.º 2
0
    def build_dlg(self):
        top = self.top

        list_frame = Frame(top)
        list_frame.pack(side=TOP, expand=1, fill=BOTH)

        sb_vert = Scrollbar(list_frame, takefocus=0)
        sb_vert.pack(side=RIGHT, fill=Y)
        module_list = UpdatedListbox(list_frame, name="list")
        module_list.pack(expand=1, fill=BOTH)
        module_list.Subscribe(COMMAND, self.do_reload)
        sb_vert["command"] = (module_list, "yview")
        module_list["yscrollcommand"] = (sb_vert, "set")
        self.module_list = module_list

        frame = Frame(top)
        frame.pack(side=BOTTOM, fill=X)
        for text, cmd in [
            ("Reload Module", self.do_reload),
            ("Update List", self.update_list),
            ("Close", self.close_dlg),
        ]:
            button = UpdatedButton(frame, text=text, command=cmd)
            button.pack(side=TOP, fill=X, expand=1)

        self.update_list()
Exemplo n.º 3
0
    def build_dlg(self):
	top = self.top

	var_number = DoubleVar(top)
	var_unit = StringVar(top)
	self.var_pos = LengthVar(1.0, config.preferences.default_unit,
                                 var_number, var_unit, command = self.set_pos)
	pos_frame = Frame(top)
	pos_frame.pack(side = TOP, fill = X, expand = 0)
	self.var_label = StringVar(top)
	self.var_label.set('X:')
	label = Label(pos_frame, textvariable = self.var_label)
	label.pack(side = LEFT, expand = 1, anchor = E)
	entry = MyEntry(pos_frame, textvariable = var_number,
			justify = RIGHT, width = 4,
			command = self.var_pos.UpdateNumber)
	entry.pack(side = LEFT, expand = 1, fill = X, anchor = E)
	scroll = MiniScroller(pos_frame, variable = var_number,
			      min = 0, max = None, step = 1)
	scroll.pack(side = LEFT, fill = Y)
	optmenu = create_unit_menu(pos_frame, self.set_unit,
				   variable = var_unit,
				   indicatoron = 0, width = 3)
	optmenu.pack(side = LEFT, expand = 1, fill = X, anchor = W)

	list_frame = Frame(top)
	list_frame.pack(side = TOP, expand = 1, fill = BOTH)

	sb_vert = Scrollbar(list_frame, takefocus = 0)
	sb_vert.pack(side = RIGHT, fill = Y)
	guides = UpdatedListbox(list_frame, name = 'list')
	guides.pack(expand = 1, fill = BOTH)
	guides.Subscribe(SELECTION, self.select_guide)
	sb_vert['command'] = (guides, 'yview')
	guides['yscrollcommand'] = (sb_vert, 'set')
	self.guides = guides
	self.selected = None

	frame = Frame(top)
	frame.pack(side = BOTTOM, fill = X)
	button = UpdatedButton(frame, text = _("Add H"),
			       command = self.add_guide, args = 1)
	button.pack(side = LEFT)
	button = UpdatedButton(frame, text = _("Add V"),
			       command = self.add_guide, args = 0)
	button.pack(side = LEFT)
	button = UpdatedButton(frame, text = _("Delete"),
			       command = self.del_guide)
	button.pack(side = LEFT)
	button = UpdatedButton(frame, text = _("Close"),
			       command = self.close_dlg)
	button.pack(side = RIGHT)
Exemplo n.º 4
0
    def build_dlg(self):
        top = self.top

        list_frame = Frame(top)
        list_frame.pack(side=TOP, expand=1, fill=BOTH)

        sb_vert = Scrollbar(list_frame, takefocus=0)
        sb_vert.pack(side=RIGHT, fill=Y)
        module_list = UpdatedListbox(list_frame, name='list')
        module_list.pack(expand=1, fill=BOTH)
        module_list.Subscribe(COMMAND, self.do_reload)
        sb_vert['command'] = (module_list, 'yview')
        module_list['yscrollcommand'] = (sb_vert, 'set')
        self.module_list = module_list

        frame = Frame(top)
        frame.pack(side=BOTTOM, fill=X)
        for text, cmd in [('Reload Module', self.do_reload),
                          ('Update List', self.update_list),
                          ('Close', self.close_dlg)]:
            button = UpdatedButton(frame, text=text, command=cmd)
            button.pack(side=TOP, fill=X, expand=1)

        self.update_list()
Exemplo n.º 5
0
    def build_dlg(self):
        top = self.top

        var_number = DoubleVar(top)
        var_unit = StringVar(top)
        self.var_pos = LengthVar(1.0,
                                 config.preferences.default_unit,
                                 var_number,
                                 var_unit,
                                 command=self.set_pos)
        pos_frame = Frame(top)
        pos_frame.pack(side=TOP, fill=X, expand=0)
        self.var_label = StringVar(top)
        self.var_label.set('X:')
        label = Label(pos_frame, textvariable=self.var_label)
        label.pack(side=LEFT, expand=1, anchor=E)
        entry = MyEntry(pos_frame,
                        textvariable=var_number,
                        justify=RIGHT,
                        width=4,
                        command=self.var_pos.UpdateNumber)
        entry.pack(side=LEFT, expand=1, fill=X, anchor=E)
        scroll = MiniScroller(pos_frame,
                              variable=var_number,
                              min=0,
                              max=None,
                              step=1)
        scroll.pack(side=LEFT, fill=Y)
        optmenu = create_unit_menu(pos_frame,
                                   self.set_unit,
                                   variable=var_unit,
                                   indicatoron=0,
                                   width=3)
        optmenu.pack(side=LEFT, expand=1, fill=X, anchor=W)

        list_frame = Frame(top)
        list_frame.pack(side=TOP, expand=1, fill=BOTH)

        sb_vert = Scrollbar(list_frame, takefocus=0)
        sb_vert.pack(side=RIGHT, fill=Y)
        guides = UpdatedListbox(list_frame, name='list')
        guides.pack(expand=1, fill=BOTH)
        guides.Subscribe(SELECTION, self.select_guide)
        sb_vert['command'] = (guides, 'yview')
        guides['yscrollcommand'] = (sb_vert, 'set')
        self.guides = guides
        self.selected = None

        frame = Frame(top)
        frame.pack(side=BOTTOM, fill=X)
        button = UpdatedButton(frame,
                               text=_("Add H"),
                               command=self.add_guide,
                               args=1)
        button.pack(side=LEFT)
        button = UpdatedButton(frame,
                               text=_("Add V"),
                               command=self.add_guide,
                               args=0)
        button.pack(side=LEFT)
        button = UpdatedButton(frame, text=_("Delete"), command=self.del_guide)
        button.pack(side=LEFT)
        button = UpdatedButton(frame, text=_("Close"), command=self.close_dlg)
        button.pack(side=RIGHT)