def __init__(self, master, app): CNCRibbon.ButtonGroup.__init__(self, master, N_("Select"), app) self.grid3rows() # --- col, row = 0, 0 b = Ribbon.LabelButton(self.frame, app, "<<SelectAll>>", image=Utils.icons["select_all"], text=_("All"), compound=LEFT, anchor=W, background=Ribbon._BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=NSEW) tkExtra.Balloon.set(b, _("Select all blocks [Ctrl-A]")) self.addWidget(b) # --- col += 1 b = Ribbon.LabelButton(self.frame, app, "<<SelectNone>>", image=Utils.icons["select_none"], text=_("None"), compound=LEFT, anchor=W, background=Ribbon._BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=NSEW) tkExtra.Balloon.set(b, _("Unselect all blocks [Ctrl-Shift-A]")) self.addWidget(b) # --- col, row = 0, 1 b = Ribbon.LabelButton(self.frame, app, "<<SelectInvert>>", image=Utils.icons["select_invert"], text=_("Invert"), compound=LEFT, anchor=W, background=Ribbon._BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=NSEW) tkExtra.Balloon.set(b, _("Invert selection [Ctrl-I]")) self.addWidget(b) # --- col += 1 b = Ribbon.LabelButton(self.frame, app, "<<SelectLayer>>", image=Utils.icons["select_layer"], text=_("Layer"), compound=LEFT, anchor=W, background=Ribbon._BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=NSEW) tkExtra.Balloon.set(b, _("Select all blocks from current layer")) self.addWidget(b) # --- col, row = 0, 2 self.filterString = tkExtra.LabelEntry(self.frame, "Filter", "DarkGray", background="White", width=16) self.filterString.grid(row=row, column=col, columnspan=2, padx=0, pady=0, sticky=NSEW) tkExtra.Balloon.set(self.filterString, _("Filter blocks")) self.addWidget(self.filterString) self.filterString.bind("<Return>", self.filter) self.filterString.bind("<KP_Enter>", self.filter)
def __init__(self, master, app): CNCRibbon.ButtonMenuGroup.__init__( self, master, N_("Select"), app, [(_("Show statistics for enabled gcode"), "stats", lambda a=app: a.event_generate("<<ShowStats>>")), (_("Show cutting information on selected blocks [Ctrl-n]"), "info", lambda a=app: a.event_generate("<<ShowInfo>>"))]) self.grid3rows() col, row = 0, 0 b = Ribbon.LabelButton(self.frame, app, "<<SelectAll>>", image=OCV.icons["select_all"], text=_("All"), compound=Tk.LEFT, anchor=Tk.W, background=OCV.COLOR_BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=Tk.NSEW) tkExtra.Balloon.set(b, _("Select all blocks [Ctrl-A]")) self.addWidget(b) col += 1 b = Ribbon.LabelButton(self.frame, app, "<<SelectNone>>", image=OCV.icons["select_none"], text=_("None"), compound=Tk.LEFT, anchor=Tk.W, background=OCV.COLOR_BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=Tk.NSEW) tkExtra.Balloon.set(b, _("Unselect all blocks [Ctrl-Shift-A]")) self.addWidget(b) col, row = 0, 1 b = Ribbon.LabelButton(self.frame, app, "<<SelectInvert>>", image=OCV.icons["select_invert"], text=_("Invert"), compound=Tk.LEFT, anchor=Tk.W, background=OCV.COLOR_BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=Tk.NSEW) tkExtra.Balloon.set(b, _("Invert selection [Ctrl-I]")) self.addWidget(b) col += 1 b = Ribbon.LabelButton(self.frame, app, "<<SelectLayer>>", image=OCV.icons["select_layer"], text=_("Layer"), compound=Tk.LEFT, anchor=Tk.W, background=OCV.COLOR_BACKGROUND) b.grid(row=row, column=col, padx=0, pady=0, sticky=Tk.NSEW) tkExtra.Balloon.set(b, _("Select all blocks from current layer")) self.addWidget(b) col, row = 0, 2 self.filterString = tkExtra.LabelEntry( self.frame, _("Filter"), "DarkGray", background=tkExtra.GLOBAL_CONTROL_BACKGROUND, width=16) self.filterString.grid(row=row, column=col, columnspan=2, padx=0, pady=0, sticky=Tk.NSEW) tkExtra.Balloon.set(self.filterString, _("Filter blocks")) self.addWidget(self.filterString) self.filterString.bind("<Return>", self.filter) self.filterString.bind("<KP_Enter>", self.filter)