-
- wxMenu *help_menu = new wxMenu;
- help_menu->Append(DOCVIEW_ABOUT, _T("&About"));
-
- wxMenuBar *menu_bar = new wxMenuBar;
-
- menu_bar->Append(file_menu, _T("&File"));
- if (isCanvas)
- menu_bar->Append(edit_menu, _T("&Edit"));
- menu_bar->Append(help_menu, _T("&Help"));
-
- //// Associate the menu bar with the frame
- subframe->SetMenuBar(menu_bar);
-
- subframe->Centre(wxBOTH);
-
- return subframe;
+
+ // create the main frame window
+ wxFrame *frame;
+#if wxUSE_MDI_ARCHITECTURE
+ if ( m_mode == Mode_MDI )
+ {
+ frame = new wxDocMDIParentFrame(docManager, NULL, wxID_ANY,
+ GetAppDisplayName(),
+ wxDefaultPosition,
+ wxSize(500, 400));
+ }
+ else
+#endif // wxUSE_MDI_ARCHITECTURE
+ {
+ frame = new wxDocParentFrame(docManager, NULL, wxID_ANY,
+ GetAppDisplayName(),
+ wxDefaultPosition,
+ wxSize(500, 400));
+ }
+
+ // and its menu bar
+ wxMenu *menuFile = new wxMenu;
+
+ menuFile->Append(wxID_NEW);
+ menuFile->Append(wxID_OPEN);
+
+ if ( m_mode == Mode_Single )
+ AppendDocumentFileCommands(menuFile, true);
+
+ menuFile->AppendSeparator();
+ menuFile->Append(wxID_EXIT);
+
+ // A nice touch: a history of files visited. Use this menu.
+ docManager->FileHistoryUseMenu(menuFile);
+#if wxUSE_CONFIG
+ docManager->FileHistoryLoad(*wxConfig::Get());
+#endif // wxUSE_CONFIG
+
+
+ if ( m_mode == Mode_Single )
+ {
+ m_canvas = new MyCanvas(NULL, frame);
+ m_menuEdit = CreateDrawingEditMenu();
+ docManager->CreateNewDocument();
+ }
+
+ CreateMenuBarForFrame(frame, menuFile, m_menuEdit);
+
+ frame->SetIcon(wxICON(doc));
+ frame->Centre();
+ frame->Show();
+
+ return true;