Ejemplo n.º 1
0
    def addTools(self, toolbar):
        if self.list.node and self.controllers.has_key(self.list.node.protocol):
            prot = self.list.node.protocol
            tbMenus = []
            for menuLst in self.controllers[prot].toolbarMenus:
                tbMenus.extend(list(menuLst))

            for wID, name, meth, bmp in tbMenus:
                if name == '-' and not bmp:
                    toolbar.AddSeparator()
                elif bmp != '-':
                    if name[0] == '+':
                        # XXX Add toggle button
                        name = name [1:]
                    Utils.AddToolButtonBmpObject(self.editor, toolbar,
                          IS.load(bmp), name, meth)
Ejemplo n.º 2
0
 def addViewTools(self, toolbar):
     addedSep = False
     for name, meth, bmp, accls in self.actions:
         if name == '-' and not bmp:
             toolbar.AddSeparator()
             addedSep = True
         elif bmp != '-':
             if name[0] == '+':
                 # XXX Add toggle button
                 name = name [1:]
             if not addedSep:
                 # this is the separator between File and Edit
                 toolbar.AddSeparator()
                 addedSep = True
             Utils.AddToolButtonBmpObject(self.model.editor, toolbar,
                   IS.load(bmp), name, meth)