r148: *** empty log message ***
[ctsim.git] / src / views.h
index 4e833bbee920baf543be4dce5979c21038f15f4f..ee3fdda86342e36807de290c4b4077a34516a61c 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.1 2000/07/13 07:01:59 kevin Exp $
+**  $Id: views.h,v 1.2 2000/07/15 08:36:13 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
@@ -33,6 +33,7 @@
 #define __VIEWSH__
 
 #include "wx/wx.h"
 #define __VIEWSH__
 
 #include "wx/wx.h"
+#include "docs.h"
 #include "imagefile.h"
 
 class ImageFileCanvas;
 #include "imagefile.h"
 
 class ImageFileCanvas;
@@ -41,7 +42,7 @@ class ImageFileView : public wxView
     DECLARE_DYNAMIC_CLASS(ImageFileView)
 
     wxMemoryDC m_memoryDC;
     DECLARE_DYNAMIC_CLASS(ImageFileView)
 
     wxMemoryDC m_memoryDC;
-    wxBitmap* m_pBitmap;
+    wxBitmap m_bitmap;
 
 private:
     ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
 
 private:
     ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
@@ -54,9 +55,6 @@ private:
     double m_minPixel;
     double m_maxPixel;
 
     double m_minPixel;
     double m_maxPixel;
 
-    static bool m_bPColoursInitialized;
-    static wxColour* m_pColours[256];
-
 public:
     ImageFileView(void);
     ~ImageFileView(void);
 public:
     ImageFileView(void);
     ~ImageFileView(void);
@@ -66,6 +64,10 @@ public:
     void OnUpdate(wxView *sender, wxObject *hint = NULL);
     bool OnClose (bool deleteWindow = true);
     void OnProperties (wxCommandEvent& event);
     void OnUpdate(wxView *sender, wxObject *hint = NULL);
     bool OnClose (bool deleteWindow = true);
     void OnProperties (wxCommandEvent& event);
+    void OnWindowAuto (wxCommandEvent& event);
+
+    ImageFileDocument* GetDocument(void) 
+       { return dynamic_cast<ImageFileDocument*>(wxView::GetDocument()); }
 
     DECLARE_EVENT_TABLE()
 };
 
     DECLARE_EVENT_TABLE()
 };
@@ -83,41 +85,13 @@ public:
 };
 
 
 };
 
 
-class MyTextWindow: public wxTextCtrl
-{
-public:
-    wxView *m_pView;
-    
-    MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
-};
-
-
-class TextEditView: public wxView
-{
-    DECLARE_DYNAMIC_CLASS(TextEditView)
-private:
-    wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
-
-public:
-    wxFrame *frame;
-    MyTextWindow *textsw;
-    
-    TextEditView(): wxView() { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
-    ~TextEditView(void) {}
-    
-    bool OnCreate(wxDocument *doc, long flags);
-    void OnDraw(wxDC* dc);
-    void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
-    bool OnClose(bool deleteWindow = TRUE);
-};
-
 class ProjectionFileCanvas;
 class ProjectionFileView : public wxView
 {
     DECLARE_DYNAMIC_CLASS(ProjectionFileView)
 
     wxMemoryDC m_memoryDC;
 class ProjectionFileCanvas;
 class ProjectionFileView : public wxView
 {
     DECLARE_DYNAMIC_CLASS(ProjectionFileView)
 
     wxMemoryDC m_memoryDC;
-    wxBitmap* m_pBitmap;
+    wxBitmap m_bitmap;
 
 private:
     ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
 
 private:
     ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent);
@@ -126,9 +100,6 @@ private:
     ProjectionFileCanvas *m_canvas;
     wxFrame *m_frame;
 
     ProjectionFileCanvas *m_canvas;
     wxFrame *m_frame;
 
-    static bool m_bPColoursInitialized;
-    static wxColour* m_pColours[256];
-
 public:
     ProjectionFileView(void);
     ~ProjectionFileView(void);
 public:
     ProjectionFileView(void);
     ~ProjectionFileView(void);
@@ -140,6 +111,8 @@ public:
     void OnProperties (wxCommandEvent& event);
     void OnReconstruct (wxCommandEvent& event);
 
     void OnProperties (wxCommandEvent& event);
     void OnReconstruct (wxCommandEvent& event);
 
+    ProjectionFileDocument* GetDocument(void) 
+       { return dynamic_cast<ProjectionFileDocument*>(wxView::GetDocument()); }
     DECLARE_EVENT_TABLE()
 };
 
     DECLARE_EVENT_TABLE()
 };
 
@@ -153,4 +126,46 @@ public:
 };
 
 
 };
 
 
+class PhantomCanvas;
+class PhantomView : public wxView
+{
+    DECLARE_DYNAMIC_CLASS(PhantomView)
+
+private:
+    PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent);
+    wxFrame *CreateChildFrame(wxDocument *doc, wxView *view);
+
+    PhantomCanvas *m_canvas;
+    wxFrame *m_frame;
+
+public:
+    PhantomView(void);
+    ~PhantomView(void);
+
+    bool OnCreate(wxDocument *doc, long flags);
+    void OnDraw(wxDC* dc);
+    void OnUpdate(wxView *sender, wxObject *hint = NULL);
+    bool OnClose (bool deleteWindow = true);
+    void OnProperties (wxCommandEvent& event);
+    void OnRasterize (wxCommandEvent& event);
+    void OnProjections (wxCommandEvent& event);
+
+    PhantomDocument* GetDocument(void) 
+       { return dynamic_cast<PhantomDocument*>(wxView::GetDocument()); }
+
+    DECLARE_EVENT_TABLE()
+};
+
+class PhantomCanvas: public wxScrolledWindow
+{
+public:
+    PhantomView* m_pView;
+    
+    PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
+    virtual void OnDraw(wxDC& dc);
+
+};
+
+
 #endif
 #endif
+