X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fviews.h;h=5f8214998616e7a048076ca8f8047aef272ed0c1;hp=9f57f5588ffa74bce8a213fd6814c1fcd9e18a2d;hb=9f29c8b32c972db1178d6f8551d5cd57ceb67083;hpb=dd8faeb9c2a1633c96ca31bce81e338a591fab71 diff --git a/src/views.h b/src/views.h index 9f57f55..5f82149 100644 --- a/src/views.h +++ b/src/views.h @@ -7,9 +7,9 @@ ** Date Started: July 2000 ** ** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg +** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.h,v 1.29 2001/01/26 00:45:24 kevin Exp $ +** $Id: views.h,v 1.37 2001/01/28 19:10:18 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 @@ -45,12 +45,17 @@ private: wxMemoryDC m_memoryDC; wxBitmap m_bitmap; - ImageFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); - wxMenu* m_pFileMenu; + ImageFileCanvas *CreateCanvas (wxFrame* parent); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - ImageFileCanvas *m_canvas; - wxFrame *m_frame; + ImageFileCanvas *m_pCanvas; + wxMenu* m_pFileMenu; bool m_bMinSpecified; bool m_bMaxSpecified; double m_dMinPixel; @@ -61,16 +66,16 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: - ImageFileView(void); - virtual ~ImageFileView(void); + ImageFileView(); + virtual ~ImageFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } wxMenu* getFileMenu() { return m_pFileMenu; } @@ -125,10 +130,13 @@ public: void OnCompareRow (wxCommandEvent& event); void OnCompareCol (wxCommandEvent& event); - wxFrame* getFrame() - { return m_frame; } +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif - ImageFileDocument* GetDocument(void) + ImageFileDocument* GetDocument() { return dynamic_cast(wxView::GetDocument()); } DECLARE_EVENT_TABLE() @@ -137,10 +145,9 @@ public: class ImageFileCanvas: public wxScrolledWindow { private: - + ImageFileView* m_pView; int m_xCursor; int m_yCursor; - ImageFileView* m_pView; public: ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style); @@ -169,11 +176,16 @@ class ProjectionFileView : public wxView wxBitmap m_bitmap; private: - ProjectionFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); + ProjectionFileCanvas *CreateCanvas (wxFrame* parent); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - ProjectionFileCanvas *m_canvas; - wxFrame *m_frame; + ProjectionFileCanvas *m_pCanvas; wxMenu* m_pFileMenu; int m_iDefaultNX; @@ -195,16 +207,16 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: - ProjectionFileView(void); - virtual ~ProjectionFileView(void); + ProjectionFileView(); + virtual ~ProjectionFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC* dc); @@ -216,11 +228,16 @@ public: void OnConvertPolar (wxCommandEvent& event); void OnConvertFFTPolar (wxCommandEvent& event); - wxFrame* getFrame () { return m_frame; } - +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif + ProjectionFileCanvas* getCanvas() { return m_pCanvas; } + wxMenu* getFileMenu() { return m_pFileMenu; } - ProjectionFileDocument* GetDocument(void) + ProjectionFileDocument* GetDocument() { return dynamic_cast(wxView::GetDocument()); } DECLARE_EVENT_TABLE() }; @@ -242,17 +259,22 @@ 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); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); + PhantomCanvas *CreateCanvas (wxFrame* parent); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - PhantomCanvas *m_canvas; - wxFrame *m_frame; + PhantomCanvas *m_pCanvas; wxMenu* m_pFileMenu; int m_iDefaultNDet; @@ -270,16 +292,16 @@ private: wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: - PhantomView(void); - virtual ~PhantomView(void); + PhantomFileView(); + virtual ~PhantomFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnUpdate(wxView *sender, wxObject *hint = NULL); @@ -289,22 +311,27 @@ public: void OnRasterize (wxCommandEvent& event); void OnProjections (wxCommandEvent& event); - PhantomDocument* GetDocument(void) - { return dynamic_cast(wxView::GetDocument()); } + PhantomFileDocument* GetDocument() + { return dynamic_cast(wxView::GetDocument()); } wxMenu* getFileMenu() { return m_pFileMenu; } +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif }; 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); }; @@ -315,13 +342,17 @@ class PlotFileView : public wxView DECLARE_DYNAMIC_CLASS(PlotFileView) private: - PlotFileCanvas *CreateCanvas(wxView *view, wxFrame *parent); - wxFrame *CreateChildFrame(wxDocument *doc, wxView *view); +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif - PlotFileCanvas *m_canvas; - wxFrame *m_frame; - wxMenu* m_pFileMenu; + PlotFileCanvas *m_pCanvas; EZPlot* m_pEZPlot; + wxMenu* m_pFileMenu; bool m_bMinSpecified; bool m_bMaxSpecified; @@ -329,18 +360,19 @@ private: double m_dMaxPixel; double m_dAutoScaleFactor; + PlotFileCanvas *CreateCanvas (wxFrame* parent); wxWindow* getFrameForChild() #if CTSIM_MDI - { return theApp->getMainFrame()->GetClientWindow(); } + { return theApp->getMainFrame(); } #else - { return m_frame; } + { return m_pFrame; } #endif public: - PlotFileView(void); - virtual ~PlotFileView(void); + PlotFileView(); + virtual ~PlotFileView(); void canvasClosed() - { m_canvas = NULL; m_frame = NULL; } + { m_pCanvas = NULL; m_pFrame = NULL; } bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC* dc); @@ -352,11 +384,14 @@ public: void OnScaleAuto (wxCommandEvent& event); void OnScaleFull (wxCommandEvent& event); - wxFrame* getFrame () - { return m_frame; } +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif wxMenu* getFileMenu() { return m_pFileMenu; } - PlotFileDocument* GetDocument(void) + PlotFileDocument* GetDocument() { return dynamic_cast(wxView::GetDocument()); } DECLARE_EVENT_TABLE() @@ -378,43 +413,51 @@ 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; +#if CTSIM_MDI + wxDocMDIChildFrame* m_pFrame; + wxDocMDIChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#else + wxDocChildFrame* m_pFrame; + wxDocChildFrame* CreateChildFrame(wxDocument *doc, wxView *view); +#endif 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); - 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; } + wxMenu* getFileMenu() { return m_pFileMenu; } +#if CTSIM_MDI + wxDocMDIChildFrame* getFrame() { return m_pFrame; } +#else + wxDocChildFrame* getFrame() { return m_pFrame; } +#endif }; -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 (); };