Deriving a new class for every object that does a different thing is a pain in the arse. Suddenly, youve got 35 button classes that do almost the same thing. This is horribly inefficient. The function pointer/message queue thing is one of the cleaner methods. You could also implement the State pattern, and have a base UIState, with several members, and switch states for each action. Just derive a new state class for each thing (this still leaves you with a ton of classes that all do similar things).
Z.
Popular Topics
Advertisement