mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-21 06:19:36 +08:00
Use wxBaseArray instead of object array for wxAuiToolBarItemArray
This class is part of the public API, as it is used by the public wxAuiToolBar functions, so we can't make it just a vector, but we can still make it a wxBaseArray instead of using the old macro-based object array for it. Also document it.
This commit is contained in:
@@ -254,9 +254,7 @@ private:
|
||||
int m_alignment; // sizer alignment flag, defaults to wxCENTER, may be wxEXPAND or any other
|
||||
};
|
||||
|
||||
#ifndef SWIG
|
||||
WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiToolBarItem, wxAuiToolBarItemArray, WXDLLIMPEXP_AUI);
|
||||
#endif
|
||||
using wxAuiToolBarItemArray = wxBaseArray<wxAuiToolBarItem>;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -454,6 +454,17 @@ public:
|
||||
bool CanBeToggled() const;
|
||||
};
|
||||
|
||||
/**
|
||||
A vector of AUI toolbar items.
|
||||
|
||||
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
|
||||
wxAuiToolBarItem objects in the application code.
|
||||
*/
|
||||
class wxAuiToolBarItemArray : public std::vector<wxAuiToolBarItem>
|
||||
{
|
||||
};
|
||||
|
||||
/**
|
||||
@class wxAuiToolBarArt
|
||||
|
||||
|
||||
+1
-5
@@ -36,10 +36,6 @@
|
||||
#include "wx/osx/private.h"
|
||||
#endif
|
||||
|
||||
#include "wx/arrimpl.cpp"
|
||||
WX_DEFINE_OBJARRAY(wxAuiToolBarItemArray)
|
||||
|
||||
|
||||
wxDEFINE_EVENT( wxEVT_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEvent );
|
||||
wxDEFINE_EVENT( wxEVT_AUITOOLBAR_OVERFLOW_CLICK, wxAuiToolBarEvent );
|
||||
wxDEFINE_EVENT( wxEVT_AUITOOLBAR_RIGHT_CLICK, wxAuiToolBarEvent );
|
||||
@@ -1258,7 +1254,7 @@ wxAuiToolBarItem* wxAuiToolBar::FindToolByIndex(int idx) const
|
||||
if (idx >= (int)m_items.size())
|
||||
return nullptr;
|
||||
|
||||
return &(m_items[idx]);
|
||||
return const_cast<wxAuiToolBarItem*>(&(m_items[idx]));
|
||||
}
|
||||
|
||||
void wxAuiToolBar::SetToolClientData (int tool_id, wxObject *client_data)
|
||||
|
||||
Reference in New Issue
Block a user