diff --git a/docs/changes.txt b/docs/changes.txt index b8f38446b6..7fd9b9e75a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -129,17 +129,17 @@ wxMac: - Fixed 'Reopen' application behaviour (a window was not always shown when reopening the app). -2.8.6 +2.8.8 ----- -All: - -- Fixed another bug in wxFileConfig when deleting entries (Axel Gembe) -- Added Portuguese translation (Antonio Cardoso Martins) - - All (GUI): +- Added wxWindow::GetNextSibling() and GetPrevSibling() + + +2.8.7 +----- + - Added an optimization to UI updates on idle, by only updating when the window is shown. - Multiple centre panes in wxAUI can now be resized. @@ -164,6 +164,16 @@ wxMac: - Fixed a crash in wxToolBar when adding tools with non-standard sizes. + +2.8.6 +----- + +All: + +- Fixed another bug in wxFileConfig when deleting entries (Axel Gembe) +- Added Portuguese translation (Antonio Cardoso Martins) + + 2.8.5 ----- diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 584d76b13d..765a7f1905 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -1120,6 +1120,20 @@ name in the window constructor or via \helpref{wxWindow::SetName}{wxwindowsetnam \helpref{wxWindow::SetName}{wxwindowsetname} +\membersection{wxWindow::GetNextSibling}\label{wxwindowgetnextsibling} + +\constfunc{wxWindow *}{GetNextSibling}{\void} + +Returns the next window after this one among the parent children or \NULL if +this window is the last child. + +\newsince{2.8.8} + +\wxheading{See also} + +\helpref{GetPrevSibling}{wxwindowgetprevsibling} + + \membersection{wxWindow::GetParent}\label{wxwindowgetparent} \constfunc{virtual wxWindow*}{GetParent}{\void} @@ -1166,6 +1180,20 @@ method:\par \helpref{GetScreenPosition}{wxwindowgetscreenposition} +\membersection{wxWindow::GetPrevSibling}\label{wxwindowgetprevsibling} + +\constfunc{wxWindow *}{GetPrevSibling}{\void} + +Returns the previous window before this one among the parent children or \NULL if +this window is the first child. + +\newsince{2.8.8} + +\wxheading{See also} + +\helpref{GetNextSibling}{wxwindowgetnextsibling} + + \membersection{wxWindow::GetRect}\label{wxwindowgetrect} \constfunc{virtual wxRect}{GetRect}{\void} diff --git a/include/wx/window.h b/include/wx/window.h index 320dabe683..3477511474 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -573,6 +573,13 @@ public: // needed just for extended runtime const wxWindowList& GetWindowChildren() const { return GetChildren() ; } +#if wxABI_VERSION >= 20808 + // get the window before/after this one in the parents children list, + // returns NULL if this is the first/last window + wxWindow *GetPrevSibling() const { return DoGetSibling(MoveBefore); } + wxWindow *GetNextSibling() const { return DoGetSibling(MoveAfter); } +#endif // wx 2.8.8+ + // get the parent or the parent of the parent wxWindow *GetParent() const { return m_parent; } inline wxWindow *GetGrandParent() const; @@ -1141,12 +1148,18 @@ protected: virtual bool TryValidator(wxEvent& event); virtual bool TryParent(wxEvent& event); - // common part of MoveBefore/AfterInTabOrder() enum MoveKind { MoveBefore, // insert before the given window MoveAfter // insert after the given window }; + +#if wxABI_VERSION >= 20808 + // common part of GetPrev/NextSibling() + wxWindow *DoGetSibling(MoveKind order) const; +#endif // wx 2.8.8+ + + // common part of MoveBefore/AfterInTabOrder() virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move); #if wxUSE_CONSTRAINTS diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 65c33625ae..1b5931c15b 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2617,6 +2617,27 @@ bool wxWindowBase::TryParent(wxEvent& event) return wxEvtHandler::TryParent(event); } +// ---------------------------------------------------------------------------- +// window relationships +// ---------------------------------------------------------------------------- + +wxWindow *wxWindowBase::DoGetSibling(MoveKind order) const +{ + wxCHECK_MSG( GetParent(), NULL, + _T("GetPrev/NextSibling() don't work for TLWs!") ); + + wxWindowList& siblings = GetParent()->GetChildren(); + wxWindowList::compatibility_iterator i = siblings.Find(this); + wxCHECK_MSG( i, NULL, _T("window not a child of its parent?") ); + + if ( order == MoveBefore ) + i = i->GetPrevious(); + else // MoveAfter + i = i->GetNext(); + + return i ? i->GetData() : NULL; +} + // ---------------------------------------------------------------------------- // keyboard navigation // ---------------------------------------------------------------------------- diff --git a/version-script.in b/version-script.in index 93edf8a0fb..c96e9541c8 100644 --- a/version-script.in +++ b/version-script.in @@ -24,11 +24,17 @@ # and once released its version cannot be changed. +# public symbols added in 2.8.8 (please keep in alphabetical order): +@WX_VERSION_TAG@.8 { + global: + *wxWindowBase*Get*Sibling*; +}; + # public symbols added in 2.8.7 (please keep in alphabetical order): @WX_VERSION_TAG@.7 { global: - *wxStaticBox*AcceptsFocus*; - *wxAuiPaneInfo*DockFixed*; + *wxStaticBox*AcceptsFocus*; + *wxAuiPaneInfo*DockFixed*; }; # public symbols added in 2.8.5 (please keep in alphabetical order):