Ejemplo n.º 1
0
 def onItemActivated(self, evt):
     x = evt.GetIndex()
     targetName = self.GetItemText(x)
     targetEffectiveness = self.GetItem(x, 1).GetText()
     eRationale = self.GetItem(x, 2).GetText()
     reqCtrl = self.theParentWindow.FindWindowById(
         COUNTERMEASURE_LISTREQUIREMENTS_ID)
     reqList = reqCtrl.dimensions()
     dlg = TargetDialog(self, reqList,
                        self.setTargets[self.theCurrentEnvironment],
                        self.theCurrentEnvironment)
     dlg.load(targetName, targetEffectiveness, eRationale)
     if (dlg.ShowModal() == TARGET_BUTTONCOMMIT_ID):
         targetName = dlg.target()
         effectivenessValue = dlg.effectiveness()
         eRat = dlg.rationale()
         self.SetStringItem(x, 0, targetName)
         self.SetStringItem(x, 1, effectivenessValue)
         self.SetStringItem(x, 2, eRat)
         (self.setTargets[self.theCurrentEnvironment]).add(targetName)
Ejemplo n.º 2
0
 def onAddTarget(self, evt):
     reqCtrl = self.theParentWindow.FindWindowById(
         COUNTERMEASURE_LISTREQUIREMENTS_ID)
     reqList = reqCtrl.dimensions()
     if (len(reqList) == 0):
         dlg = wx.MessageDialog(self, 'Add target',
                                'No requirements selected',
                                wx.OK | wx.ICON_EXCLAMATION)
         dlg.ShowModal()
         dlg.Destroy()
         return
     dlg = TargetDialog(self, reqList,
                        self.setTargets[self.theCurrentEnvironment],
                        self.theCurrentEnvironment)
     if (dlg.ShowModal() == TARGET_BUTTONCOMMIT_ID):
         targetName = dlg.target()
         effectivenessValue = dlg.effectiveness()
         eRat = dlg.rationale()
         idx = self.GetItemCount()
         self.InsertStringItem(idx, targetName)
         self.SetStringItem(idx, 1, effectivenessValue)
         self.SetStringItem(idx, 2, eRat)
         self.theSelectedValue = targetName
         (self.setTargets[self.theCurrentEnvironment]).add(targetName)