wxToolBarToolBase *m_pInTool;
private:
+ // makes sure tool bitmap size is sufficient for all tools
+ void AdjustToolBitmapSize();
+
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxToolBar)
DECLARE_NO_COPY_CLASS(wxToolBar)
}
}
+void wxToolBar::AdjustToolBitmapSize()
+{
+ wxSize s(m_defaultWidth, m_defaultHeight);
+ const wxSize orig_s(s);
+
+ for ( wxToolBarToolsList::const_iterator i = m_tools.begin();
+ i != m_tools.end();
+ ++i )
+ {
+ const wxBitmap& bmp = (*i)->GetNormalBitmap();
+ s.IncTo(bmp.GetSize());
+ }
+
+ if ( s != orig_s )
+ SetToolBitmapSize(s);
+}
+
bool wxToolBar::Realize()
{
const size_t nTools = GetToolsCount();
// nothing to do
return true;
+ // make sure tool size is larger enough for all all bitmaps to fit in
+ // (this is consistent with what other ports do):
+ AdjustToolBitmapSize();
+
#ifdef wxREMAP_BUTTON_COLOURS
// don't change the values of these constants, they can be set from the
// user code via wxSystemOptions