From: Leslie Newell on
Hi,

I have found a problem with vertical wxToolbars under wxWidgets 2.8.0,
msw. If Realize() is called more than once it displays incorrectly and
the buttons don't work. You don't need to add a button between the two
calls but it demonstrates why Realize() can get called more than once.


Here is a patch for the minimal sample to demonstrate the problem:

31,32d30
< #include <wx/artprov.h>
<
177,189d174
<
< wxBoxSizer * sizer = new wxBoxSizer(wxVERTICAL);
< wxToolBar * bar = new
wxToolBar(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTB_FLAT |
wxTB_NODIVIDER|wxTB_VERTICAL);
< bar->AddTool(1,_("btn1"),wxArtProvider::GetBitmap(wxART_FILE_SAVE));
< bar->AddTool(2,_("btn1"),wxArtProvider::GetBitmap(wxART_FILE_SAVE));
< bar->AddTool(3,_("btn1"),wxArtProvider::GetBitmap(wxART_FILE_SAVE));
< sizer->Add(bar,wxALIGN_LEFT);
< SetSizer(sizer);
< bar->Realize();
< bar->AddTool(3,_("btn1"),wxArtProvider::GetBitmap(wxART_FILE_SAVE));
< bar->Realize();
< sizer->Fit(this);
< sizer->SetSizeHints(this);


I did some searching and found an old patch to fix the problem. It looks
like a fudge to me but it does work.

--- src/msw/tbar95.cpp.0 Mon May 29 23:57:03 2006
+++ src/msw/tbar95.cpp Tue Dec 12 14:19:33 2006
-1063,9
+1063,9
}
else if ( m_nButtons > 0 ) // vertical non empty
toolbar
{
- if ( m_maxRows == 0 )
{
// if not set yet, have one column
+ m_maxRows = 1;
SetRows(m_nButtons);
}
}

Thanks,
Les

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Vadim Zeitlin on
On Fri, 02 Mar 2007 15:20:43 +0000 Leslie Newell <lesnewell(a)fmail.co.uk> wrote:

LN> I did some searching and found an old patch to fix the problem. It looks
LN> like a fudge to me but it does work.
LN>
LN> --- src/msw/tbar95.cpp.0 Mon May 29 23:57:03 2006
LN> +++ src/msw/tbar95.cpp Tue Dec 12 14:19:33 2006
LN> -1063,9
LN> +1063,9
LN> }
LN> else if ( m_nButtons > 0 ) // vertical non empty
LN> toolbar
LN> {
LN> - if ( m_maxRows == 0 )
LN> {
LN> // if not set yet, have one column
LN> + m_maxRows = 1;
LN> SetRows(m_nButtons);
LN> }
LN> }

This patch was applied to wx about 2 months ago so the problem should be
fixed in 2.8.2.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org