Store any number of image lists in wxRibbonBar, not just two
The same wxRibbonBar can use multiple button bars with different icon sizes, so 2 image lists are not enough. But OTOH there is no need to distinguish between small and large images neither, so 2 may be also 1 too many. Instead, use however many image lists we need, depending on the size. For now, just store them in a vector and use linear search in it, instead of using a map or, maybe, sorted vector, as we suppose there are never going to be more than a couple of elements in this vector anyhow.
This commit is contained in:
@@ -20,6 +20,8 @@ class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
#include "wx/ribbon/control.h"
|
||||
#include "wx/ribbon/page.h"
|
||||
|
||||
#include "wx/vector.h"
|
||||
|
||||
enum wxRibbonBarOption
|
||||
{
|
||||
wxRIBBON_BAR_SHOW_PAGE_LABELS = 1 << 0,
|
||||
@@ -154,9 +156,9 @@ public:
|
||||
|
||||
void HideIfExpanded();
|
||||
|
||||
// Implementation only.
|
||||
// Return the image list containing images of the given size, creating it
|
||||
// if necessary.
|
||||
wxImageList* GetButtonImageList(wxSize size);
|
||||
wxImageList* GetButtonSmallImageList(wxSize size);
|
||||
|
||||
protected:
|
||||
friend class wxRibbonPage;
|
||||
@@ -214,8 +216,7 @@ protected:
|
||||
|
||||
wxRibbonDisplayMode m_ribbon_state;
|
||||
|
||||
wxImageList* m_buttonImageList;
|
||||
wxImageList* m_buttonSmallImageList;
|
||||
wxVector<wxImageList*> m_image_lists;
|
||||
|
||||
#ifndef SWIG
|
||||
wxDECLARE_CLASS(wxRibbonBar);
|
||||
|
Reference in New Issue
Block a user