Sign in to follow this  

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.