r162: *** empty log message ***
[ctsim.git] / src / views.cpp
index 536db90ca0cc6c0e88b401b27c68d13f220565df..8ec1df2bff80bf1e17529210fd503e4bdf1e312b 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.cpp,v 1.8 2000/07/22 15:45:33 kevin Exp $
+**  $Id: views.cpp,v 1.9 2000/07/28 08:28:08 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
@@ -341,7 +341,7 @@ ImageFileView::OnClose (bool deleteWindow)
 // PhantomCanvas
 
 PhantomCanvas::PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style)
-  : wxPanel(frame, -1, pos, size, style)
+  : wxScrolledWindow(frame, -1, pos, size, style)
 {
     m_pView = v;
 }
@@ -353,6 +353,7 @@ PhantomCanvas::OnDraw(wxDC& dc)
         m_pView->OnDraw(& dc);
 }
 
+
 // PhantomView
 
 IMPLEMENT_DYNAMIC_CLASS(PhantomView, wxView)
@@ -518,15 +519,8 @@ PhantomView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
 
     m_frame->Show(true);
     Activate(true);
-    
-    return true;
-}
 
-void 
-PhantomView::OnDraw (wxDC* dc)
-{
-    //  if (m_bitmap.Ok())
-    //    dc->DrawBitmap (m_bitmap, 0, 0, false);
+    return true;
 }
 
 
@@ -560,6 +554,16 @@ PhantomView::OnClose (bool deleteWindow)
     return true;
 }
 
+void
+PhantomView::OnDraw (wxDC* dc)
+{
+  int xsize, ysize;
+  m_canvas->GetClientSize (&xsize, &ysize);
+  SGPDriver driver (dc, "", xsize, ysize);
+  SGP sgp (driver);
+  const Phantom& rPhantom = GetDocument()->getPhantom();
+  rPhantom.draw (sgp);
+}
 
 // ProjectionCanvas