X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd6e15974ce2488ba7702658b8daf2a679f62984..b3ee9f4d2efa4a5088b4c84eb8a0ba712fa7e7fb:/src/ribbon/control.cpp?ds=sidebyside diff --git a/src/ribbon/control.cpp b/src/ribbon/control.cpp index d80449445e..9867ecf7d2 100644 --- a/src/ribbon/control.cpp +++ b/src/ribbon/control.cpp @@ -18,6 +18,7 @@ #if wxUSE_RIBBON #include "wx/ribbon/control.h" +#include "wx/ribbon/bar.h" #ifndef WX_PRECOMP #endif @@ -109,4 +110,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