   Help, GUI development!
  Hi all,I'm a beginner in GUI development. I'm using MFC SDI to develop GUI. One thing that I'm confused is that how do you mantain all the GUI/Application states. Let say, you have an application level state called COLOR. this COLOR can be changed by clicking left click mouse, keyboard input and clicking on the toolbar. How do you manage this state?Obvious and not so good one is to handle it one by one, responding to each event:i.e.OnMouseClick() { if left click change color }OnKeyboardInput() { change color }OnToolbarClick() { change color }A better one is calling one global function:i.e.OnMouseClick() { if left click UpdateColor() }OnKeyboardInput() { UpdateColor() }OnToolbarClick() { UpdateColor() }the problem is there are too many states and the states may trigger another event (and affects app behaviour). How do we handle this ? Currently I put all the states handling function in one class (singleton class) and every event that changes any states will call a corresponding function from the singleton class.Could you please help?? I think that this is not so correct...regards,tep   