From 57ec523b6f5c5ae638e4ddcfe8ea13482cd4b9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Mon, 31 Aug 2015 21:08:34 +0300 Subject: [PATCH] Fix "Print" tool handling in the toolbar sample Ensure that the count of the Print tools is always correct, even if more tools were inserted and then the toolbar was recreated (in a different position). --- samples/toolbar/toolbar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index ffdbdf3b92..57e6c2757e 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -481,6 +481,8 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) wxT("Delete this tool. This is a very long tooltip to test whether it does the right thing when the tooltip is more than Windows can cope with.")); } + m_nPrint = 1; + // add a stretchable space before the "Help" button to make it // right-aligned toolBar->AddStretchableSpace(); @@ -530,7 +532,7 @@ MyFrame::MyFrame(wxFrame* parent, m_searchTool = NULL; m_rows = 1; - m_nPrint = 1; + m_nPrint = 0; // set to 1 in PopulateToolbar() #if wxUSE_STATUSBAR // Give it a status line