Exemplo n.º 1
0
    def __init__(self, parent, inspector, model, compPal):
        [self.wxID_DATAVIEW] = [wx.NewId() for _init_ctrls in range(1)]
        wx.ListView.__init__(self, parent, self.wxID_DATAVIEW, size=(0,0),
              style=Preferences.dataViewListStyle | wx.SUNKEN_BORDER)

        InspectableObjectView.__init__(self, inspector, model, compPal,
          ((_('Default editor'), self.OnDefaultEditor, '-', ''),
           (_('Post'), self.OnPost, self.postBmp, ''),
           (_('Cancel'), self.OnCancel, self.cancelBmp, ''),
           ('-', None, '-', ''),
           (_('Cut'), self.OnCutSelected, '-', ''),
           (_('Copy'), self.OnCopySelected, '-', 'Copy'),
           (_('Paste'), self.OnPasteSelected, '-', 'Paste'),
           (_('Delete'), self.OnControlDelete, '-', 'Delete'),
           ('-', None, '-', ''),
           (_('Creation/Tab order...'), self.OnCreationOrder, '-', ''),
           ('-', None, '-', ''),
           (_('Context help'), self.OnContextHelp, '-', 'ContextHelp'),
           ), 0)

        self.il = wx.ImageList(24, 24)
        self.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        self.Bind(wx.EVT_LEFT_DOWN, self.OnSelectOrAdd)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnObjectSelect, id=self.wxID_DATAVIEW)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnObjectDeselect, id=self.wxID_DATAVIEW)

        self.selection = []
        self.vetoSelect = False

        self.active = True
Exemplo n.º 2
0
    def saveCtrls(self, definedCtrls, module=None, collDeps=None):
        InspectableObjectView.saveCtrls(self, definedCtrls, module, collDeps)

        compns = []
        for objInf in self.objects.values():
            compns.append(objInf[0])
        self.model.removeWindowIds(self.collectionMethod)
        self.model.writeWindowIds(self.collectionMethod, compns)
Exemplo n.º 3
0
    def saveCtrls(self, definedCtrls, module=None, collDeps=None):
        InspectableObjectView.saveCtrls(self, definedCtrls, module, collDeps)

        compns = []
        for objInf in self.objects.values():
            compns.append(objInf[0])
        self.model.removeWindowIds(self.collectionMethod)
        self.model.writeWindowIds(self.collectionMethod, compns)
Exemplo n.º 4
0
    def deleteCtrl(self, name, parentRef=None):
        self.selectNone()

        # notify other components of deletion
        if self.objects.has_key(name):
            self.controllerView.notifyAction(self.objects[name][0], 'delete')

            InspectableObjectView.deleteCtrl(self, name, parentRef)
            self.refreshCtrl()
Exemplo n.º 5
0
    def deleteCtrl(self, name, parentRef = None):
        self.selectNone()

        # notify other components of deletion
        if self.objects.has_key(name):
            self.controllerView.notifyAction(self.objects[name][0], 'delete')

            InspectableObjectView.deleteCtrl(self, name, parentRef)
            self.refreshCtrl()
Exemplo n.º 6
0
    def __init__(self, parent, inspector, model, compPal):
        [self.wxID_DATAVIEW] = [wx.NewId() for _init_ctrls in range(1)]
        wx.ListView.__init__(self,
                             parent,
                             self.wxID_DATAVIEW,
                             size=(0, 0),
                             style=Preferences.dataViewListStyle
                             | wx.SUNKEN_BORDER)

        InspectableObjectView.__init__(self, inspector, model, compPal, (
            (_('Default editor'), self.OnDefaultEditor, '-', ''),
            (_('Post'), self.OnPost, self.postBmp, ''),
            (_('Cancel'), self.OnCancel, self.cancelBmp, ''),
            ('-', None, '-', ''),
            (_('Cut'), self.OnCutSelected, '-', ''),
            (_('Copy'), self.OnCopySelected, '-', 'Copy'),
            (_('Paste'), self.OnPasteSelected, '-', 'Paste'),
            (_('Delete'), self.OnControlDelete, '-', 'Delete'),
            ('-', None, '-', ''),
            (_('Creation/Tab order...'), self.OnCreationOrder, '-', ''),
            ('-', None, '-', ''),
            (_('Context help'), self.OnContextHelp, '-', 'ContextHelp'),
        ), 0)

        self.il = wx.ImageList(24, 24)
        self.SetImageList(self.il, wx.IMAGE_LIST_SMALL)

        self.Bind(wx.EVT_LEFT_DOWN, self.OnSelectOrAdd)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED,
                  self.OnObjectSelect,
                  id=self.wxID_DATAVIEW)
        self.Bind(wx.EVT_LIST_ITEM_DESELECTED,
                  self.OnObjectDeselect,
                  id=self.wxID_DATAVIEW)

        self.selection = []
        self.vetoSelect = False

        self.active = True
Exemplo n.º 7
0
 def initObjectsAndCompanions(self, creators, objColl, dependents,
                              depLinks):
     InspectableObjectView.initObjectsAndCompanions(self, creators, objColl,
                                                    dependents, depLinks)
     self.initIdOnlyObjEvts(objColl.events, creators)
Exemplo n.º 8
0
 def close(self):
     self.cleanup()
     InspectableObjectView.close(self)
Exemplo n.º 9
0
 def destroy(self):
     InspectableObjectView.destroy(self)
     self.il = None
Exemplo n.º 10
0
    def renameCtrl(self, oldName, newName):
        self.controllerView.renameCtrlAndParentRefs(oldName, newName)

        InspectableObjectView.renameCtrl(self, oldName, newName)
        self.refreshCtrl()
        self.selectCtrls((newName, ))
Exemplo n.º 11
0
 def initObjectsAndCompanions(self, creators, objColl, dependents, depLinks):
     InspectableObjectView.initObjectsAndCompanions(self, creators, objColl, dependents, depLinks)
     self.initIdOnlyObjEvts(objColl.events, creators)
Exemplo n.º 12
0
 def close(self):
     self.cleanup()
     InspectableObjectView.close(self)
Exemplo n.º 13
0
 def destroy(self):
     InspectableObjectView.destroy(self)
     self.il = None
Exemplo n.º 14
0
    def renameCtrl(self, oldName, newName):
        self.controllerView.renameCtrlAndParentRefs(oldName, newName)

        InspectableObjectView.renameCtrl(self, oldName, newName)
        self.refreshCtrl()
        self.selectCtrls( (newName,) )