def build_tab_about(self): panel = TFrame(self.root, style='FlatFrame', borderwidth=10) self.nb.add(panel, text=_('About application')) subpanel = TFrame(panel, style='FlatFrame', borderwidth=0) subpanel.pack(side=TOP, fill=Y, expand=1) subpanel = TFrame(subpanel, style='FlatFrame', borderwidth=5) subpanel.pack(side=LEFT, anchor='center') text = TLabel(subpanel, style='FlatLabel', text=_("Illustration program for prepress")) text.pack(side=TOP, anchor=W, pady=10) from time import gmtime, strftime year = strftime("%Y", gmtime()) text = TLabel(subpanel, style='FlatLabel', text="(c)2003-%s sK1 Team" % (year)) text.pack(side=TOP, anchor=W, pady=10) text = TLabel(subpanel, style='FlatLabel', text='http://sk1project.org', foreground='blue', underline=20, cursor='hand2') text.pack(side=TOP, anchor=W) text.bind('<Button-1>', self.goToSite)
def init(self, master): PluginPanel.init(self, master) top = TFrame(self.panel, style='FlatFrame', borderwidth=7) top.pack(side = TOP, fill=BOTH) sign = TFrame(top, style='RoundedFrame', borderwidth=5) sign.pack(side=TOP) self.sign = TLabel(sign, image='color_converter') self.sign.pack(side=TOP) self.cs_name = StringVar(top) self.cs_name.set(RGB) label = TLabel(top, text=_("Colorspace:")+" ") label.pack(side = TOP, anchor=W) self.colorspaces = TCombobox(top, state='readonly', postcommand = self.set_cs, values=self.make_cs_list(), width=14, style='ComboNormal', textvariable=self.cs_name) self.colorspaces.pack(side = TOP, fill=X, pady=3) button = UpdatedButton(top, text = _("Apply"), command = self.apply_colorspace, sensitivecb = self.is_selection) button.pack(side = BOTTOM, expand = 1, fill = X, pady=3) self.Subscribe(SELECTION, button.Update) self.init_from_doc() self.subscribe_receivers()
def build_tab_license(self): panel = TFrame(self.root, style='FlatFrame', borderwidth=5) self.nb.add(panel, text=_('License')) subpanel = TFrame(panel, style='RoundedFrame', borderwidth=4) subpanel.grid(sticky=N + S + E + W) panel.rowconfigure(0, weight=1) panel.columnconfigure(0, weight=1) subpanel.rowconfigure(0, weight=1) subpanel.columnconfigure(0, weight=1) sb = TScrollbar(subpanel) sb.grid(row=0, column=1, sticky=N + S) text = Text(subpanel, highlightthickness=0, font=app.config.preferences.fixed_font, wrap=NONE) text.grid(row=0, column=0, sticky=N + S + E + W) text['yscrollcommand'] = sb.set sb['command'] = text.yview text['state'] = NORMAL import aboutdlg_lic txt = aboutdlg_lic.LICENSE text.insert(END, txt) text['state'] = DISABLED
def build_dlg(self): root = TFrame(self.top, style='FlatFrame', borderwidth = 10) root.pack(side = TOP, fill = BOTH, expand = 1) middle = TFrame(root, style='FlatFrame', borderwidth = 5) middle.pack(side = TOP, fill = X, expand = 1) label = TLabel(middle, text = _("Delete page No.:")+" ", style='FlatLabel') label.pack(side = LEFT) self.pagenum_spin = TSpinbox(middle, var=app.mw.document.active_page+1, vartype=0, textvariable = self.pagenum, min = 1, max = len(app.mw.document.pages), step = 1, width = 6, command = self.ok) self.pagenum_spin.pack(side = LEFT) if len(app.mw.document.pages)==1: self.pagenum_spin.set_state('disabled') bottom = TFrame(root, style='FlatFrame', borderwidth = 5) bottom.pack(side = BOTTOM, fill = X, expand = 1) cancel = TButton(bottom, text=_("Cancel"), command=self.cancel) cancel.pack(side = RIGHT) label = TLabel(bottom, text = ' ', style='FlatLabel') label.pack(side = RIGHT) ok = TButton(bottom, text=_("OK"), command=self.ok) ok.pack(side = RIGHT) self.focus_widget = ok self.top.bind('<Escape>', self.cancel) self.top.protocol('WM_DELETE_WINDOW', self.cancel) self.top.resizable (width=0, height=0)
def __init__(self, parent, **kw): TFrame.__init__(self, parent, style='FlatFrame', **kw) spot_frame = TFrame(self, borderwidth=2, style='FlatFrame') spot_frame.pack(side=TOP) label = TLabel(spot_frame, text=_('Color name:'), justify=LEFT) label.pack(side=TOP) self.colorname_value = StringVar('') self.colorname = TEntrybox(spot_frame, text='', width=25, textvariable=self.colorname_value) self.colorname.set_state('readonly') self.colorname.pack(side=BOTTOM, fill=X) cmyk_frame = TFrame(self, borderwidth=2, style='FlatFrame') cmyk_frame.pack(side=TOP) self.CMYK_label = TLabel(cmyk_frame, text='C:\nM:\nY:\nK:', justify=LEFT) self.CMYK_label.pack(side=LEFT, padx=10) self.RGB_label = TLabel(cmyk_frame, text='R:\nG:\nB:', justify=LEFT) self.RGB_label.pack(side=LEFT, padx=10) self.HTML_label = TLabel(self, text='HTML:', justify=LEFT) self.HTML_label.pack(side=BOTTOM, pady=5)
def init(self, master): PluginPanel.init(self, master) top = TFrame(self.panel, style='FlatFrame', borderwidth=5) top.pack(side = TOP, fill=BOTH) sign = TFrame(top, style='RoundedFrame', borderwidth=5) sign.pack(side = TOP) self.sign=TLabel(sign, image='shaping_trim') self.sign.pack(side=TOP) button = UpdatedButton(top, text = _("Apply"), command = self.apply_action, sensitivecb = self.is_correct_selection) button.pack(side = BOTTOM, expand = 1, fill = X) self.Subscribe(SELECTION, button.Update) button_frame = TFrame(top, style='FlatFrame', borderwidth=1) button_frame.pack(side = BOTTOM, fill=X, pady=5) self.var_originals = IntVar(top) self.var_originals.set(0) self.autoupdate_check = TCheckbutton(button_frame, text = _("Leave originals"), variable = self.var_originals) self.autoupdate_check.pack(side = LEFT, anchor=W, padx=10) self.init_from_doc() self.subscribe_receivers()
def init(self, master): PluginPanel.init(self, master) top = self.panel grid_top = TFrame(top, borderwidth=2, style='FlatFrame') grid_top.pack(side=TOP, expand=1, fill=X) button_frame = self.create_std_buttons(top) button_frame.pack(side=BOTTOM, fill=BOTH, expand=1) # =========================================================== do_apply = self.do_apply label = TLabel(top, text=" " + _("Grid origin") + " ", style="FlatLabel") label.pack() frame = TLabelframe(top, labelwidget=label, style='Labelframe', borderwidth=4) frame.pack(side=TOP, fill=X, pady=4, padx=2) f = TFrame(frame, style='FlatFrame') self.var_xorig = create_length_entry(top, f, do_apply) label = TLabel(f, text="X: ", anchor=E) label.pack(side=RIGHT, fill=X) f.pack(side=TOP, fill=X, pady=2) f = TFrame(frame, style='FlatFrame') self.var_yorig = create_length_entry(top, f, do_apply) label = TLabel(f, text="Y: ", anchor=E) label.pack(side=RIGHT, fill=X) f.pack(side=TOP, fill=X, pady=2) # =========================================================== label = TLabel(top, text=" " + _("Grid size") + " ", style="FlatLabel") label.pack() frame = TLabelframe(top, labelwidget=label, style='Labelframe', borderwidth=4) frame.pack(side=TOP, fill=X, pady=4, padx=2) f = TFrame(frame, style='FlatFrame') self.var_xwidth = create_length_entry(top, f, do_apply) label = TLabel(f, text="ΔX: ", anchor=E) label.pack(side=RIGHT, fill=X) f.pack(side=TOP, fill=X, pady=2) f = TFrame(frame, style='FlatFrame') self.var_ywidth = create_length_entry(top, f, do_apply) label = TLabel(f, text="ΔY: ") label.pack(side=RIGHT, fill=X) f.pack(side=TOP, fill=X, pady=2) app.mw.docmanager.activedoc.Subscribe(GRID, self.init_from_doc) app.mw.Subscribe(DOCUMENT, self.init_from_doc) self.init_from_doc()
def init(self, master): self.master = master self.mw = app.mw self.pcontainer = self.master.master self.document = self.mw.document TFrame.__init__(self, self.master, style='FlatFrame', borderwidth=0) self.top = TFrame(self, style='PWinHead', borderwidth=3) self.panel = TFrame(self, style='PWinBody', borderwidth=3) self.activated = 1 self.visible = 1 self.packed = 1 for item in self.pcontainer.loaded: if not item.collapsed: item.collapse_panel() self.pack(side=TOP, fill=self.fill, expand=self.expand, padx=1, pady=1) self.top.pack(side=TOP, fill=X) self.panel.pack(side=TOP, fill=BOTH, expand=1) self.iconlabel = TLabel(self.top, style='PWLabel', image=self.icon) self.textlabel = TLabel(self.top, style='PWLabel', text=self.title, anchor=W) if not 'bold' in self.textlabel['font'].split(): self.textlabel['font'] += ' bold' self.closebut = TButton(self.top, style='PWButton', image='close_pw', command=self.close_panel) self.collapsebut = TButton(self.top, style='PWButton', image='minimize_pw', command=self.click) self.iconlabel.pack(side=LEFT, padx=2) self.textlabel.pack(side=LEFT, fill=BOTH, expand=1, padx=3) self.closebut.pack(side=RIGHT) self.collapsebut.pack(side=RIGHT) self.textlabel.bind("<Button-1>", self.click) self.mw.Subscribe(DOCUMENT, self.doc_changed)
def init(self, master): PluginPanel.init(self, master) self.initial_color = self.default_color self.current_color = copy.copy(self.initial_color) top = TFrame(self.panel, style='FlatFrame', borderwidth=5) top.pack(side=TOP, fill=BOTH) self.selector = ColorSpaceSelector(top, self.refresh_widgets, self.current_color, self.sign) self.selector.pack(side=TOP, expand=1, fill=X) self.picker = ColorChooserWidget(top, self.refresh_widgets, self.current_color) self.picker.pack(side=TOP, expand=1, fill=X) self.digitizer = ColorDigitizer(top, self.refresh_widgets, self.current_color) self.digitizer.pack(side=TOP, expand=1, fill=X) button = UpdatedButton(top, text=_("Apply"), command=self.apply_pattern, sensitivecb=self.is_selection) button.pack(side=BOTTOM, expand=1, fill=X) self.Subscribe(SELECTION, button.Update) button_frame = TFrame(top, style='FlatFrame', borderwidth=1) button_frame.pack(side=BOTTOM, fill=X, pady=5) button = TButton(button_frame, style='TSmallbutton', text=' ', image='small_colorpicker', command=self.copy_from) button.pack(side=LEFT) tooltips.AddDescription(button, _("Copy From...")) button = TButton(button_frame, style='TSmallbutton', text=' ', image='restore_color', command=self.restore_color) button.pack(side=LEFT, padx=5) tooltips.AddDescription(button, _("Restore color")) self.var_autoupdate = IntVar(top) self.var_autoupdate.set(1) self.autoupdate_check = TCheckbutton(button_frame, text=_("Auto Update"), variable=self.var_autoupdate, command=self.init_from_doc) self.autoupdate_check.pack(side=RIGHT, anchor=W, padx=10) self.init_from_doc() self.subscribe_receivers()
def init(self, master): PluginPanel.init(self, master) top = TFrame(self.panel, style='FlatFrame', borderwidth=5) top.pack(side=TOP, fill=BOTH) sign = TFrame(top, style='RoundedFrame', borderwidth=5) sign.pack(side=TOP) self.sign = TLabel(sign, image='effects_blend') self.sign.pack(side=TOP) button_frame = TFrame(top, style='FlatFrame') button_frame.pack(side=BOTTOM, fill=BOTH, expand=1) self.update_buttons = [] button = UpdatedButton(top, text=_("Apply"), command=self.apply_blend, sensitivecb=self.doc_can_blend) button.pack(in_=button_frame, side=LEFT, expand=1, fill=X) self.document.Subscribe(SELECTION, button.Update) self.update_buttons.append(button) steps_frame = TFrame(top, style='FlatFrame', borderwidth=15) steps_frame.pack(side=TOP) label = TLabel(steps_frame, text=" " + _("Steps:") + " ") label.pack(side=LEFT, anchor=E) self.var_steps = IntVar(top) self.var_steps.set(config.preferences.blend_panel_default_steps) self.entry = TSpinbox(steps_frame, var=10, vartype=0, textvariable=self.var_steps, min=1, max=100000, step=1, width=6, command=self.apply_blend) self.entry.pack(side=LEFT, anchor=E) button = UpdatedButton(top, text=_("Select Start"), sensitivecb=self.can_select, command=self.select_control, args=SelectStart) button.pack(side=BOTTOM, fill=X, expand=1, pady=3) self.document.Subscribe(SELECTION, button.Update) self.update_buttons.append(button) button = UpdatedButton(top, text=_("Select End"), sensitivecb=self.can_select, command=self.select_control, args=SelectEnd) button.pack(side=BOTTOM, fill=X, expand=1) self.document.Subscribe(SELECTION, button.Update) self.update_buttons.append(button) self.init_from_doc() self.subscribe_receivers()
def build_dlg(self): root = self.top top = TFrame(root, borderwidth=5, style='FlatFrame') top.pack(side=TOP, expand=0, fill=BOTH) top2 = TFrame(top, style='FlatFrame') top2.pack(side=TOP, expand=0, fill=X) format_label = TLabel(top2, text=_('Style name:'), borderwidth=0) format_label.pack(side=LEFT, pady=3) self.entry_name = TEntrybox(top, command=self.ok, width=15) self.entry_name.pack(side=TOP, fill=X) top2 = TFrame(top, height=5, style='FlatFrame') top2.pack(side=TOP, expand=0, fill=X) prop_cont = TLabelframe(top, text=_('Style properties'), padding=10) prop_cont.pack(side=TOP, fill=X) properties = self.object.Properties() self.flags = {} for prop in property_names: type = property_types[prop] if type == FillProperty: state = self.object.has_fill and NORMAL or DISABLED elif type == LineProperty: state = self.object.has_line and NORMAL or DISABLED elif type == FontProperty: state = self.object.has_font and NORMAL or DISABLED else: # unknown property type! continue long, short = property_titles[prop] self.flags[prop] = var = IntVar(root) var.set(state == NORMAL) radio = TCheckbutton(prop_cont, text=long, state=state, variable=var) radio.pack(side=TOP, anchor=W) top2 = TFrame(top, height=3, style='FlatFrame') top2.pack(side=TOP, expand=0, fill=X) but_frame = Frame(top) but_frame.pack(side=TOP, fill=X) button = TButton(but_frame, text=_("Cancel"), command=self.cancel) button.pack(side=RIGHT, padx=5) button = TButton(but_frame, text=_("OK"), command=self.ok) button.pack(side=RIGHT, padx=5) root.resizable (width=0, height=0) self.entry_name.set_focus()
def __init__(self, parent, callback, color=None, **kw): TFrame.__init__(self, parent, style='FlatFrame', **kw) frame = TFrame(self, style="RoundedFrame", borderwidth=5) frame.pack(side=LEFT) self.viewxy = ChooseRGBXY(frame, callback, xyramp_size[0], xyramp_size[1], 0, 1) self.viewxy.pack(side=LEFT) frame = TFrame(self, style="RoundedFrame", borderwidth=5) frame.pack(side=LEFT) self.viewz = ChooseRGBZ(frame, callback, zramp_size[0], zramp_size[1], 2) self.viewz.pack(side=LEFT)
def __init__(self, master, **opts): if not opts.has_key('yscrollincrement'): opts['yscrollincrement'] = 20 self.master = master self.frame = TFrame(master, style="FlatFrame") self.frame.rowconfigure(0, weight=1) self.frame.columnconfigure(0, weight=1) self.canvas = Canvas(self.frame, **opts) self.canvas.grid(row=0, column=0, sticky="nsew") self.vbar = TScrollbar(self.frame, name="vbar") self.vbar.grid(row=0, column=1, sticky="nse") self.hbar = TScrollbar(self.frame, name="hbar", orient="horizontal") self.hbar.grid(row=1, column=0, sticky="ews") self.canvas['yscrollcommand'] = lambda f, l: self.scroll_sh( self.vbar, f, l) self.vbar['command'] = self.canvas.yview self.canvas['xscrollcommand'] = lambda f, l: self.scroll_sh( self.hbar, f, l) self.hbar['command'] = self.canvas.xview self.canvas.bind("<Key-Prior>", self.page_up) self.canvas.bind("<Key-Next>", self.page_down) self.canvas.bind("<Key-Up>", self.unit_up) self.canvas.bind("<Key-Down>", self.unit_down) self.canvas.bind("<Alt-Key-2>", self.zoom_height) self.canvas.bind("<Button-4>", self.unit_up) self.canvas.bind("<Button-5>", self.unit_down) self.canvas.focus_set()
def build_dlg(self): parent = TFrame(self.top, style='FlatFrame', borderwidth=10) parent.pack(side=TOP, fill=BOTH, expand=1) bwpanel = BrowsePanel(parent, self, style='FlatFrame') bwpanel.pack(side=TOP, fill=X, expand=0) Frame(parent, relief='flat', height=5).pack(side=TOP, fill=X, expand=0) cmdpanel = CommandPanel(parent, self, style='FlatFrame') cmdpanel.pack(side=BOTTOM, fill=X, expand=0) Frame(parent, relief='flat', height=5).pack(side=BOTTOM, fill=X, expand=0) places = PlacesPanel(parent, self, borderwidth=3) places.pack(side=LEFT, fill=Y, expand=0) Frame(parent, relief='flat', width=5).pack(side=LEFT, fill=Y, expand=0) filepnl = FilePanel(parent, self, clr='white') filepnl.pack(side=TOP, fill=BOTH, expand=1) self.top.bind('<Escape>', self.cancel) self.top.protocol('WM_DELETE_WINDOW', self.cancel)
def __init__(self, master=None, min=0, max=100, step=1, textvariable=None, var=0, vartype=0, command=None, state=NORMAL, width=5, args=(), **kw): '''vartype=0 - integer vartype=1 - float ''' self.min_value = min self.max_value = max self.step = step self.variable = var self.vartype = vartype if textvariable: self.text_var = textvariable else: self.text_var = StringVar() self.command = command self.state = state self.width = width apply(TFrame.__init__, (self, master), kw) self["style"] = "FlatFrame" self.entry = TEntryExt(self, textvariable=self.text_var, width=self.width, style='SpinEntry') self.entry.pack(side=LEFT, expand=1, fill=BOTH) self.button_frame = TFrame(self, style="FlatFrame") self.button_frame.pack(side=LEFT, fill=Y) self.up_button = TButton(self.button_frame, class_='Repeater', command=self.increase, image='pal_arrow_up', style='SpinUpButton', takefocus=0) self.up_button.pack(side=TOP) self.down_button = TButton(self.button_frame, class_='Repeater', command=self.decrease, image='pal_arrow_down', style='SpinDownButton', takefocus=0) self.down_button.pack(side=TOP) if self.vartype == 1: self.variable = float(self.variable) else: self.variable = int(self.variable) self.text_var.set(str(self.variable)) self.entry.bind('<Button-4>', self.wheel_increase) self.entry.bind('<Button-5>', self.wheel_decrease) self.entry.bind('<Key-Up>', self.wheel_increase) self.entry.bind('<Key-Down>', self.wheel_decrease) self.entry.bind('<Key-Return>', self.apply_command) self.entry.bind('<Key-KP_Enter>', self.apply_command)
def __init__(self, parent, color=None, **kw): TFrame.__init__(self, parent, style='FlatFrame', **kw) frame = TFrame(self, style="RoundedFrame", borderwidth=5) frame.pack(side=LEFT) self.color_monitor = Canvas(frame, width=100, height=50, relief='flat') self.color_monitor.pack(side=TOP)
def __init__(self, parent): self.receivers = {} self.parent = parent self.mw = self.parent.mainwindow self.doc = self.parent.mainwindow.document self.panel = TFrame(parent.panel, style='FlatFrame', borderwidth=0) self.separator = TLabel(self.panel, image="toolbar_sep") self.mw.Subscribe(DOCUMENT, self.doc_changed) self.setNormal()
def build_dlg(self): root = self.top top = TFrame(root, style='FlatFrame', borderwidth=10) top.pack(side=TOP, fill=BOTH, expand=1) frame = TFrame(top, name='top', style='FlatFrame') frame.pack(side=TOP, fill=BOTH, expand=1) label = TLabel(frame, image='messagebox_' + self.image, style='FlatLabel') label.pack(side=LEFT, padx=5, pady=5) label = TLabel(frame, text=self.message, name='msg', style='FlatLabel', justify='center', anchor='center') label.pack(side=RIGHT, fill=BOTH, expand=1) frame = TFrame(top, name='bot', style='FlatFrame') frame.pack(side=BOTTOM) #, fill = X, expand = 1) command = self.ok for i in range(len(self.buttons)): button = UpdatedButton(frame, text=' ' + self.buttons[i] + ' ', command=command, args=i) button.grid(column=i, row=0, sticky='ew', padx=10, pady=0) if i == self.default: if TkVersion >= 8.0: button['default'] = 'active' self.focus_widget = button else: if TkVersion >= 8.0: button['default'] = 'normal' if self.default is not None: top.bind('<Return>', self.invoke_default) frame = TFrame(top, name='mid', style='FlatFrame', borderwidth=1) frame.pack(side=TOP, fill=X) root.resizable(width=0, height=0)
def __init__(self, parent, anchor='C', command = None, **kw): TFrame.__init__(self, parent, style='FlatFrame', **kw) self.command = command self.anchor = anchor #--------------------------------------------------------- # Basepoint check # NW -- N -- NE # | | | # W -- C -- E # | | | # SW -- S -- SE # # USER - basepoint frame=TFrame(self, style='FlatFrame') frame.pack(side = TOP, fill = BOTH) radio = UpdatedRadiobutton(frame, value = 'NW',variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) radio = UpdatedRadiobutton(frame, value = 'N', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) radio = UpdatedRadiobutton(frame, value = 'NE', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) frame=TFrame(self, style='FlatFrame') frame.pack(side = TOP, fill = BOTH) radio = UpdatedRadiobutton(frame, value = 'W', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) radio = UpdatedRadiobutton(frame, value = 'C', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) radio = UpdatedRadiobutton(frame, value = 'E', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) frame=TFrame(self, style='FlatFrame') frame.pack(side = TOP, fill = BOTH) radio = UpdatedRadiobutton(frame, value = 'SW', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) radio = UpdatedRadiobutton(frame, value = 'S', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W) radio = UpdatedRadiobutton(frame, value = 'SE', variable = self.anchor, command = self.command) radio.pack(side=LEFT, anchor=W)
def build_dlg(self): self.root = TFrame(self.top, style='FlatFrame', borderwidth=5) self.root.pack(side=TOP, fill=BOTH, expand=1) panel = TFrame(self.root, style='FlatFrame', borderwidth=5) panel.pack(side=TOP, fill=X) icon = TLabel(panel, style='FlatLabel', image='icon_sk1_48') icon.pack(side=LEFT, padx=5, pady=5) panel = TFrame(panel, style='FlatFrame', borderwidth=5) panel.pack(side=LEFT) text = TLabel(panel, style='FlatLabel', text='sK1 v.%s' % app.sKVersion, font=app.config.preferences.large_font + ' bold') text.pack(side=TOP, anchor=W) text = TLabel( panel, style='FlatLabel', text=_('Uses libraries: Tcl/Tk %s; Python %s; LCMS %s') % (TclVersion, string.split(sys.version)[0], cms.get_version())) text.pack(side=TOP, anchor=W) self.nb = TNotebook(self.root, height=150, width=500, padding=5) self.nb.pack(side=TOP, fill=BOTH, expand=1) self.build_tab_about() self.build_tab_authors() self.build_tab_localization() self.build_tab_license() ok = TButton(self.root, text=_("Close"), command=self.ok) ok.pack(side=RIGHT, padx=5, pady=5) self.focus_widget = ok self.top.bind('<Escape>', self.cancel) self.top.protocol('WM_DELETE_WINDOW', self.cancel) self.top.resizable(width=0, height=0)
def init(self, master): PluginPanel.init(self, master) top = TFrame(self.panel, style='FlatFrame', borderwidth=5) top.pack(side=TOP, fill=BOTH) sign = TFrame(top, style='RoundedFrame', borderwidth=5) sign.pack(side=TOP) self.sign = TLabel(sign, image='messagebox_construct') self.sign.pack(side=TOP) button = UpdatedButton(top, text=_("Apply"), command=self.apply_action, sensitivecb=self.is_correct_selection) button.pack(side=BOTTOM, expand=1, fill=X) self.Subscribe(SELECTION, button.Update) self.init_from_doc() self.subscribe_receivers()
def init(self, master): PluginPanel.init(self, master) top = self.panel ctheme = app.uimanager.currentColorTheme self.browserframe = TFrame(top, style='RoundedFrame', borderwidth=5) self.browserframe.pack(side=TOP, fill=BOTH, expand=1) self.scanvas = ScrolledCanvas(self.browserframe, bg=ctheme.editfieldbackground, height=150, width=170) self.scanvas.frame.pack(side=TOP, fill=BOTH, expand=1) self.after_idle(self.rebuild_pb)
def __init__(self, parent, mainwindow): self.parent = parent self.mainwindow = mainwindow self.doc = self.mainwindow.document self.panel = TFrame(self.parent, name='ctxPanel', style='ToolBarFrame', borderwidth=2) label = TLabel(self.panel, image="toolbar_left") label.pack(side=LEFT) self.initPanels() self.mainwindow.Subscribe(DOCUMENT, self.doc_changed) self.ReSubscribe() self.changeContent(forPage)
def build_dlg(self): root = self.top top = TFrame(root, style='FlatFrame', borderwidth=13) top.pack(side=TOP) label = TLabel(top, text=_("Please select the object categories whose\n default properties you want to change")) label.pack(side=TOP, anchor=W) frame = TFrame(top, style='FlatFrame', borderwidth=10) frame.pack(side=TOP) self.var_graphics_style = IntVar(top) self.var_graphics_style.set(0) if self.category != 'font': self.var_graphics_style.set(1) button = TCheckbutton(frame, text=_("Graphics Objects"), state=(self.category == 'font' and DISABLED or NORMAL), variable=self.var_graphics_style) button.pack(side=TOP, anchor=W) self.var_text_style = IntVar(top) self.var_text_style.set(0) if self.category == 'font': self.var_text_style.set(1) button = TCheckbutton(frame, text=_("Text Objects"), state=(self.category == 'line' and DISABLED or NORMAL), variable=self.var_text_style) button.pack(side=TOP, anchor=W) label = TLabel(top, style="HLine") label.pack(side=TOP, fill=BOTH) but_frame = TFrame(top, style='FlatFrame') but_frame.pack(side=TOP, fill=BOTH, expand=1) button = TButton(but_frame, text=_("Cancel"), command=self.cancel) button.pack(side=RIGHT, expand=1) button = TButton(but_frame, text=_("OK"), command=self.ok) button.pack(side=RIGHT, expand=1) root.resizable (width=0, height=0)
def __init__(self, parent, toplevel, size=300, orient=LEFT, min=200, max=500, cnf={}, **kw): TFrame.__init__(self, parent, style='FlatFrame', **kw) self.parent = parent self.panel = TFrame(self, style='FlatFrame') self.orient = orient self.min = min self.max = max self.size = size self.toplevel = toplevel self.canv_size = 0 self.counter = 0 if orient in [LEFT, RIGHT]: self.spacer = Frame(self, width=size, height=1) self.grip = TButton(self, style='VGrip', cursor=appconst.CurHResize) if orient == LEFT: self.spacer.pack(side=TOP) self.grip.pack(side=LEFT, fill=Y) self.panel.pack(side=RIGHT, fill=BOTH, expand=1) else: self.spacer.pack(side=TOP) self.grip.pack(side=RIGHT, fill=Y) self.panel.pack(side=LEFT, fill=BOTH, expand=1) else: self.spacer = Frame(self, width=1, height=size) self.grip = TButton(self, style='HGrip', cursor=appconst.CurVResize) if orient == BOTTOM: self.grip.pack(side=BOTTOM, fill=X) self.spacer.pack(side=RIGHT) self.panel.pack(side=LEFT, fill=BOTH, expand=1) else: self.grip.pack(side=TOP, fill=X) self.spacer.pack(side=RIGHT) self.panel.pack(side=LEFT, fill=BOTH, expand=1) self.grip.bind("<Button-1>", self.start) self.grip.bind("<ButtonRelease-1>", self.stop)
def build_tab_authors(self): panel = TFrame(self.root, style='FlatFrame', borderwidth=5) self.nb.add(panel, text=_('Authors')) subpanel = TFrame(panel, style='RoundedFrame', borderwidth=4) subpanel.grid(sticky=N + S + E + W) panel.rowconfigure(0, weight=1) panel.columnconfigure(0, weight=1) subpanel.rowconfigure(0, weight=1) subpanel.columnconfigure(0, weight=1) sb = TScrollbar(subpanel) sb.grid(row=0, column=1, sticky=N + S) text = Text(subpanel, bg='white', highlightthickness=0, wrap=NONE) text.grid(row=0, column=0, sticky=N + S + E + W) text['yscrollcommand'] = sb.set sb['command'] = text.yview txt = _( '\nTo report bugs please use project bugtracker: https://bugs.launchpad.net/sk1/\n\n' ) txt += _( 'Igor Novikov\n [email protected]\n Project Leader\n\n') txt += _( 'Maxim Barabash\n [email protected]\n Designer\n\n') txt += _('Acknowledgments:\n=======================================\n') txt += _('Valek Fillipov\n CDR format reverse engineering\n\n') txt += _( 'Alexandre Prokoudine\n [email protected]\n Information support (http://linuxgraphics.ru)' ) text['state'] = NORMAL text.insert(END, txt) text['state'] = DISABLED
def build_tab_localization(self): panel = TFrame(self.root, style='FlatFrame', borderwidth=5) self.nb.add(panel, text=_('Localization')) subpanel = TFrame(panel, style='RoundedFrame', borderwidth=4) subpanel.grid(sticky=N + S + E + W) panel.rowconfigure(0, weight=1) panel.columnconfigure(0, weight=1) subpanel.rowconfigure(0, weight=1) subpanel.columnconfigure(0, weight=1) sb = TScrollbar(subpanel) sb.grid(row=0, column=1, sticky=N + S) text = Text(subpanel, bg='white', highlightthickness=0, wrap=NONE) text.grid(row=0, column=0, sticky=N + S + E + W) text['yscrollcommand'] = sb.set sb['command'] = text.yview text['state'] = NORMAL text.insert(END, TRANSLATORS) text['state'] = DISABLED
def build_dlg(self): root = TFrame(self.top, style='FlatFrame', borderwidth=10) root.pack(side=TOP, fill=BOTH, expand=1) label = TLabel(root, text='', style='FlatLabel', textvariable=info1) label.pack(side=TOP, anchor=W, pady=5) label = TLabel(root, text='', style='FlatLabel', textvariable=info2) label.pack(side=TOP, anchor=W, pady=5) self.prgrs = TProgressbar(root, orient='horizontal', style='Horizontal.Progress', length=450, value=10, variable=info3) self.prgrs.pack(side=TOP, anchor=W) self.top.protocol('WM_DELETE_WINDOW', self.cancel) self.top.resizable(width=0, height=0)
def __init__(self, parent, mainwindow): self.parent = parent self.mainwindow = mainwindow TFrame.__init__(self, self.parent, name='pagerPanel', style='FlatFrame', borderwidth=0) top_border = TLabel(self, style='FlatLabel', image='space_1') top_border.pack(side=TOP, fill=X) self.container = TFrame(self, style='FlatFrame', borderwidth=0) space = TLabel(self.container, style='FlatLabel', image='space_3') space.pack(side=LEFT, fill=Y) self.home_but = TButton(self.container, style='PagerHome', command=self.PageHome) self.home_but.pack(side=LEFT) self.home_but = TButton(self.container, style='PagerPrevious', command=self.PagePrevious) self.home_but.pack(side=LEFT) self.text = TLabel(self.container, style='FlatLabel', text=' ' + _('Page 2 of 2') + ' ') self.text.pack(side=LEFT) self.home_but = TButton(self.container, style='PagerNext', command=self.PageNext) self.home_but.pack(side=LEFT) self.home_but = TButton(self.container, style='PagerEnd', command=self.PageEnd) self.home_but.pack(side=LEFT) space = TLabel(self.container, style='FlatLabel', image='space_3') space.pack(side=LEFT, fill=Y) self.mainwindow.Subscribe(DOCUMENT, self.Resubscribe) self.Resubscribe() self.doc_paged() self.text.bind('<Double-Button-1>', self.GoToPage)
def build_dlg(self): root = self.top top = TFrame(root, borderwidth=2, style='FlatFrame') top.pack(side=TOP, expand=0, fill=BOTH) top2 = TFrame(top, height=3, style='FlatFrame') top2.pack(side=BOTTOM, expand=0, fill=X) button = UpdatedButton(top, text=_("Apply style"), command=self.apply_style, sensitivecb=self.can_apply, width=15) button.pack(side=BOTTOM, expand=0) self.Subscribe(SELECTION, button.Update) top2 = TFrame(top, height=3, style='FlatFrame') top2.pack(side=BOTTOM, expand=0, fill=X) button = UpdatedButton(top, text=_("Delete style"), command=self.remove_style, sensitivecb=self.can_remove, width=15) button.pack(side=BOTTOM, expand=0) top2 = TFrame(top, height=3, style='FlatFrame') top2.pack(side=BOTTOM, expand=0, fill=X) button = UpdatedButton(top, text=_("Create new style"), command=self.CreateStyleFromSelection, sensitivecb=self.main_window.document.CanCreateStyle, width=15) button.pack(side=BOTTOM, expand=0) self.Subscribe(SELECTION, button.Update) top2 = TFrame(top, height=5, style='FlatFrame') top2.pack(side=BOTTOM, expand=0, fill=X) list_frame = TFrame(top, style="RoundedFrame", borderwidth=5) list_frame.pack(side=TOP, expand=1, fill=BOTH) sb_vert = TScrollbar(list_frame, takefocus=0) sb_vert.pack(side=RIGHT, fill=Y) styles = UpdatedListbox(list_frame, bg='white', borderwidth=0, selectborderwidth=0) 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 root.resizable(width=0, height=0)