06-23-2008 11:38 AM
06-23-2008 12:03 PM
I had a very brief look at your code.
If I was coding the solution and keeping it simple, I would have the top look handle user events (Event Structure) and a second loop that has a state machine. The state machine would consider both internal state chanegs as well as any state change from the Event handler (above loop). Data would be sent from the Event loop to the state machine loop via Queue because it may contain instructions such as "run" or "repeat", etc.
There is a template for the architecture that I describe under the File Menu > New > From Template > Producer / Consumer Design Pattern (Event). You would have to change the bottom loop to a state machine.
RayR