+ toolBar->AddTool(wxID_COPY, wxT("Copy"), toolBarBitmaps[Tool_copy], wxT("Toggle button 2"), wxITEM_CHECK);
+ toolBar->AddTool(wxID_CUT, wxT("Cut"), toolBarBitmaps[Tool_cut], wxT("Toggle/Untoggle help button"));
+ toolBar->AddTool(wxID_PASTE, wxT("Paste"), toolBarBitmaps[Tool_paste], wxT("Paste"));
+ toolBar->AddSeparator();
+
+ if ( m_useCustomDisabled )
+ {
+ wxBitmap bmpDisabled(w, h);
+ {
+ wxMemoryDC dc;
+ dc.SelectObject(bmpDisabled);
+ dc.DrawBitmap(toolBarBitmaps[Tool_print], 0, 0);
+
+ wxPen pen(*wxRED, 5);
+ dc.SetPen(pen);
+ dc.DrawLine(0, 0, w, h);
+ }
+
+ toolBar->AddTool(wxID_PRINT, wxT("Print"), toolBarBitmaps[Tool_print],
+ bmpDisabled);
+ }
+ else
+ {
+ toolBar->AddTool(wxID_PRINT, wxT("Print"), toolBarBitmaps[Tool_print],
+ 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."));
+ }
+
+ // add a stretchable space before the "Help" button to make it
+ // right-aligned
+ toolBar->AddStretchableSpace();
+ toolBar->AddTool(wxID_HELP, wxT("Help"), toolBarBitmaps[Tool_help], wxT("Help button"), wxITEM_CHECK);
+
+ if ( !m_pathBmp.empty() )
+ {
+ // create a tool with a custom bitmap for testing
+ wxImage img(m_pathBmp);
+ if ( img.IsOk() )
+ {
+ if ( img.GetWidth() > w && img.GetHeight() > h )
+ img = img.GetSubImage(wxRect(0, 0, w, h));
+
+ toolBar->AddSeparator();
+ toolBar->AddTool(wxID_ANY, wxT("Custom"), img);
+ }
+ }