Make wxWS_EX_VALIDATE_RECURSIVELY default (and only) behaviour
In practice, almost everybody using validators also seems to use this style, so make it the default (this hadn't been done when it was originally introduced because of compatibility concerns, but now, 15+ years later, it's probably safe enough to change this).
This commit is contained in:
@@ -422,14 +422,6 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
|
||||
SetValidator(validator);
|
||||
#endif // wxUSE_VALIDATORS
|
||||
|
||||
// if the parent window has wxWS_EX_VALIDATE_RECURSIVELY set, we want to
|
||||
// have it too - like this it's possible to set it only in the top level
|
||||
// dialog/frame and all children will inherit it by defult
|
||||
if ( parent && (parent->GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) )
|
||||
{
|
||||
SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2036,12 +2028,9 @@ public:
|
||||
}
|
||||
|
||||
// Traverse all the direct children calling OnDo() on them and also all
|
||||
// grandchildren if wxWS_EX_VALIDATE_RECURSIVELY is used, calling
|
||||
// OnRecurse() for them.
|
||||
// grandchildren, calling OnRecurse() for them.
|
||||
bool DoForAllChildren()
|
||||
{
|
||||
const bool recurse = m_win->HasExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
|
||||
|
||||
wxWindowList& children = m_win->GetChildren();
|
||||
for ( wxWindowList::iterator i = children.begin();
|
||||
i != children.end();
|
||||
@@ -2057,7 +2046,7 @@ public:
|
||||
// Notice that validation should never recurse into top level
|
||||
// children, e.g. some other dialog which might happen to be
|
||||
// currently shown.
|
||||
if ( recurse && !child->IsTopLevel() && !OnRecurse(child) )
|
||||
if ( !child->IsTopLevel() && !OnRecurse(child) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user