def __init__(self, master, app): CNCRibbon.PageFrame.__init__(self, master, "Tools", app) self.tools = app.tools b = Button(self, text=_("Execute"), image=Utils.icons["gear"], compound=LEFT, foreground="DarkRed", activeforeground="DarkRed", activebackground="LightYellow", font=_EXE_FONT, command=self.execute) b.pack(side=TOP, fill=X) self.tools.addButton("exe",b) self.toolList = tkExtra.MultiListbox(self, ((_("Name"), 16, None), (_("Value"), 24, None)), header = False, stretch = "last", background = "White") self.toolList.sortAssist = None self.toolList.pack(side=BOTTOM, fill=BOTH, expand=YES) self.toolList.bindList("<Double-1>", self.edit) self.toolList.bindList("<Return>", self.edit) self.toolList.bindList("<Key-space>", self.edit) # self.toolList.bindList("<Key-space>", self.commandFocus) # self.toolList.bindList("<Control-Key-space>", self.commandFocus) self.toolList.lists[1].bind("<ButtonRelease-1>", self.edit) self.tools.setListbox(self.toolList) self.addWidget(self.toolList) app.tools.active.trace('w',self.change) self.change()
def __init__(self, master, app): CNCRibbon.PageFrame.__init__(self, master, "Tools", app) self.tools = OCV.TK_MAIN.tools paned = Tk.PanedWindow(self, orient=Tk.VERTICAL) paned.pack(expand=Tk.YES, fill=Tk.BOTH) frame = Tk.Frame(paned) paned.add(frame) b = Tk.Button(frame, text=_("Execute"), image=OCV.icons["gear"], compound=Tk.LEFT, foreground="DarkRed", activeforeground="DarkRed", activebackground=OCV.COLOR_ACTIVE, font=OCV.FONT_EXE, command=self.execute) b.pack(side=Tk.TOP, fill=Tk.X) self.tools.addButton("exe", b) self.toolList = tkExtra.MultiListbox( frame, ((_("Name"), 24, None), (_("Value"), 12, None)), height=20, header=False, stretch="last", background=tkExtra.GLOBAL_CONTROL_BACKGROUND) self.toolList.sortAssist = None self.toolList.pack(fill=Tk.BOTH, expand=Tk.YES) self.toolList.bindList("<Double-1>", self.help) self.toolList.bindList("<Return>", self.edit) self.toolList.bindList("<Key-space>", self.edit) # self.toolList.bindList("<Key-space>", self.commandFocus) # self.toolList.bindList("<Control-Key-space>", self.commandFocus) self.toolList.listbox(1).bind("<ButtonRelease-1>", self.edit) self.tools.setListbox(self.toolList) self.addWidget(self.toolList) frame = Tk.Frame(paned) paned.add(frame) toolHelp = Tk.Text(frame, width=20, height=5) toolHelp.pack(side=Tk.LEFT, expand=Tk.YES, fill=Tk.BOTH) scroll = Tk.Scrollbar(frame, command=toolHelp.yview) scroll.pack(side=Tk.RIGHT, fill=Tk.Y) toolHelp.configure(yscrollcommand=scroll.set) self.addWidget(toolHelp) toolHelp.config(state=Tk.DISABLED) self.tools.setWidget("paned", paned) self.tools.setWidget("toolHelpFrame", frame) self.tools.setWidget("toolHelp", toolHelp) OCV.TK_MAIN.tools.active.trace('w', self.change) self.change()
def __init__(self, master, app, tools): Frame.__init__(self, master) self.app = app self.tools = tools f = Frame(self) f.pack(side=TOP, fill=X) self.combo = tkExtra.Combobox(f, True, #foreground="DarkBlue", background="White", command=self.change) self.combo.pack(side=LEFT, expand=YES, fill=X) b = Button(f, image=Utils.icons["x"], command=self.delete) b.pack(side=RIGHT) self.tools.addButton("del",b) b = Button(f, image=Utils.icons["clone"], command=self.clone) b.pack(side=RIGHT) self.tools.addButton("clone",b) b = Button(f, image=Utils.icons["add"], command=self.add) b.pack(side=RIGHT) self.tools.addButton("add",b) b = Button(f, image=Utils.icons["rename"], command=self.rename) b.pack(side=RIGHT) self.tools.addButton("rename",b) b = Button(self, text="Execute", image=Utils.icons["gear"], compound=LEFT, foreground="DarkRed", background="LightYellow", command=self.execute) b.pack(side=BOTTOM, fill=X) self.tools.addButton("exe",b) self.toolList = tkExtra.MultiListbox(self, (("Name", 16, None), ("Value", 24, None)), header = False, stretch = "last", background = "White") self.toolList.sortAssist = None self.toolList.pack(side=BOTTOM, fill=BOTH, expand=YES) self.toolList.bindList("<Double-1>", self.edit) self.toolList.bindList("<F2>", self.rename) self.toolList.bindList("<Return>", self.edit) # self.toolList.bindList("<Key-space>", self.commandFocus) # self.toolList.bindList("<Control-Key-space>", self.commandFocus) self.toolList.lists[1].bind("<ButtonRelease-1>", self.edit) self.tools.setListbox(self.toolList)