Change wxGetTopLevelParent() to take wxWindowBase

This makes it more convenient to use when building wxUniv, when
wxWindow$TOOLKIT objects are wxWindowBase but not actually wxWindow.

No real changes.
This commit is contained in:
Vadim Zeitlin 2020-02-17 19:35:40 +01:00
parent 482426f4fc
commit a4906f1222
2 changed files with 3 additions and 2 deletions

View File

@ -2073,7 +2073,7 @@ extern WXDLLIMPEXP_CORE wxPoint wxGetMousePosition();
extern WXDLLIMPEXP_CORE wxWindow *wxGetActiveWindow();
// get the (first) top level parent window
WXDLLIMPEXP_CORE wxWindow* wxGetTopLevelParent(wxWindow *win);
WXDLLIMPEXP_CORE wxWindow* wxGetTopLevelParent(wxWindowBase *win);
#if wxUSE_ACCESSIBILITY
// ----------------------------------------------------------------------------

View File

@ -3655,8 +3655,9 @@ void wxWindowBase::DragAcceptFiles(bool accept)
// global functions
// ----------------------------------------------------------------------------
wxWindow* wxGetTopLevelParent(wxWindow *win)
wxWindow* wxGetTopLevelParent(wxWindowBase *win_)
{
wxWindow* win = static_cast<wxWindow *>(win_);
while ( win && !win->IsTopLevel() )
win = win->GetParent();