+void
+MainFrame::OnNewImageFile (wxCommandEvent& event)
+{
+ ImageFile* pImageFile = reinterpret_cast<ImageFile*>(event.GetClientData());
+
+ ImageFileDocument* pImageDoc = theApp->newImageDoc();
+ if (! pImageDoc) {
+ sys_error (ERR_SEVERE, "Unable to create image file");
+ return;
+ }
+ pImageDoc->setImageFile (pImageFile);
+ pImageDoc->UpdateAllViews (NULL);
+ if (ImageFileView* imageView = pImageDoc->getView()) {
+ imageView->OnUpdate (imageView, NULL);
+ imageView->getFrame()->SetFocus();
+ imageView->getFrame()->Show(true);
+ }
+ if (theApp->getAskDeleteNewDocs())
+ pImageDoc->Modify (true);
+
+}
+
+void
+MainFrame::OnNewProjectionFile (wxCommandEvent& event)
+{
+ Projections* pProjections = reinterpret_cast<Projections*>(event.GetClientData());
+ ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc();
+ if (! pProjDoc) {
+ sys_error (ERR_SEVERE, "Unable to create projection file");
+ return;
+ }
+ pProjDoc->setProjections (pProjections);
+ pProjDoc->UpdateAllViews (NULL);
+ if (ProjectionFileView* projView = pProjDoc->getView()) {
+ projView->OnUpdate (projView, NULL);
+ projView->getFrame()->SetFocus();
+ projView->getFrame()->Show(true);
+ }
+
+ if (theApp->getAskDeleteNewDocs())
+ pProjDoc->Modify (true);
+}
+