Stop using object array for wxRibbonPageTabInfoArray

Replace it with a simple wxBaseArray of wxRibbonPageTabInfo.
This commit is contained in:
Vadim Zeitlin 2023-04-11 20:28:06 +02:00
parent 3755abba4f
commit edfa69faf0
3 changed files with 16 additions and 6 deletions

View file

@ -92,9 +92,12 @@ public:
bool shown;
};
#ifndef SWIG
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxRibbonPageTabInfo, wxRibbonPageTabInfoArray, WXDLLIMPEXP_RIBBON);
#endif
// This must be a class because it's forward declared.
class wxRibbonPageTabInfoArray : public wxBaseArray<wxRibbonPageTabInfo>
{
public:
using wxBaseArray<wxRibbonPageTabInfo>::wxBaseArray;
};
class WXDLLIMPEXP_RIBBON wxRibbonBar : public wxRibbonControl
{

View file

@ -111,6 +111,16 @@ public:
bool shown;
};
/**
A vector of wxRibbonPageTabInfo.
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
wxRibbonPageTabInfo objects in the application code.
*/
class wxRibbonPageTabInfoArray : public std::vector<wxRibbonPageTabInfoArray>
{
};
/**

View file

@ -26,11 +26,8 @@
#include "wx/msw/private.h"
#endif
#include "wx/arrimpl.cpp"
#include "wx/imaglist.h"
WX_DEFINE_USER_EXPORTED_OBJARRAY(wxRibbonPageTabInfoArray)
wxDEFINE_EVENT(wxEVT_RIBBONBAR_PAGE_CHANGED, wxRibbonBarEvent);
wxDEFINE_EVENT(wxEVT_RIBBONBAR_PAGE_CHANGING, wxRibbonBarEvent);
wxDEFINE_EVENT(wxEVT_RIBBONBAR_TAB_MIDDLE_DOWN, wxRibbonBarEvent);