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).
This commit is contained in:
parent
e6b31adefe
commit
57ec523b6f
@ -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."));
|
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
|
// add a stretchable space before the "Help" button to make it
|
||||||
// right-aligned
|
// right-aligned
|
||||||
toolBar->AddStretchableSpace();
|
toolBar->AddStretchableSpace();
|
||||||
@ -530,7 +532,7 @@ MyFrame::MyFrame(wxFrame* parent,
|
|||||||
m_searchTool = NULL;
|
m_searchTool = NULL;
|
||||||
|
|
||||||
m_rows = 1;
|
m_rows = 1;
|
||||||
m_nPrint = 1;
|
m_nPrint = 0; // set to 1 in PopulateToolbar()
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
// Give it a status line
|
// Give it a status line
|
||||||
|
Loading…
Reference in New Issue
Block a user