Files
wxWidgets/src/generic
Julian Smart 4849c8132b Fixed [ 548055 ] Bug in wxToolBarSimple::Realize()
Cédric RICARD

There is an inversion in wxToolBarSimple::Realize():

The current code is :
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
m_maxWidth += maxToolWidth;
else
m_maxHeight += maxToolHeight;

I think it should be :
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
m_maxHeight += maxToolHeight;
else
m_maxWidth += maxToolWidth;


Just take an example to see the bug, and have a look
to the rest of the function :

If you create an horizontal tool bar with only 3
tools of 16 pixels length each, when you reach this
code, m_maxWidth is equal to 3*16 pixels. So it have
the good width. You needn't to add other 16 pixels.
But m_maxHeight is equal to 0 ! So you have to take
care of the line you have just created...

This is very logical. In an horizontal tool bar,
m_maxWidth is increased after each new tool. But
m_maxHeight is only increased when an entire line is
finished, or when the last tool is added to take care
of the last line.

And at last, I think you should add a :

SetSize(m_maxWidth, m_maxHeight);

after the previous code. Just try the ToolBar sample
code. It only works if I do that...




git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-09-20 08:21:00 +00:00
..
2002-09-02 15:19:31 +00:00
2002-06-27 23:02:07 +00:00
2002-07-22 23:06:36 +00:00
2002-03-17 07:38:01 +00:00
2002-03-26 09:37:35 +00:00
2002-09-19 05:31:00 +00:00
2001-07-05 18:48:48 +00:00
2002-09-17 15:31:18 +00:00
2002-08-30 13:49:49 +00:00
2002-08-17 20:50:34 +00:00
2002-09-01 17:02:36 +00:00
2002-08-25 20:27:35 +00:00
2001-07-12 15:02:40 +00:00
2002-04-02 17:37:00 +00:00
2002-09-04 13:16:46 +00:00
2002-09-01 17:02:36 +00:00
2002-09-14 02:10:24 +00:00
2002-01-22 15:39:40 +00:00