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:
Vadim Zeitlin
2019-10-27 01:30:43 +02:00
parent a5d719dc19
commit 37ca3bcae9

View File

@@ -565,20 +565,9 @@ bool wxWindowMac::SetBackgroundColour(const wxColour& col )
return true ; return true ;
} }
static bool wxIsWindowOrParentDisabled(wxWindow* w)
{
while (w && !w->IsTopLevel())
{
if (!w->IsEnabled())
return true;
w = w->GetParent();
}
return false;
}
void wxWindowMac::SetFocus() void wxWindowMac::SetFocus()
{ {
if (wxIsWindowOrParentDisabled((wxWindow*) this)) if ( !IsEnabled() )
return; return;
wxWindow* former = FindFocus() ; wxWindow* former = FindFocus() ;