-
- wxMenu *help_menu = new wxMenu;
- help_menu->Append(DOCVIEW_ABOUT, "&About");
-
- wxMenuBar *menu_bar = new wxMenuBar;
-
- menu_bar->Append(file_menu, "&File");
- if (isCanvas)
- menu_bar->Append(edit_menu, "&Edit");
- menu_bar->Append(help_menu, "&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;