X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1b1c779a93201210197a57a1882e81c988a80fd..a188ac2988b6fedeead7a809124b8eaa2290c020:/src/osx/window_osx.cpp diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index fb1040f88d..1eb9d99b28 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -405,11 +405,25 @@ 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 ( !AcceptsFocus() ) return ; + if (wxIsWindowOrParentDisabled((wxWindow*) this)) + return; + wxWindow* former = FindFocus() ; if ( former == this ) return ; @@ -1089,8 +1103,11 @@ int wxWindowMac::GetCharWidth() const return width; } -void wxWindowMac::GetTextExtent(const wxString& str, int *x, int *y, - int *descent, int *externalLeading, const wxFont *theFont ) const +void wxWindowMac::DoGetTextExtent(const wxString& str, + int *x, int *y, + int *descent, + int *externalLeading, + const wxFont *theFont) const { const wxFont *fontToUse = theFont; wxFont tempFont;