X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fviews.h;h=6cab7ab8e274d4f3790e0344f8ff27f281ca1592;hb=dfe03b8fc348b60a8f0b012f3f76c24ad29f21ce;hp=834bdfeb3468d45898647982f18879c2fcda97bc;hpb=a5d437cb4228b07f8c005eaca497c317b8c19d14;p=ctsim.git diff --git a/src/views.h b/src/views.h index 834bdfe..6cab7ab 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.28 2001/01/20 17:43:41 kevin Exp $ +** $Id: views.h,v 1.30 2001/01/26 05:37:24 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 @@ -69,6 +69,8 @@ private: public: ImageFileView(void); virtual ~ImageFileView(void); + void canvasClosed() + { m_canvas = NULL; m_frame = NULL; } wxMenu* getFileMenu() { return m_pFileMenu; } @@ -201,6 +203,8 @@ private: public: ProjectionFileView(void); virtual ~ProjectionFileView(void); + void canvasClosed() + { m_canvas = NULL; m_frame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC* dc); @@ -238,10 +242,10 @@ public: class PhantomCanvas; -class PhantomView : public wxView +class PhantomFileView : public wxView { private: - DECLARE_DYNAMIC_CLASS(PhantomView) + DECLARE_DYNAMIC_CLASS(PhantomFileView) DECLARE_EVENT_TABLE() PhantomCanvas *CreateCanvas(wxView *view, wxFrame *parent); @@ -272,8 +276,10 @@ private: #endif public: - PhantomView(void); - virtual ~PhantomView(void); + PhantomFileView(void); + virtual ~PhantomFileView(void); + void canvasClosed() + { m_canvas = NULL; m_frame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnUpdate(wxView *sender, wxObject *hint = NULL); @@ -283,22 +289,23 @@ public: void OnRasterize (wxCommandEvent& event); void OnProjections (wxCommandEvent& event); - PhantomDocument* GetDocument(void) - { return dynamic_cast(wxView::GetDocument()); } + PhantomFileDocument* GetDocument(void) + { return dynamic_cast(wxView::GetDocument()); } wxMenu* getFileMenu() { return m_pFileMenu; } + wxFrame* getFrame() { return m_frame; } }; class PhantomCanvas: public wxScrolledWindow { private: - PhantomView* m_pView; + PhantomFileView* m_pView; public: - PhantomCanvas (PhantomView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style); + PhantomCanvas (PhantomFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style); virtual ~PhantomCanvas(); - void setView(PhantomView* pView) + void setView(PhantomFileView* pView) { m_pView = pView; } virtual void OnDraw(wxDC& dc); }; @@ -333,6 +340,8 @@ private: public: PlotFileView(void); virtual ~PlotFileView(void); + void canvasClosed() + { m_canvas = NULL; m_frame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC* dc); @@ -370,41 +379,43 @@ public: }; -class TextEditCanvas; -class TextEditView: public wxView +class TextFileCanvas; +class TextFileView: public wxView { private: - DECLARE_DYNAMIC_CLASS(TextEditView) + DECLARE_DYNAMIC_CLASS(TextFileView) wxFrame *m_pFrame; wxMenu* m_pFileMenu; - TextEditCanvas *m_pCanvas; + TextFileCanvas *m_pCanvas; public: - TextEditView() + TextFileView() : wxView() , m_pFrame(0), m_pCanvas(0) {} - ~TextEditView(); + ~TextFileView(); + void canvasClosed() + { m_pFrame = NULL; } - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); + wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); bool OnCreate (wxDocument *doc, long flags); void OnDraw (wxDC *dc); void OnUpdate (wxView *sender, wxObject *hint = (wxObject *) NULL); bool OnClose (bool deleteWindow = TRUE); - TextEditCanvas* getTextCtrl() { return m_pCanvas; } - - wxMenu* getFileMenu() { return m_pFileMenu; } + TextFileCanvas* getTextCtrl() { return m_pCanvas; } + wxFrame* getFrame() { return m_pFrame; } + wxMenu* getFileMenu() { return m_pFileMenu; } }; -class TextEditCanvas: public wxTextCtrl +class TextFileCanvas: public wxTextCtrl { - TextEditView *m_pView; + TextFileView *m_pView; public: - TextEditCanvas (TextEditView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style); - ~TextEditCanvas (); + TextFileCanvas (TextFileView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style); + ~TextFileCanvas (); };