Jump to content

Disabling GUI controls


theom
 Share

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.

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...