The getNextStep method should return the next step in
the sequence, or it should return None to indicate that
it has finished collecting input from the user. The following example, which is
a modified version of the example in
Procedure example,
illustrates how inputs are collected from the user in a series of three steps
rather than just one:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getFirstStep(self):
self.cmd.setKeywordValuesToDefaults()
self.plateWidthDB = None
self.plateHeightDB = None
db = PlateNameDB(self)
self.step1 = AFXDialogStep(self, db)
return self.step1
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getNextStep(self, previousStep):
if previousStep == self.step1:
if not self.plateWidthDB:
self.plateWidthDB = PlateWidthDB(self)
self.step2 = AFXDialogStep(self, self.plateWidthDB)
return self.step2
elif previousStep == self.step2:
if not self.plateHeightDB:
self.plateHeightDB = PlateHeightDB(self)
self.step3 = AFXDialogStep(self, self.plateHeightDB)
return self.step3
else:
return None