r427: Changes for MDI support
[ctsim.git] / src / views.h
index eee1be8dc1b12c0318755709c2a5920cf5a579d7..ca998f2bdcb6adc793f9ae529655e382ac28344f 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: views.h,v 1.26 2001/01/06 15:33:15 kevin Exp $
+**  $Id: views.h,v 1.27 2001/01/20 08:10:33 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
 **
 **  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
@@ -57,7 +57,14 @@ private:
   double m_dAutoScaleFactor;
   
   int m_iDefaultExportFormatID;
   double m_dAutoScaleFactor;
   
   int m_iDefaultExportFormatID;
-  
+
+  wxFrame* getFrameForChild() 
+#if CTSIM_MDI
+  { return theApp->getMainFrame(); }
+#else
+  { return m_frame; }
+#endif
+
 public:
   ImageFileView(void);
   virtual ~ImageFileView(void);
 public:
   ImageFileView(void);
   virtual ~ImageFileView(void);
@@ -127,16 +134,20 @@ private:
   
   int m_xCursor;
   int m_yCursor;
   
   int m_xCursor;
   int m_yCursor;
-  
-public:
   ImageFileView* m_pView;
   
   ImageFileView* m_pView;
   
+public:
   ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
   ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
+  virtual ~ImageFileCanvas()
+  {}
+
   virtual void OnDraw(wxDC& dc);
   void OnMouseEvent(wxMouseEvent& event);
   void DrawRubberBandCursor (wxDC& dc, int x, int y);
   bool GetCurrentCursor (int& x, int& y);
   virtual void OnDraw(wxDC& dc);
   void OnMouseEvent(wxMouseEvent& event);
   void DrawRubberBandCursor (wxDC& dc, int x, int y);
   bool GetCurrentCursor (int& x, int& y);
-  
+
+  virtual wxSize GetBestSize() const;
+
   DECLARE_EVENT_TABLE()
 };
 
   DECLARE_EVENT_TABLE()
 };
 
@@ -173,6 +184,13 @@ private:
   int m_iDefaultPolarInterpolation;
   int m_iDefaultPolarZeropad;
 
   int m_iDefaultPolarInterpolation;
   int m_iDefaultPolarZeropad;
 
+  wxFrame* getFrameForChild() 
+#if CTSIM_MDI
+  { return theApp->getMainFrame(); }
+#else
+  { return m_frame; }
+#endif
+
 public:
   ProjectionFileView(void);
   virtual ~ProjectionFileView(void);
 public:
   ProjectionFileView(void);
   virtual ~ProjectionFileView(void);
@@ -197,10 +215,16 @@ public:
 
 class ProjectionFileCanvas: public wxScrolledWindow
 {
 
 class ProjectionFileCanvas: public wxScrolledWindow
 {
-public:
+private:
   ProjectionFileView* m_pView;
   ProjectionFileView* m_pView;
-  
+
+public:  
   ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
   ProjectionFileCanvas (ProjectionFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
+  virtual ~ProjectionFileCanvas() 
+  {}
+
+  virtual wxSize GetBestSize() const;
+
   virtual void OnDraw(wxDC& dc);
 };
 
   virtual void OnDraw(wxDC& dc);
 };
 
@@ -230,6 +254,13 @@ private:
   int m_iDefaultRasterNY;
   int m_iDefaultRasterNSamples;
 
   int m_iDefaultRasterNY;
   int m_iDefaultRasterNSamples;
 
+  wxFrame* getFrameForChild() 
+#if CTSIM_MDI
+  { return theApp->getMainFrame(); }
+#else
+  { return m_frame; }
+#endif
+
 public:
   PhantomView(void);
   virtual ~PhantomView(void);
 public:
   PhantomView(void);
   virtual ~PhantomView(void);
@@ -250,10 +281,14 @@ public:
 
 class PhantomCanvas: public wxScrolledWindow
 {
 
 class PhantomCanvas: public wxScrolledWindow
 {
-public:
+private:
   PhantomView* m_pView;
   PhantomView* m_pView;
-  
+
+public:  
   PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
   PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
+  virtual ~PhantomCanvas()
+  {}
+
   virtual void OnDraw(wxDC& dc);
 };
 
   virtual void OnDraw(wxDC& dc);
 };
 
@@ -276,6 +311,13 @@ private:
   double m_dMaxPixel;
   double m_dAutoScaleFactor;
   
   double m_dMaxPixel;
   double m_dAutoScaleFactor;
   
+  wxFrame* getFrameForChild() 
+#if CTSIM_MDI
+  { return theApp->getMainFrame(); }
+#else
+  { return m_frame; }
+#endif
+
 public:
   PlotFileView(void);
   virtual ~PlotFileView(void);
 public:
   PlotFileView(void);
   virtual ~PlotFileView(void);
@@ -301,10 +343,14 @@ public:
 
 class PlotFileCanvas: public wxScrolledWindow
 {
 
 class PlotFileCanvas: public wxScrolledWindow
 {
-public:
+private:
   PlotFileView* m_pView;
   
   PlotFileView* m_pView;
   
+public:
   PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
   PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
+  virtual ~PlotFileCanvas()
+  {}
+
   virtual void OnDraw(wxDC& dc);
 };
 
   virtual void OnDraw(wxDC& dc);
 };