[Mac, 2.8.2] strange behavior of wxWindowBase::Validate()

Yaron Tadmor YaronT at HumanEyes.com
Tue Jul 17 03:24:15 PDT 2007


I must say I find this concept very strange, why wouldn't Validate()
also use the object's validator. I fail to see the advantage of such
design.

But, if a solution to my problem exists (even if in the form of ugly
code), I will let it go and use it.


> -----Original Message-----
> From: Robin Dunn [mailto:robin at alldunn.com]
> Sent: Monday, July 16, 2007 6:34 PM
> To: wx-users at lists.wxwidgets.org
> Subject: Re: [Mac, 2.8.2] strange behavior of wxWindowBase::Validate()
> 
> Yaron Tadmor wrote:
> > Hi,
> >
> > Looking at the code of wxWindowBase::Validate(), I noticed something
> > strange.
> >
> > The Validator of  "this" is never used. Only the validators of the
> > children. And then a recursion occurs as needed.
> >
> > This seems very strange.
> 
> It is how it is documented to work, and AFAIK it has always been this
> way.  Validate is intended to be called on a container window with
child
> controls.  In such a case the container is valid only if all of its
> controls are valid, so it doesn't need its own validator.
> 
> 
> >
> > Say I have a window and a control hierarchy. I would call Validate()
of
> > the whole window to validate the whole content, but I would also
like to
> > take one control and call its Validate() method to validate only
that
> > control. As things are now, I can't do that since the control's
> > validator is never used.
> 
> 
> 	theControl->GetValidator()->Validate(theControl)
> 
> 
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org  Java give you jitters?  Relax with wxPython!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
> 





More information about the wx-users mailing list