Esempio n. 1
0
    def create_toolbar(self, dataset=True, report=True, help=True):
        self.toolbar_standard = wx.aui.AuiToolBar(self, id=wx.ID_ANY)

        if self.permissions == None:
            self.permissions = {}

        if self.permissions.get('save') <> False:
            self.toolbar_standard.AddTool(self.ID_SAVE, "Speichern",
                                          IconSet22.getfilesave_22Bitmap(),
                                          'speichern')
            self.toolbar_standard.Bind(wx.EVT_TOOL,
                                       self.on_save,
                                       id=self.ID_SAVE)

        if self.permissions.get('delete') <> False:
            self.toolbar_standard.AddTool(self.ID_DELETE, "Löschen",
                                          IconSet22.getdelete_22Bitmap(),
                                          u'löschen')
            self.toolbar_standard.Bind(wx.EVT_TOOL,
                                       self.on_delete,
                                       id=self.ID_DELETE)

        if self.permissions.get('print') <> False:
            self.toolbar_standard.AddTool(self.ID_PRINT, "Drucken",
                                          IconSet22.getprint_22Bitmap(),
                                          u'drucken')
            self.toolbar_standard.Bind(wx.EVT_TOOL,
                                       self.on_print,
                                       id=self.ID_PRINT)

        # If no primary key is there, just deactivate delete and print!
        if self.primary_key == None:
            self.toolbar_standard.EnableTool(self.ID_DELETE, False)
            self.toolbar_standard.EnableTool(self.ID_PRINT, False)
Esempio n. 2
0
 def create_toolbar(self, dataset=True, report=True, help=True):
     self.toolbar_standard = wx.aui.AuiToolBar(self, id=wx.ID_ANY) 
     
     if self.permissions == None:
         self.permissions = {}
         
     if self.permissions.get('save') <> False:
         self.toolbar_standard.AddTool(self.ID_SAVE, "Speichern", IconSet22.getfilesave_22Bitmap(), 'speichern')
         self.toolbar_standard.Bind(wx.EVT_TOOL, self.on_save, id=self.ID_SAVE)
     
     if self.permissions.get('delete') <> False:
         self.toolbar_standard.AddTool(self.ID_DELETE, "Löschen", IconSet22.getdelete_22Bitmap(), u'löschen')
         self.toolbar_standard.Bind(wx.EVT_TOOL, self.on_delete, id=self.ID_DELETE)
     
     if self.permissions.get('print') <> False:
         self.toolbar_standard.AddTool(self.ID_PRINT, "Drucken", IconSet22.getprint_22Bitmap(), u'drucken')
         self.toolbar_standard.Bind(wx.EVT_TOOL, self.on_print, id=self.ID_PRINT)
     
     # If no primary key is there, just deactivate delete and print!
     if self.primary_key == None:
         self.toolbar_standard.EnableTool(self.ID_DELETE, False)
         self.toolbar_standard.EnableTool(self.ID_PRINT,  False)