]> git.saurik.com Git - wxWidgets.git/blobdiff - src/ribbon/control.cpp
Fix for #15520: wxRichTextCtrl: Drawing the selection doesn't respect its container...
[wxWidgets.git] / src / ribbon / control.cpp
index d80449445e475324f2a7f75f83998cbf3b9bfa77..ecd332103e7afda88c7219a4e92d62f01c594390 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Peter Cawley
 // Modified by:
 // Created:     2009-06-05
-// RCS-ID:      $Id$
 // Copyright:   (C) Peter Cawley
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -18,6 +17,7 @@
 #if wxUSE_RIBBON
 
 #include "wx/ribbon/control.h"
+#include "wx/ribbon/bar.h"
 
 #ifndef WX_PRECOMP
 #endif
@@ -109,4 +109,16 @@ bool wxRibbonControl::Realize()
     return true;
 }
 
+wxRibbonBar* wxRibbonControl::GetAncestorRibbonBar()const
+{
+    for ( wxWindow* win = GetParent(); win; win = win->GetParent() )
+    {
+        wxRibbonBar* bar = wxDynamicCast(win, wxRibbonBar);
+        if ( bar )
+            return bar;
+    }
+
+    return NULL;
+}
+
 #endif // wxUSE_RIBBON