git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17026
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
wxToolBarTool *tool = (wxToolBarTool *)toolBase;
{
wxToolBarTool *tool = (wxToolBarTool *)toolBase;
- // we have inserted a space before all the tools
- if (m_xMargin > 1) pos++;
+ // if we have inserted a space before all the tools we must change the GTK
+ // index by 1
+ size_t posGtk = m_xMargin > 1 ? pos + 1 : pos;
if ( tool->IsButton() )
{
if ( tool->IsButton() )
{
tool->m_pixmap,
(GtkSignalFunc)gtk_toolbar_callback,
(gpointer)tool,
tool->m_pixmap,
(GtkSignalFunc)gtk_toolbar_callback,
(gpointer)tool,
break;
case wxTOOL_STYLE_SEPARATOR:
break;
case wxTOOL_STYLE_SEPARATOR:
- gtk_toolbar_insert_space( m_toolbar, pos );
+ gtk_toolbar_insert_space( m_toolbar, posGtk );
// skip the rest
return TRUE;
// skip the rest
return TRUE;
tool->GetControl()->m_widget,
(const char *) NULL,
(const char *) NULL,
tool->GetControl()->m_widget,
(const char *) NULL,
(const char *) NULL,
wxCHECK_RET( GetToolsCount() == 0,
wxT("wxToolBar::SetMargins must be called before adding tools.") );
wxCHECK_RET( GetToolsCount() == 0,
wxT("wxToolBar::SetMargins must be called before adding tools.") );
- if (x > 1) gtk_toolbar_append_space( m_toolbar ); // oh well
+ if (x > 1)
+ gtk_toolbar_append_space( m_toolbar ); // oh well
m_xMargin = x;
m_yMargin = y;
m_xMargin = x;
m_yMargin = y;
{
wxToolBarTool *tool = (wxToolBarTool *)toolBase;
{
wxToolBarTool *tool = (wxToolBarTool *)toolBase;
- // we have inserted a space before all the tools
- if (m_xMargin > 1) pos++;
+ // if we have inserted a space before all the tools we must change the GTK
+ // index by 1
+ size_t posGtk = m_xMargin > 1 ? pos + 1 : pos;
if ( tool->IsButton() )
{
if ( tool->IsButton() )
{
tool->m_pixmap,
(GtkSignalFunc)gtk_toolbar_callback,
(gpointer)tool,
tool->m_pixmap,
(GtkSignalFunc)gtk_toolbar_callback,
(gpointer)tool,
break;
case wxTOOL_STYLE_SEPARATOR:
break;
case wxTOOL_STYLE_SEPARATOR:
- gtk_toolbar_insert_space( m_toolbar, pos );
+ gtk_toolbar_insert_space( m_toolbar, posGtk );
// skip the rest
return TRUE;
// skip the rest
return TRUE;
tool->GetControl()->m_widget,
(const char *) NULL,
(const char *) NULL,
tool->GetControl()->m_widget,
(const char *) NULL,
(const char *) NULL,
wxCHECK_RET( GetToolsCount() == 0,
wxT("wxToolBar::SetMargins must be called before adding tools.") );
wxCHECK_RET( GetToolsCount() == 0,
wxT("wxToolBar::SetMargins must be called before adding tools.") );
- if (x > 1) gtk_toolbar_append_space( m_toolbar ); // oh well
+ if (x > 1)
+ gtk_toolbar_append_space( m_toolbar ); // oh well
m_xMargin = x;
m_yMargin = y;
m_xMargin = x;
m_yMargin = y;