Exemplo n.º 1
0
    def refreshCtrl(self):
        self.DeleteAllItems()

        if self.model.objectCollections.has_key(self.collectionMethod):
            objCol = self.model.objectCollections[self.collectionMethod]
            objCol.indexOnCtrlName()
        else:
            objCol = ObjCollection.ObjectCollection()

        creators = {}
        for ctrl in objCol.creators:
            if ctrl.comp_name:
                creators[ctrl.comp_name] = ctrl

        for name in self.objectOrder:
            idx = -1
            ctrl = creators[name]
            className = ctrl.class_name
            try:
                ClassObj = PaletteMapping.evalCtrl(className)
            except NameError:
                if className in self.model.customClasses:
                    ClassObj = self.model.customClasses[className]
                else:
                    idx = self.il.Add(PaletteStore.bitmapForComponent(className,
                          'Component'))
            else:
                className = ClassObj.__name__

            if idx == -1:
                idx = self.il.Add(PaletteStore.bitmapForComponent(ClassObj))

            self.InsertImageStringItem(self.GetItemCount(), '%s : %s' % (
                  ctrl.comp_name, className), idx)
        self.opened = True
Exemplo n.º 2
0
    def refreshCtrl(self):
        self.DeleteAllItems()

        if self.model.objectCollections.has_key(self.collectionMethod):
            objCol = self.model.objectCollections[self.collectionMethod]
            objCol.indexOnCtrlName()
        else:
            objCol = ObjCollection.ObjectCollection()

        creators = {}
        for ctrl in objCol.creators:
            if ctrl.comp_name:
                creators[ctrl.comp_name] = ctrl

        for name in self.objectOrder:
            idx = -1
            ctrl = creators[name]
            className = ctrl.class_name
            try:
                ClassObj = PaletteMapping.evalCtrl(className)
            except NameError:
                if className in self.model.customClasses:
                    ClassObj = self.model.customClasses[className]
                else:
                    idx = self.il.Add(
                        PaletteStore.bitmapForComponent(
                            className, 'Component'))
            else:
                className = ClassObj.__name__

            if idx == -1:
                idx = self.il.Add(PaletteStore.bitmapForComponent(ClassObj))

            self.InsertImageStringItem(self.GetItemCount(),
                                       '%s : %s' % (ctrl.comp_name, className),
                                       idx)
        self.opened = True
Exemplo n.º 3
0
 def getButtonBmp(self, name, wxClass):
     return PaletteStore.bitmapForComponent(wxClass)
Exemplo n.º 4
0
 def getButtonBmp(self, name, wxClass):
     return PaletteStore.bitmapForComponent(wxClass)