def __init__(self, name, designer, parentCompanion, ctrl): CollectionIddDTC.__init__(self, name, designer, parentCompanion, ctrl) self.editors.update({'Text': StrConstrPropEdit, 'Help': StrConstrPropEdit, 'Kind': EnumConstrPropEdit, 'Menu': MenuEnumConstrPropEdit, }) self.names['Kind'] = ['wx.ITEM_NORMAL', 'wx.ITEM_CHECK', 'wx.ITEM_RADIO']
def writeCollectionItems(self, output, stripFrmId=''): CollectionIddDTC.writeCollectionItems(self, output, stripFrmId) warn = 0 for constr in self.textConstrLst: if 'control' in constr.params and constr.params['control'] == 'None': wx.LogWarning(_("Invalid None control for toolbar %s's AddControl")%( self.parentCompanion.name)) warn = 1 if warn: wx.LogWarning(_('Control may not be None or the generated source will ' 'be invalid outside the Designer.'))
def writeCollectionItems(self, output, stripFrmId=''): CollectionIddDTC.writeCollectionItems(self, output, stripFrmId) warn = 0 for constr in self.textConstrLst: if constr.params.has_key('control') and constr.params['control'] == 'None': wx.LogWarning(_("Invalid None control for toolbar %s's AddControl")%( self.parentCompanion.name)) warn = 1 if warn: wx.LogWarning(_('Control may not be None or the generated source will ' 'be invalid outside the Designer.'))
def __init__(self, name, designer, parentCompanion, ctrl): CollectionIddDTC.__init__(self, name, designer, parentCompanion, ctrl) self.editors.update({'Bitmap': BitmapConstrPropEdit, 'PushedBitmap': BitmapConstrPropEdit, 'BitmapDisabled': BitmapConstrPropEdit, 'IsToggle': BoolConstrPropEdit, 'Label': StrConstrPropEdit, 'ShortHelpString': StrConstrPropEdit, 'LongHelpString': StrConstrPropEdit, 'ShortHelp': StrConstrPropEdit, 'LongHelp': StrConstrPropEdit, 'Kind': EnumConstrPropEdit, 'Control': WinEnumConstrPropEdit}) self.names['Kind'] = ['wx.ITEM_NORMAL', 'wx.ITEM_CHECK', 'wx.ITEM_RADIO']
def moveItem(self, idx, dir): newIdx = CollectionIddDTC.moveItem(self, idx, dir) if newIdx != idx: self.control.ClearTools() for crt in self.textConstrLst: self.applyDesignTimeDefaults(crt.params, crt.method) return newIdx
def moveItem(self, idx, dir): newIdx = CollectionIddDTC.moveItem(self, idx, dir) if newIdx != idx: menus = self.control.GetMenuItems() menu = self.control.RemoveItem(menus[idx]) self.control.InsertItem(newIdx, menu) return newIdx
def properties(self): tcl = self.textConstrLst[self.index] if tcl.method in ('DoAddTool', 'AddTool'): return CollectionIddDTC.properties(self) elif tcl.method == 'AddSeparator': return {} elif tcl.method == 'AddControl': return {}
def properties(self): tcl = self.textConstrLst[self.index] if tcl.method in ('Append', 'AppendMenu'): props = CollectionIddDTC.properties(self) props.update( {'Text': ('IdRoute', wx.Menu.GetLabel, wx.Menu.SetLabel), 'Help': ('IdRoute', wx.Menu.GetHelpString, wx.Menu.SetHelpString)}) elif tcl.method == 'AppendSeparator': props = {} return props
def deleteItem(self, idx): CollectionIddDTC.deleteItem(self, idx) del self.textConstrLst[idx]
def appendItem(self, method=None): CollectionIddDTC.appendItem(self, method) self.control.Realize()