X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd6e15974ce2488ba7702658b8daf2a679f62984..43f4e852a1b2ac37c3db6a2b87315192ac549191:/src/ribbon/control.cpp 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