diff options
Diffstat (limited to 'wx+/focus.h')
-rw-r--r-- | wx+/focus.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wx+/focus.h b/wx+/focus.h index 4ba5f3f5..297d0754 100644 --- a/wx+/focus.h +++ b/wx+/focus.h @@ -24,6 +24,18 @@ bool isComponentOf(const wxWindow* child, const wxWindow* top) inline +wxWindow& getRootWindow(wxWindow& child) +{ + wxWindow* root = &child; + for (;;) + if (wxWindow* parent = root->GetParent()) + root = parent; + else + return *root; +} + + +inline wxTopLevelWindow* getTopLevelWindow(wxWindow* child) { for (wxWindow* wnd = child; wnd != nullptr; wnd = wnd->GetParent()) |