r1864: border fixes
[ctsim.git] / src / ctsim.cpp
index a51a3658352166ac8bf507aaf7dcc24d923328be..d8b073725c9ccf1f2fae66a7ede2901ff4cfb22e 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: ctsim.cpp,v 1.104 2001/09/24 15:16:41 kevin Exp $
+**  $Id: ctsim.cpp,v 1.105 2002/05/03 00:40:30 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -70,7 +70,7 @@
 #endif
 #endif
 
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.104 2001/09/24 15:16:41 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.105 2002/05/03 00:40:30 kevin Exp $";
 
 struct option CTSimApp::ctsimOptions[] = 
 {
@@ -186,7 +186,7 @@ CTSimApp::OnInit()
     int xSize, ySize;
     m_pFrame->GetClientSize(&xSize, &ySize);
     int yLogSize = ySize / 4;
-    m_pLogDoc->getView()->getFrame()->SetSize (0, ySize - yLogSize, xSize, yLogSize);
+    m_pLogDoc->getView()->getFrame()->SetClientSize (0, ySize - yLogSize, xSize, yLogSize);
     m_pLogDoc->getView()->getFrame()->Show (true);
   } else
 #else
@@ -524,8 +524,8 @@ MainFrame::OnSize (wxSizeEvent& event)
     int xSize, ySize;  
     GetClientSize(&xSize, &ySize);
     int yLogSize = ySize / 4;
-                 theApp->getLogDoc()->getView()->getFrame()->SetSize (0, ySize - yLogSize, xSize, yLogSize);
-      theApp->getLogDoc()->getView()->getFrame()->Show (true);
+    theApp->getLogDoc()->getView()->getFrame()->SetSize (0, ySize - yLogSize, xSize, yLogSize);
+    theApp->getLogDoc()->getView()->getFrame()->Show (true);
   }
 #endif
   
@@ -624,15 +624,14 @@ MainFrame::OnNewImageFile (wxCommandEvent& event)
     return;
   }  
   pImageDoc->setImageFile (pImageFile);
-  pImageDoc->UpdateAllViews (NULL);
-  if (ImageFileView* imageView = pImageDoc->getView()) {
-    imageView->OnUpdate (imageView, NULL);
-    imageView->getFrame()->SetFocus();
-    imageView->getFrame()->Show(true);
-  }
+  //  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
@@ -1076,7 +1075,9 @@ CTSimApp::newProjectionDoc()
     if (pView) {
       wxFrame* pFrame = pView->getFrame();
       if (pFrame) {
-        pFrame->SetSize (0,0);
+       //        wxSize size;
+       //        m_pFrame->GetClientSize (&size.x, &size.y);
+       //        pFrame->SetClientSize (size.x / 2, size.y / 2);
         pFrame->Show (false);
       }
     }
@@ -1093,14 +1094,6 @@ CTSimApp::newImageDoc()
 {
   ImageFileDocument* newDoc = dynamic_cast<ImageFileDocument*>(m_pDocTemplImage->CreateDocument (""));
   if (newDoc) {
-    ImageFileView* pView = newDoc->getView();
-    if (pView) {
-      wxFrame* pFrame = pView->getFrame();
-      if (pFrame) {
-        pFrame->SetSize (0,0);
-        pFrame->Show (false);
-      }
-    }
     newDoc->SetDocumentName (m_pDocTemplImage->GetDocumentName());
     newDoc->SetDocumentTemplate (m_pDocTemplImage);
     newDoc->OnNewDocument();
@@ -1114,16 +1107,6 @@ CTSimApp::newPlotDoc()
 {
   PlotFileDocument* newDoc = dynamic_cast<PlotFileDocument*>(m_pDocTemplPlot->CreateDocument (""));
   if (newDoc) {
-    PlotFileView* pView = newDoc->getView();
-    if (pView) {
-      wxFrame* pFrame = pView->getFrame();
-      if (pFrame) {
-        wxSize size;
-        m_pFrame->GetClientSize (&size.x, &size.y);
-        pFrame->SetSize (size.x / 2, size.y / 2);
-        pFrame->Show (false);
-      }
-    }
     newDoc->SetDocumentName (m_pDocTemplPlot->GetDocumentName());
     newDoc->SetDocumentTemplate (m_pDocTemplPlot);
     newDoc->OnNewDocument();
@@ -1141,16 +1124,6 @@ CTSimApp::newTextDoc()
   
   TextFileDocument* newDoc = dynamic_cast<TextFileDocument*>(m_pDocTemplText->CreateDocument (""));
   if (newDoc) {
-    TextFileView* pView = newDoc->getView();
-    if (pView) {
-      wxFrame* pFrame = pView->getFrame();
-      if (pFrame) {
-        wxSize size;
-        m_pFrame->GetClientSize (&size.x, &size.y);;
-        pFrame->SetSize (size.x / 2, size.y / 2);
-        pFrame->Show (false);
-      }
-    }
     newDoc->SetDocumentName (m_pDocTemplText->GetDocumentName());
     newDoc->SetDocumentTemplate (m_pDocTemplText);
     newDoc->OnNewDocument();
@@ -1165,12 +1138,6 @@ CTSimApp::newPhantomDoc()
 {
   PhantomFileDocument* newDoc = dynamic_cast<PhantomFileDocument*>(m_pDocTemplPhantom->CreateDocument (""));
   if (newDoc) {
-    PhantomFileView* pView = newDoc->getView();
-    if (pView) {
-      wxFrame* pFrame = pView->getFrame();
-      if (pFrame)
-        pFrame->SetSize (0,0);
-    }
     newDoc->SetDocumentName (m_pDocTemplPhantom->GetDocumentName());
     newDoc->SetDocumentTemplate (m_pDocTemplPhantom);
     newDoc->OnNewDocument();
@@ -1186,12 +1153,6 @@ CTSimApp::newGraph3dDoc()
 {
   Graph3dFileDocument* newDoc = dynamic_cast<Graph3dFileDocument*>(m_pDocTemplGraph3d->CreateDocument (""));
   if (newDoc) {
-    Graph3dFileView* pView = newDoc->getView();
-    if (pView) {
-      wxFrame* pFrame = pView->getFrame();
-      if (pFrame)
-        pFrame->SetSize (0,0);
-    }
     newDoc->SetDocumentName (m_pDocTemplGraph3d->GetDocumentName());
     newDoc->SetDocumentTemplate (m_pDocTemplGraph3d);
     newDoc->OnNewDocument();