Fix setting tool spacing.

Don't set orthogonal padding value to zero but preserve its current value (using MSWSetPadding method).
This way vertical padding is not zeroed when horizontal padding is set and horizontal padding is not zeroed when vertical padding is set.
This commit is contained in:
Artur Wieczorek 2015-12-14 22:03:24 +01:00
parent 38f6cf13d5
commit 8fdf4221dc

View File

@ -1630,14 +1630,14 @@ void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap )
void wxToolBar::SetToolPacking(int packing)
{
m_toolPacking = packing;
if (m_toolPacking > 0 && GetHWND())
if ( packing > 0 && packing != m_toolPacking )
{
if (IsVertical())
::SendMessage(GetHWND(), TB_SETPADDING, 0, MAKELPARAM(0, m_toolPacking));
else
::SendMessage(GetHWND(), TB_SETPADDING, 0, MAKELPARAM(m_toolPacking, 0));
Realize();
m_toolPacking = packing;
if ( GetHwnd() )
{
MSWSetPadding(packing);
Realize();
}
}
}