Remove wxRibbonButtonBar::m_ownerRibbonBar
There is already a function returning the containing ribbon bar, so just use it instead.
This commit is contained in:
@@ -213,7 +213,6 @@ protected:
|
|||||||
bool m_layouts_valid;
|
bool m_layouts_valid;
|
||||||
bool m_lock_active_state;
|
bool m_lock_active_state;
|
||||||
bool m_show_tooltips_for_disabled;
|
bool m_show_tooltips_for_disabled;
|
||||||
wxRibbonBar* m_ownerRibbonBar;
|
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
wxDECLARE_CLASS(wxRibbonButtonBar);
|
wxDECLARE_CLASS(wxRibbonButtonBar);
|
||||||
|
@@ -350,10 +350,10 @@ wxRibbonButtonBarButtonBase* wxRibbonButtonBar::InsertButton(
|
|||||||
|
|
||||||
wxImageList* buttonImageList = NULL;
|
wxImageList* buttonImageList = NULL;
|
||||||
wxImageList* buttonSmallImageList = NULL;
|
wxImageList* buttonSmallImageList = NULL;
|
||||||
if (m_ownerRibbonBar)
|
if ( wxRibbonBar* const ribbon = GetAncestorRibbonBar() )
|
||||||
{
|
{
|
||||||
buttonImageList = m_ownerRibbonBar->GetButtonImageList(m_bitmap_size_large);
|
buttonImageList = ribbon->GetButtonImageList(m_bitmap_size_large);
|
||||||
buttonSmallImageList = m_ownerRibbonBar->GetButtonSmallImageList(m_bitmap_size_small);
|
buttonSmallImageList = ribbon->GetButtonSmallImageList(m_bitmap_size_small);
|
||||||
}
|
}
|
||||||
if (base->bitmap_large.IsOk() && buttonImageList)
|
if (base->bitmap_large.IsOk() && buttonImageList)
|
||||||
{
|
{
|
||||||
@@ -880,10 +880,12 @@ void wxRibbonButtonBar::OnPaint(wxPaintEvent& WXUNUSED(evt))
|
|||||||
wxRibbonButtonBarButtonInstance& button = layout->buttons.Item(btn_i);
|
wxRibbonButtonBarButtonInstance& button = layout->buttons.Item(btn_i);
|
||||||
wxRibbonButtonBarButtonBase* base = button.base;
|
wxRibbonButtonBarButtonBase* base = button.base;
|
||||||
wxRect rect(button.position + m_layout_offset, base->sizes[button.size].size);
|
wxRect rect(button.position + m_layout_offset, base->sizes[button.size].size);
|
||||||
if (base->barButtonImageListPos != -1 && m_ownerRibbonBar)
|
|
||||||
|
wxRibbonBar* const ribbon = GetAncestorRibbonBar();
|
||||||
|
if ( base->barButtonImageListPos != -1 && ribbon )
|
||||||
{
|
{
|
||||||
wxImageList* buttonImageList = m_ownerRibbonBar->GetButtonImageList(m_bitmap_size_large);
|
wxImageList* buttonImageList = ribbon->GetButtonImageList(m_bitmap_size_large);
|
||||||
wxImageList* buttonSmallImageList = m_ownerRibbonBar->GetButtonSmallImageList(m_bitmap_size_small);
|
wxImageList* buttonSmallImageList = ribbon->GetButtonSmallImageList(m_bitmap_size_small);
|
||||||
|
|
||||||
wxBitmap bitmap;
|
wxBitmap bitmap;
|
||||||
wxBitmap bitmap_small;
|
wxBitmap bitmap_small;
|
||||||
@@ -939,20 +941,6 @@ void wxRibbonButtonBar::OnSize(wxSizeEvent& evt)
|
|||||||
|
|
||||||
void wxRibbonButtonBar::CommonInit(long WXUNUSED(style))
|
void wxRibbonButtonBar::CommonInit(long WXUNUSED(style))
|
||||||
{
|
{
|
||||||
//Our ultimate parent MAY be a ribbon bar, in which case
|
|
||||||
//we can use its image list.
|
|
||||||
m_ownerRibbonBar = NULL;
|
|
||||||
wxWindow* pWin = GetParent();
|
|
||||||
while (pWin)
|
|
||||||
{
|
|
||||||
m_ownerRibbonBar = dynamic_cast<wxRibbonBar*>(pWin);
|
|
||||||
if (m_ownerRibbonBar)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
pWin = pWin->GetParent();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_bitmap_size_large = wxSize(32, 32);
|
m_bitmap_size_large = wxSize(32, 32);
|
||||||
m_bitmap_size_small = wxSize(16, 16);
|
m_bitmap_size_small = wxSize(16, 16);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user