\helpref{wxGetSingleChoice}{wxgetsinglechoice}\\
\helpref{wxGetTempFileName}{wxgettempfilename}\\
\helpref{wxGetTextFromUser}{wxgettextfromuser}\\
+\helpref{wxGetTopLevelParent}{wxgettoplevelparent}\\
\helpref{wxGetTranslation}{wxgettranslation}\\
\helpref{wxGetUTCTime}{wxgetutctime}\\
\helpref{wxGetUserHome}{wxgetuserhome}\\
<wx/utils.h>
+\membersection{::wxGetTopLevelParent}\label{wxgettoplevelparent}
+
+\func{wxWindow *}{wxGetTopLevelParent}{\param{wxWindow }{*win}}
+
+Returns the first top level parent of the given window, or in other words, the
+frame or dialog containing it, or {\tt NULL}.
+
+\wxheading{Include files}
+
+<wx/window.h>
+
\membersection{::wxLoadUserResource}\label{wxloaduserresource}
\func{wxString}{wxLoadUserResource}{\param{const wxString\& }{resourceName}, \param{const wxString\& }{resourceType=``TEXT"}}
// get the currently active window of this application or NULL
WXDLLEXPORT extern wxWindow *wxGetActiveWindow();
+// get the (first) top level parent window
+WXDLLEXPORT wxWindow* wxGetTopLevelParent(wxWindow *win);
+
// deprecated (doesn't start with 'wx' prefix), use wxWindow::NewControlId()
inline int NewControlId() { return wxWindowBase::NewControlId(); }
#endif
// _WX_WINDOW_H_BASE_
-// vi:sts=4:sw=4:et
GetCapture());
}
-// vi:sts=4:sw=4:et
+// ----------------------------------------------------------------------------
+// global functions
+// ----------------------------------------------------------------------------
+
+wxWindow* wxGetTopLevelParent(wxWindow *win)
+{
+ while ( win && !win->IsTopLevel() )
+ win = win->GetParent();
+
+ return win;
+}
+