Code in Form: Swatch

Note from the code here that the swatch object itself has no additional code behind it. All the code on this form is in the Click events of the command buttons that manage the enabled methods of the buttons and to call the appropriate Swatch object method. Here's the code:


*-- Method cmdStart.Click()
this.enabled = .F.
thisform.cmdStop.enabled = .T.
thisform.cmdPause.enabled = .T.
thisform.cmdResume.enabled = .F.
thisform.cmdReset.enabled = .F.
thisform.Swatch1.Start()

*-- Method cmdStop.Click()
this.enabled = .F.
thisform.cmdStart.enabled = .T.
thisform.cmdPause.enabled = .F.
thisform.cmdResume.enabled = .T.
thisform.cmdReset.enabled = .T.
thisform.swatch1.stop()

*-- Method cmdPause.Click()
this.enabled = .F.
thisform.cmdStop.enabled = .T.
thisform.cmdStart.enabled = .F.
thisform.cmdResume.enabled = .T.
thisform.cmdReset.enabled = .F.
ThisForm.Swatch1.Pause()

*-- Method cmdResume.Click()
this.enabled = .F.
thisform.cmdStart.enabled = .F.
thisform.cmdPause.enabled = .T.
thisform.cmdStop.enabled = .T.
thisform.cmdResume.enabled = .F.
thisform.cmdReset.enabled = .F.
thisform.swatch1.resume()

*-- Method cmdReset.Click()
thisform.swatch1.reset()