本文整理汇总了Python中BaseCompanions.CollectionDTC类的典型用法代码示例。如果您正苦于以下问题:Python CollectionDTC类的具体用法?Python CollectionDTC怎么用?Python CollectionDTC使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CollectionDTC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deleteItem
def deleteItem(self, index):
CollectionDTC.deleteItem(self, index)
for idx in range(index, len(self.widths)):
self.control.SetStatusText(self.control.GetStatusText(idx+1), idx)
del self.widths[index]
self.control.SetStatusWidths(self.widths)
self.control.SetFieldsCount(len(self.widths))
示例2: designTimeDefaults
def designTimeDefaults(self, vals, method=None):
if method is None:
method = self.insertionMethod
if method in ('AddWindow', 'AddSizer', 'Insert'):
if method in ('AddWindow', 'AddSizer'): ctrlIdx = 0
elif method == 'Insert': ctrlIdx = 1
if vals[ctrlIdx] != 'None':
srcRef = vals[ctrlIdx]
try:
# XXX improve
int(srcRef)
except:
params = copy.copy(vals)
del params[ctrlIdx]
dtd = CollectionDTC.designTimeDefaults(self, params, method)
dtd[ctrlIdx] = self.designer.controllerView.getAllObjects()[srcRef]
if method == 'AddSizer':
dtd[ctrlIdx]._sub_sizer = self.control
elif method == 'AddWindow':
dtd[ctrlIdx]._in_sizer = self.control
return dtd
return CollectionDTC.designTimeDefaults(self, vals, method)
示例3: __init__
def __init__(self, name, designer, parentCompanion, ctrl):
CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl)
self.editors = {'Width': IntConstrPropEdit,
'Heading': StrConstrPropEdit,
'Format': EnumConstrPropEdit}#StyleConstrPropEdit}
# self.options = {'Format': formatStyle}
self.names = {'Format': formatStyle}
示例4: persistProp
def persistProp(self, name, setterName, value):
CollectionDTC.persistProp(self, name, setterName, value)
if name in ('Size',):
self.recreateSizers()
elif name in ('Flag', 'Border', 'Proportion'):
si = self.control.GetChildren()[self.index]
getattr(si, 'Set'+name)(self.eval(value))
self.updateGUI()
示例5: __init__
def __init__(self, name, designer, parentCompanion, ctrl):
CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl)
self.editors = {'Bitmap': BitmapConstrPropEdit,
'Mask': BitmapConstrPropEdit,
# 'Icon': BitmapConstrPropEdit,
'MaskColour': ColourConstrPropEdit}
from Views.CollectionEdit import ImageListCollectionEditor
self.CollEditorFrame = ImageListCollectionEditor
示例6: __init__
def __init__(self, name, designer, parentCompanion, ctrl):
CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl)
self.editors = {'Page': ClassLinkConstrPropEdit,
'Text': StrConstrPropEdit,
'Selected' : BoolConstrPropEdit,
'ImageId': IntConstrPropEdit}
self.tempPlaceHolders = []
示例7: writeCollectionItems
def writeCollectionItems(self, output, stripFrmId=''):
CollectionDTC.writeCollectionItems(self, output, stripFrmId)
warn = 0
for constr in self.textConstrLst:
if constr.params[0] == 'None':
wx.LogWarning(_('No control/sizer for sizer item of %s')%(
self.parentCompanion.name))
warn = 1
if warn:
wx.LogWarning(_('None values are only valid in the Designer.\n'
'The generated source will be invalid outside the '
'Designer and should be fixed before executing.'))
示例8: writeCollectionItems
def writeCollectionItems(self, output, stripFrmId=''):
CollectionDTC.writeCollectionItems(self, output, stripFrmId)
warn = 0
for constr in self.textConstrLst:
if constr.params['page'] == 'None':
wx.LogWarning('No control for %s, page %s'%(
self.parentCompanion.name, constr.params['text']))
warn = 1
if warn:
wx.LogWarning(_('The red-dashed area of a %s page must contain\n'\
'a control or the generated source will be invalid outside the '\
'Designer')% self.parentCompanion.bookCtrlName)
示例9: __init__
def __init__(self, name, designer, parentCompanion, ctrl):
CollectionDTC.__init__(self, name, designer, parentCompanion, ctrl)
self.editors = {'Window': SizerWinEnumConstrPropEdit,
'Sizer': SizerEnumConstrPropEdit,
'Proportion': IntConstrPropEdit,
'Flag': SizerFlagsConstrPropEdit,
'Border': IntConstrPropEdit,
'Size': SizeConstrPropEdit,
}
self.windowStyles = ['wx.LEFT', 'wx.RIGHT', 'wx.TOP', 'wx.BOTTOM', 'wx.ALL',
'wx.SHRINK', 'wx.GROW', 'wx.EXPAND', 'wx.SHAPED',
'wx.ALIGN_LEFT', 'wx.ALIGN_CENTER_HORIZONTAL',
'wx.ALIGN_RIGHT', 'wx.ALIGN_BOTTOM',
'wx.ALIGN_CENTER_VERTICAL', 'wx.ALIGN_TOP',
'wx.ALIGN_CENTER', 'wx.ADJUST_MINSIZE']
示例10: moveItem
def moveItem(self, idx, dir):
newIdx = CollectionDTC.moveItem(self, idx, dir)
if newIdx != idx:
title = self.control.GetLabelTop(idx)
menu = self.control.Remove(idx)
self.control.Insert(newIdx, menu, title)
return newIdx
示例11: properties
def properties(self):
props = CollectionDTC.properties(self)
props.update({'Bitmap': ('CompnRoute', None, self.setBitmap),
'Mask': ('NoneRoute', None, None),
# 'Icon': ('CompnRoute', None, self.setBitmap),
})
return props
示例12: applyDesignTimeDefaults
def applyDesignTimeDefaults(self, params, method=None):
if method is None:
method = self.insertionMethod
if (method in ('AddWindow', 'AddSizer') and params[0] == 'None') or \
(method == 'Insert' and params[1] == 'None'):
defaults = self.designTimeDefaults(params, method)
if method == 'Insert':
proportion = defaults[2]
import warnings; warnings.warn('Insert called with BlankSizer')
else:
proportion = defaults[1]
self.control.AddSizer(BlankSizer(), proportion, defaults['flag'],
defaults['border'])
else:
CollectionDTC.applyDesignTimeDefaults(self, params, method)
示例13: properties
def properties(self):
props = CollectionDTC.properties(self)
props.update({'Page': ('NoneRoute', None, None),
'Text': ('IndexRoute', wx.Notebook.GetPageText.im_func, wx.Notebook.SetPageText.im_func),
'Selected' : ('CompnRoute', self.GetPageSelected, self.SetPageSelected),
'ImageId': ('IndexRoute', wx.Notebook.GetPageImage.im_func, wx.Notebook.SetPageImage.im_func)})
return props
示例14: properties
def properties(self):
props = CollectionDTC.properties(self)
props.update({'Column': ('NoneRoute', None, None),
'Heading': ('NoneRoute', None, None),
# 'Format': ('IndexRoute', None, None),
'Width': ('IndexRoute', wx.ListCtrl.GetColumnWidth,
wx.ListCtrl.SetColumnWidth)})
return props
示例15: moveItem
def moveItem(self, idx, dir):
newIdx = CollectionDTC.moveItem(self, idx, dir)
if newIdx != idx:
li = self.control.GetColumn(idx)
text = li.GetText()
self.control.DeleteColumn(idx)
self.control.InsertColumnInfo(newIdx, li)
self.control.SetColumn(newIdx, li) # doesn't update without this
return newIdx