[wx-dev] what should IsEnabled() really return?

Stefan Csomor csomor at advancedconcepts.ch
Thu Mar 15 22:05:04 PDT 2007


Hi

> IsEnabled() return for a window which wasn't disabled itself
> explicitly but
> whose parent is currently disabled, so effectively disabling (as in
> "preventing it from getting input") this window too?
> 
>  Currently the return value in this case is true, but I think it
> would make
> more sense to return false. If not, we should at least add some
> IsEffectivelyEnabled() which would return true if and only if the
> window is
> really enabled. But it would be IMO even better to just make
> IsEnabled()
> behave like this.

I still would like to have two functions for these questions, or an
additional parameter, OS X itself eg has

IsVisible and IsLatentlyVisible
IsEnabled has a "latent enabled" parameter

I also think that MSW and GTK don't treat this in a similar manner,
looking at the code GTK calls wxWindowBase::Enable always, while MSW
puts it into a disabled children list, if its parent is not enabled. So
IMHO GTK should give you the same behavior as OSX, doesn't it ?

I agree that IsEnabled() should show the 'real' state, and IsShown()
should do so as well. With the current implementation of only HIViews
this shouldn't pose a big problem for wxMac anymore. As I said if
possible I'd like to have those latent variants as well.

Best,

Stefan









More information about the wx-dev mailing list