diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index 02af6173ee..171a22380e 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -109,10 +109,19 @@ public: }; -#ifndef SWIG -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiNotebookPage, wxAuiNotebookPageArray, WXDLLIMPEXP_AUI); -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiTabContainerButton, wxAuiTabContainerButtonArray, WXDLLIMPEXP_AUI); -#endif +// These legacy classes can't be just typedefs as they can be (and are) +// forward-declared in the existing code. +class wxAuiNotebookPageArray : public wxBaseArray +{ +public: + using wxBaseArray::wxBaseArray; +}; + +class wxAuiTabContainerButtonArray : public wxBaseArray +{ +public: + using wxBaseArray::wxBaseArray; +}; class WXDLLIMPEXP_AUI wxAuiTabContainer diff --git a/interface/wx/aui/auibook.h b/interface/wx/aui/auibook.h index d308c887f5..c8d6510f78 100644 --- a/interface/wx/aui/auibook.h +++ b/interface/wx/aui/auibook.h @@ -453,6 +453,17 @@ public: bool active; // true if the page is currently active }; +/** + A vector of AUI notebook pages. + + This class is actually a legacy container (see @ref overview_container for + more details), but it can, and should be, handled as just a vector of + wxAuiNotebookPage objects in the application code. +*/ +class wxAuiNotebookPageArray : public std::vector +{ +}; + /** @class wxAuiTabContainerButton @@ -480,6 +491,18 @@ public: }; +/** + A vector of AUI tab buttons. + + This class is actually a legacy container (see @ref overview_container for + more details), but it can, and should be, handled as just a vector of + wxAuiTabContainerButton objects in the application code. +*/ +class wxAuiTabContainerButtonArray : public std::vector +{ +}; + + /** @class wxAuiTabContainer diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index f355542892..d10384b71b 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -34,10 +34,6 @@ #include "wx/osx/private.h" #endif -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxAuiNotebookPageArray) -WX_DEFINE_OBJARRAY(wxAuiTabContainerButtonArray) - wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEvent); wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_PAGE_CLOSED, wxAuiNotebookEvent); wxDEFINE_EVENT(wxEVT_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebookEvent); @@ -866,8 +862,11 @@ bool wxAuiTabContainer::TabHitTest(int x, int y, wxWindow** hit) const wxAuiTabContainerButton* btn = nullptr; if (ButtonHitTest(x, y, &btn) && !(btn->curState & wxAUI_BUTTON_STATE_DISABLED)) { - if (m_buttons.Index(*btn) != wxNOT_FOUND) - return false; + for ( const auto& button : m_buttons ) + { + if ( btn == &button ) + return false; + } } size_t i, page_count = m_pages.GetCount();