def OnButtonClick(self, event): """ Event handler to respond to the button click event. Open Transition Form or create a copy of current Model New control mechanism may need to make more general method to open and manage child form """ id = event.GetId() if id == cdml.IDP_BUTTON1: # open transition form if self.Id == 0 : cdml.dlgSimpleMsg('ERROR', "This model is Empty. Please enter data before transitions", Parent = self) return frame = self.GetTopLevelParent() cdml.OpenForm('Transitions', self, cdml.ID_MODE_MULTI, self.Key, None, frame.idPrj) elif id == cdml.IDP_BUTTON2: cdml.dlgNotPrepared()
def OnButtonClick(self, event): """ Method to respond the action taken by user""" id = event.GetId() if id == cdml.IDP_BUTTON1: # Copy this set cdml.dlgNotPrepared() elif id == cdml.IDP_BUTTON2: # PopulationStructure cdml.dlgNotPrepared() elif id == cdml.IDP_BUTTON3: # PopulationData frame = self.GetTopLevelParent() if self.Id == 0: PopulationID = None else: PopulationID = self.Key CurrentName = str(self.tc_name.GetValue()) cdml.OpenForm("PopulationData", self, CurrentName, PopulationID, None, frame.idPrj)
def OnButtonClick(self, event): """ Event handler to respond to the button click event. Open Transition Form or create a copy of current Model New control mechanism may need to make more general method to open and manage child form """ id = event.GetId() if id == cdml.IDP_BUTTON1: # open transition form if self.Id == 0: cdml.dlgSimpleMsg( 'ERROR', "This model is Empty. Please enter data before transitions", Parent=self) return frame = self.GetTopLevelParent() cdml.OpenForm('Transitions', self, cdml.ID_MODE_MULTI, self.Key, None, frame.idPrj) elif id == cdml.IDP_BUTTON2: cdml.dlgNotPrepared()
def OnButtonClick(self, event): """ Method to respond the action taken by user""" id = event.GetId() if id == cdml.IDP_BUTTON1: # Copy this set cdml.dlgNotPrepared() elif id == cdml.IDP_BUTTON2: # PopulationStructure cdml.dlgNotPrepared() elif id == cdml.IDP_BUTTON3: # PopulationData frame = self.GetTopLevelParent() if self.Id == 0: PopulationID = None else: PopulationID = self.Key CurrentName = str(self.tc_name.GetValue()) cdml.OpenForm('PopulationData', self, CurrentName, PopulationID, None, frame.idPrj)