+ popupMenu = new wxMenu;
+ popupMenu->Append(POEM_NEXT, _T("Next poem/page"));
+ popupMenu->Append(POEM_PREVIOUS, _T("Previous page"));
+ popupMenu->AppendSeparator();
+ popupMenu->Append(POEM_SEARCH, _T("Search"));
+ popupMenu->Append(POEM_NEXT_MATCH, _T("Next match"));
+ popupMenu->Append(POEM_COPY, _T("Copy to clipboard"));
+ popupMenu->Append(POEM_MINIMIZE, _T("Minimize"));
+ popupMenu->AppendSeparator();
+ popupMenu->Append(POEM_BIGGER_TEXT, _T("Bigger text"));
+ popupMenu->Append(POEM_SMALLER_TEXT, _T("Smaller text"));
+ popupMenu->AppendSeparator();
+ popupMenu->Append(POEM_ABOUT, _T("About wxPoem"));
+ popupMenu->AppendSeparator();
+ popupMenu->Append(POEM_EXIT, _T("Exit"));
+}
+
+MyCanvas::~MyCanvas()
+{
+ // Note: this must be done before the main window/canvas are destroyed
+ // or we get an error (no parent window for menu item button)
+ delete popupMenu;
+ popupMenu = NULL;