Remove unnecessary wxIsWindowOrParentDisabled()
wxWindow::IsEnabled() already returns false if any of the window ancestors are disabled, there is no need to check them explicitly.
This commit is contained in:
@@ -565,20 +565,9 @@ bool wxWindowMac::SetBackgroundColour(const wxColour& col )
|
||||
return true ;
|
||||
}
|
||||
|
||||
static bool wxIsWindowOrParentDisabled(wxWindow* w)
|
||||
{
|
||||
while (w && !w->IsTopLevel())
|
||||
{
|
||||
if (!w->IsEnabled())
|
||||
return true;
|
||||
w = w->GetParent();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxWindowMac::SetFocus()
|
||||
{
|
||||
if (wxIsWindowOrParentDisabled((wxWindow*) this))
|
||||
if ( !IsEnabled() )
|
||||
return;
|
||||
|
||||
wxWindow* former = FindFocus() ;
|
||||
|
Reference in New Issue
Block a user