X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fviews.h;h=ee3fdda86342e36807de290c4b4077a34516a61c;hp=4e833bbee920baf543be4dce5979c21038f15f4f;hb=e4c1f7f8eb87558c3abf3bf1d20732361f425351;hpb=ebe18bbc459204f8bf89880459804cc643a32f24 diff --git a/src/views.h b/src/views.h index 4e833bb..ee3fdda 100644 --- a/src/views.h +++ b/src/views.h @@ -9,7 +9,7 @@ ** 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 @@ -33,6 +33,7 @@ #define __VIEWSH__ #include "wx/wx.h" +#include "docs.h" #include "imagefile.h" class ImageFileCanvas; @@ -41,7 +42,7 @@ class ImageFileView : public wxView DECLARE_DYNAMIC_CLASS(ImageFileView) wxMemoryDC m_memoryDC; - wxBitmap* m_pBitmap; + wxBitmap m_bitmap; private: ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); @@ -54,9 +55,6 @@ private: double m_minPixel; double m_maxPixel; - static bool m_bPColoursInitialized; - static wxColour* m_pColours[256]; - 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 OnWindowAuto (wxCommandEvent& event); + + ImageFileDocument* GetDocument(void) + { return dynamic_cast(wxView::GetDocument()); } 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; - wxBitmap* m_pBitmap; + wxBitmap m_bitmap; private: ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); @@ -126,9 +100,6 @@ private: ProjectionFileCanvas *m_canvas; wxFrame *m_frame; - static bool m_bPColoursInitialized; - static wxColour* m_pColours[256]; - public: ProjectionFileView(void); ~ProjectionFileView(void); @@ -140,6 +111,8 @@ public: void OnProperties (wxCommandEvent& event); void OnReconstruct (wxCommandEvent& event); + ProjectionFileDocument* GetDocument(void) + { return dynamic_cast(wxView::GetDocument()); } 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(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 +