本文整理汇总了Python中WidgetFactory.buildMLTextSizer方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetFactory.buildMLTextSizer方法的具体用法?Python WidgetFactory.buildMLTextSizer怎么用?Python WidgetFactory.buildMLTextSizer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WidgetFactory
的用法示例。
在下文中一共展示了WidgetFactory.buildMLTextSizer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buildControls
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def buildControls(self,isCreate,isUpdateable=True):
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Label',(87,30),REQUIREMENT_TEXTLABEL_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,60),REQUIREMENT_TEXTDESCRIPTION_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Priority',(87,30),REQUIREMENT_TEXTPRIORITY_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Rationale',(87,30),REQUIREMENT_TEXTRATIONALE_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Fit Criterion',(87,60),REQUIREMENT_TEXTFITCRITERION_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Originator',(87,30),REQUIREMENT_TEXTORIGINATOR_ID),0,wx.EXPAND)
self.SetSizer(mainSizer)
示例2: buildControls
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def buildControls(self,parameters):
mainSizer = wx.BoxSizer(wx.VERTICAL)
associationSizer = wx.BoxSizer(wx.HORIZONTAL)
mainSizer.Add(WidgetFactory.buildCheckSizer(self,'Alternative',GOALASSOCIATION_CHECKALTERNATIVE_ID,False),0,wx.EXPAND)
mainSizer.Add(associationSizer,0,wx.EXPAND)
environments = self.dbProxy.getDimensionNames('environment')
goals = []
associationTypes = ['and','or','conflict','responsible','obstruct','resolve']
goalDimensions = ['goal','requirement','countermeasure','obstacle']
subGoalDimensions = ['goal','requirement','role','task','usecase','countermeasure','domainproperty','obstacle','threat','vulnerability']
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Environment',(87,30),GOALASSOCIATION_COMBOENVIRONMENT_ID,environments),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOGOALDIM_ID,goalDimensions),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Goal',(87,30),GOALASSOCIATION_COMBOGOAL_ID,goals),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),GOALASSOCIATION_COMBOATYPE_ID,associationTypes),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dimension',(87,30),GOALASSOCIATION_COMBOSUBGOALDIM_ID,subGoalDimensions),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Sub-Goal',(87,30),GOALASSOCIATION_COMBOSUBGOAL_ID,goals),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),GOALASSOCIATION_TEXTRATIONALE_ID),1,wx.EXPAND,1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,GOALASSOCIATION_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
wx.EVT_BUTTON(self,GOALASSOCIATION_BUTTONCOMMIT_ID,self.onCommit)
wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOENVIRONMENT_ID,self.onEnvironmentChange)
wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOGOALDIM_ID,self.onGoalDimChange)
wx.EVT_COMBOBOX(self,GOALASSOCIATION_COMBOSUBGOALDIM_ID,self.onSubGoalDimChange)
示例3: buildControls
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def buildControls(self):
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),ENVIRONMENT_TEXTNAME_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),ENVIRONMENT_TEXTSHORTCODE_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),ENVIRONMENT_TEXTDESCRIPTION_ID),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,ENVIRONMENT_BUTTONCOMMIT_ID,True))
self.SetSizer(mainSizer)
示例4: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent,dLabel,dName,dType,dDesc):
wx.Dialog.__init__(self,parent,DIRECTORYENTRY_ID,'Directory Entry',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(500,300))
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Label',(87,30),DIRECTORYENTRY_TEXTLABEL_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),DIRECTORYENTRY_TEXTNAME_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Type',(87,30),DIRECTORYENTRY_TEXTTYPE_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),DIRECTORYENTRY_TEXTDESCRIPTION_ID),1,wx.EXPAND)
buttonSizer = wx.BoxSizer(wx.ALIGN_CENTER)
okButton = wx.Button(self,wx.ID_OK,'Ok')
buttonSizer.Add(okButton)
mainSizer.Add(buttonSizer,0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
labelCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTLABEL_ID)
labelCtrl.SetValue(dLabel)
labelCtrl.Disable()
nameCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTNAME_ID)
nameCtrl.SetValue(dName)
nameCtrl.Disable()
typeCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTTYPE_ID)
typeCtrl.SetValue(dType)
typeCtrl.Disable()
descCtrl = self.FindWindowById(DIRECTORYENTRY_TEXTDESCRIPTION_ID)
descCtrl.SetValue(dDesc)
descCtrl.Disable()
示例5: buildControls
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def buildControls(self,isCreate,isUpdateable=True):
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),EXTERNALDOCUMENT_TEXTNAME_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Version',(87,30),EXTERNALDOCUMENT_TEXTVERSION_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Date',(87,30),EXTERNALDOCUMENT_TEXTDATE_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Authors',(87,30),EXTERNALDOCUMENT_TEXTAUTHORS_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),EXTERNALDOCUMENT_TEXTDESCRIPTION_ID),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,EXTERNALDOCUMENT_BUTTONCOMMIT_ID,isCreate),0,wx.CENTER)
self.SetSizer(mainSizer)
示例6: buildControls
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def buildControls(self,isCreate):
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.ROLE_TEXTNAME_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),armid.ROLE_TEXTSHORTCODE_ID),0,wx.EXPAND)
roleTypes = self.dbProxy.getDimensionNames('role_type')
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),armid.ROLE_COMBOTYPE_ID,roleTypes),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,80),armid.ROLE_TEXTDESCRIPTION_ID),0,wx.EXPAND)
mainSizer.Add(RoleEnvironmentPanel(self,self.dbProxy),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,armid.ROLE_BUTTONCOMMIT_ID,isCreate),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
示例7: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent):
wx.Dialog.__init__(self,parent,REVISIONENTRY_ID,'Add Revision',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(300,300))
self.theRemarks = ''
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Remarks',(87,30),REVISIONENTRY_TEXTREMARKS_ID),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,REVISIONENTRY_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
wx.EVT_BUTTON(self,REVISIONENTRY_BUTTONCOMMIT_ID,self.onCommit)
self.commitLabel = 'Add'
示例8: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent):
wx.Dialog.__init__(self,parent,armid.NEWENVIRONMENT_ID,'New Environment',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(300,200))
self.environmentName = ''
self.environmentDescription = ''
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.NEWENVIRONMENT_TEXTNAME_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),armid.NEWENVIRONMENT_TEXTSHORTCODE_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),armid.NEWENVIRONMENT_TEXTDESCRIPTION_ID),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildCommitButtonSizer(self,armid.NEWENVIRONMENT_BUTTONCOMMIT_ID,True))
self.SetSizer(mainSizer)
wx.EVT_BUTTON(self,armid.NEWENVIRONMENT_BUTTONCOMMIT_ID,self.onCreate)
示例9: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent,dp,envName,subGoal='',subGoalDim='',refinement='',alternate='',rationale='',isGoal=False):
wx.Dialog.__init__(self,parent,GOALREFINEMENT_ID,'Add Goal Refinement',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,400))
self.dbProxy = dp
self.theCurrentEnvironment = envName
self.theGoal = subGoal
self.theGoalDimension = subGoalDim
self.theRefinement = refinement
self.theAlternateFlag = alternate
self.theRationale = rationale
mainSizer = wx.BoxSizer(wx.VERTICAL)
goals = self.dbProxy.environmentGoals(self.theCurrentEnvironment)
goals += self.dbProxy.environmentObstacles(self.theCurrentEnvironment)
goals += self.dbProxy.environmentDomainProperties(self.theCurrentEnvironment)
reqList = self.dbProxy.getOrderedRequirements()
for req in reqList:
goals += [req.label()]
refNames = ['and','or','conflict','responsible','obstruct','resolve']
altNames = ['Yes','No']
goalDims = ['goal','task','usecase','requirement','obstacle','domainproperty','threat','vulnerability','role','misusecase']
goalTitle = 'Sub-Goal'
if isGoal == True:
goalTitle = 'Goal'
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),GOALREFINEMENT_COMBOGOALDIMENSION_ID,goalDims),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildComboSizerList(self,goalTitle,(87,30),GOALREFINEMENT_COMBOGOAL_ID,goals),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Refinement',(87,30),GOALREFINEMENT_COMBOREFINEMENT_ID,refNames),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Alternate',(87,30),GOALREFINEMENT_COMBOALTERNATE_ID,altNames),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),GOALREFINEMENT_TEXTRATIONALE_ID),1,wx.EXPAND,1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,GOALREFINEMENT_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
wx.EVT_COMBOBOX(self,GOALREFINEMENT_COMBOGOALDIMENSION_ID,self.onDimChange)
wx.EVT_BUTTON(self,GOALREFINEMENT_BUTTONCOMMIT_ID,self.onCommit)
self.commitLabel = 'Add'
if (len(self.theGoal) > 0):
self.commitLabel = 'Edit'
self.SetLabel('Edit Goal Refinement')
subGoalCtrl = self.FindWindowById(GOALREFINEMENT_COMBOGOAL_ID)
subGoalCtrl.SetStringSelection(self.theGoal)
dimCtrl = self.FindWindowById(GOALREFINEMENT_COMBOGOALDIMENSION_ID)
dimCtrl.SetStringSelection(self.theGoalDimension)
refCtrl = self.FindWindowById(GOALREFINEMENT_COMBOREFINEMENT_ID)
refCtrl.SetStringSelection(self.theRefinement)
altCtrl = self.FindWindowById(GOALREFINEMENT_COMBOALTERNATE_ID)
altCtrl.SetStringSelection(self.theAlternateFlag)
ratCtrl = self.FindWindowById(GOALREFINEMENT_TEXTRATIONALE_ID)
ratCtrl.SetValue(self.theRationale)
buttonCtrl = self.FindWindowById(GOALREFINEMENT_BUTTONCOMMIT_ID)
buttonCtrl.SetLabel('Edit')
示例10: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent):
wx.Panel.__init__(self,parent)
topSizer = wx.BoxSizer(wx.VERTICAL)
typeList = ['Causal','Biddable','Lexical']
givenBox = wx.StaticBox(self,-1,'Given Domain')
givenSizer = wx.StaticBoxSizer(givenBox,wx.HORIZONTAL)
topSizer.Add(givenSizer,0,wx.EXPAND)
self.givenCtrl = wx.CheckBox(self,DOMAIN_CHECKGIVEN_ID)
self.givenCtrl.SetValue(True)
givenSizer.Add(self.givenCtrl,0,wx.EXPAND)
topSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),DOMAIN_COMBOTYPE_ID,typeList),0,wx.EXPAND)
topSizer.Add(WidgetFactory.buildTextSizer(self,'Short Code',(87,30),DOMAIN_TEXTSHORTCODE_ID),0,wx.EXPAND)
topSizer.Add(WidgetFactory.buildMLTextSizer(self,'Description',(87,30),DOMAIN_TEXTDESCRIPTION_ID),1,wx.EXPAND)
self.SetSizer(topSizer)
self.Bind(wx.EVT_COMBOBOX, self.onDomainTypeChange,id = DOMAIN_COMBOTYPE_ID)
示例11: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent,envName):
wx.Panel.__init__(self,parent,EXCEPTION_ID)
b = Borg()
self.dbProxy = b.dbProxy
self.theEnvironmentName = envName
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),EXCEPTION_TEXTNAME_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildRadioButtonSizer(self,'Type',(87,30),[(EXCEPTION_RADIOGOAL_ID,'Goal'),(EXCEPTION_RADIOREQUIREMENT_ID,'Requirement')]))
goalList = self.dbProxy.environmentGoals(self.theEnvironmentName)
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Values',(87,30),EXCEPTION_COMBOGOALS_ID,goalList),0,wx.EXPAND)
catList = ['Confidentiality Threat','Integrity Threat','Availability Threat','Accountability Threat','Anonymity Threat','Pseudonymity Threat','Unlinkability Threat','Unobservability Threat','Vulnerability','Duration','Frequency','Demands','Goal Support']
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Category',(87,30),EXCEPTION_COMBOCATEGORY_ID,catList),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Definition',(87,30),EXCEPTION_TEXTDEFINITION_ID),1,wx.EXPAND)
self.SetSizer(mainSizer)
wx.EVT_RADIOBUTTON(self,EXCEPTION_RADIOGOAL_ID,self.onGoalSelected)
wx.EVT_RADIOBUTTON(self,EXCEPTION_RADIOREQUIREMENT_ID,self.onRequirementSelected)
示例12: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent,reqList,setTargets,envName):
wx.Dialog.__init__(self,parent,PROPERTY_ID,'Add Target',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,250))
b = Borg()
self.dbProxy = b.dbProxy
self.theTarget = ''
self.theEffectiveness = ''
self.theRationale = ''
self.commitLabel = 'Add'
mainSizer = wx.BoxSizer(wx.VERTICAL)
self.theTargetDictionary = self.dbProxy.targetNames(reqList,envName)
defaultTargets = set(self.theTargetDictionary.keys())
targetList = list(defaultTargets.difference(setTargets))
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Target',(87,30),TARGET_COMBOTARGET_ID,targetList),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Effectiveness',(87,30),TARGET_COMBOEFFECTIVENESS_ID,['None','Low','Medium','High']),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),TARGET_TEXTRATIONALE_ID),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,TARGET_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
wx.EVT_BUTTON(self,TARGET_BUTTONCOMMIT_ID,self.onCommit)
示例13: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent,setProperties,values):
wx.Dialog.__init__(self,parent,armid.PROPERTY_ID,'Add Security Property',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,300))
weights = {"Confidentiality":0,"Integrity":1,"Availability":2,"Accountability":3,"Anonymity":4,"Pseudonymity":5,"Unlinkability":6,"Unobservability":7}
self.thePropertyName = ''
self.thePropertyValue = ''
self.thePropertyRationale = 'None'
self.commitLabel = 'Add'
mainSizer = wx.BoxSizer(wx.VERTICAL)
# defaultProperties = set(['Confidentiality','Integrity','Availability','Accountability','Anonymity','Pseudonymity','Unlinkability','Unobservability'])
defaultProperties = set(weights.keys())
propertyList = sorted(list(defaultProperties.difference(setProperties)), key=lambda x:weights[x])
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Property',(87,30),armid.PROPERTY_COMBOPROPERTY_ID,propertyList),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildComboSizerList(self,'Value',(87,30),armid.PROPERTY_COMBOVALUE_ID,values),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),armid.PROPERTY_TEXTRATIONALE_ID),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.PROPERTY_BUTTONADD_ID),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
wx.EVT_BUTTON(self,armid.PROPERTY_BUTTONADD_ID,self.onCommit)
示例14: buildControls
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def buildControls(self,parameters):
mainSizer = wx.BoxSizer(wx.VERTICAL)
associationSizer = wx.BoxSizer(wx.HORIZONTAL)
mainSizer.Add(associationSizer,0,wx.EXPAND)
environments = self.dbProxy.getDimensionNames('environment')
roles = self.dbProxy.getDimensionNames('role')
self.dependencyTypes = ['goal','task','asset']
self.dependencies = []
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Environment',(150,30),DEPENDENCY_COMBOENVIRONMENT_ID,environments),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Depender',(200,30),DEPENDENCY_COMBODEPENDER_ID,roles),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dependee',(200,30),DEPENDENCY_COMBODEPENDEE_ID,roles),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Type',(87,30),DEPENDENCY_COMBODTYPE_ID,self.dependencyTypes),0,wx.EXPAND)
associationSizer.Add(WidgetFactory.buildComboSizerList(self,'Dependency',(200,30),DEPENDENCY_COMBODEPENDENCY_ID,self.dependencies),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Rationale',(87,60),DEPENDENCY_TEXTRATIONALE_ID),1,wx.EXPAND,1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,DEPENDENCY_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
wx.EVT_BUTTON(self,DEPENDENCY_BUTTONCOMMIT_ID,self.onCommit)
wx.EVT_COMBOBOX(self,DEPENDENCY_COMBOENVIRONMENT_ID,self.onEnvironmentChange)
wx.EVT_COMBOBOX(self,DEPENDENCY_COMBODTYPE_ID,self.onDependencyTypeChange)
示例15: __init__
# 需要导入模块: import WidgetFactory [as 别名]
# 或者: from WidgetFactory import buildMLTextSizer [as 别名]
def __init__(self,parent,name = '',definition = ''):
wx.Dialog.__init__(self,parent,armid.DICTIONARYENTRY_ID,'Add Dictionary Entry',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(500,300))
self.theName = name
self.theDefinition = definition
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(WidgetFactory.buildTextSizer(self,'Name',(87,30),armid.DICTIONARYENTRY_TEXTNAME_ID),0,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildMLTextSizer(self,'Definition',(87,30),armid.DICTIONARYENTRY_TEXTDEFINITION_ID),1,wx.EXPAND)
mainSizer.Add(WidgetFactory.buildAddCancelButtonSizer(self,armid.DICTIONARYENTRY_BUTTONCOMMIT_ID),0,wx.ALIGN_CENTER)
self.SetSizer(mainSizer)
wx.EVT_BUTTON(self,armid.DICTIONARYENTRY_BUTTONCOMMIT_ID,self.onCommit)
self.commitLabel = 'Add'
if (len(self.theName) > 0):
self.commitLabel = 'Edit'
self.SetLabel('Edit Dictionary Entry')
nameCtrl = self.FindWindowById(armid.DICTIONARYENTRY_TEXTNAME_ID)
nameCtrl.SetValue(self.theName)
defCtrl = self.FindWindowById(armid.DICTIONARYENTRY_TEXTDEFINITION_ID)
defCtrl.SetValue(self.theDefinition)
buttonCtrl = self.FindWindowById(armid.DICTIONARYENTRY_BUTTONCOMMIT_ID)
buttonCtrl.SetLabel('Edit')