Sign in to follow this  
theom

Disabling GUI controls

Recommended Posts

What is your take on implementing a control disable feature?

Some thoughts (child overrides a parent handler):

  1. Set a flag in the Control class and it and all children need to know about the flag and honor it.
  2. Set a flag in the Control class and return false from the parent handler. The child only needs to act on the return value from the parent but call order matters, i.e the child needs to check with the parent method before doing anything else.

I have mainly used option 2 in the past but 1 as well and they both work well.

My current needs are to be able to disable buttons, which is easy to implement specifically for the button, but I think it's worth the effort to make this available to all the controls.

Share this post


Link to post
Share on other sites

I took a quick look at the Control class and it uses the same method as option 2, but for other purposes. Probably not a problem though.

I'll begin with the Button and see how disabling it meshes with the current code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.