Jump to content
  • Advertisement
Sign in to follow this  
stephanus

Help, GUI development!

This topic is 4490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!