]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/window_osx.cpp
wxRichTextCtrl native caret now flashes, for wxMac/Core Graphics mode
[wxWidgets.git] / src / osx / window_osx.cpp
index fb1040f88d717c074da16d8de3a8fe79577ad066..1eb9d99b2869d28ff071ecad8af47004e30b0a83 100644 (file)
@@ -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;