projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r442: Fixes to application shutdown
[ctsim.git]
/
src
/
views.cpp
diff --git
a/src/views.cpp
b/src/views.cpp
index 4e970c173bd2bb43a6739d96d5c419797c6ba51f..8053e7e710c07e517345aed8f9cb23c57537f29f 100644
(file)
--- a/
src/views.cpp
+++ b/
src/views.cpp
@@
-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.cpp,v 1.7
4 2001/01/26 21:33:06
kevin Exp $
+** $Id: views.cpp,v 1.7
5 2001/01/26 23:23:00
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
@@
-69,21
+69,13
@@
END_EVENT_TABLE()
ImageFileCanvas::ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style)
ImageFileCanvas::ImageFileCanvas (ImageFileView* v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style)
-: wxScrolledWindow(frame, -1, pos, size, style)
+: wxScrolledWindow(frame, -1, pos, size, style)
, m_pView(v), m_xCursor(-1), m_yCursor(-1)
{
{
- m_pView = v;
- m_xCursor = -1;
- m_yCursor = -1;
}
ImageFileCanvas::~ImageFileCanvas()
{
}
ImageFileCanvas::~ImageFileCanvas()
{
- if (m_pView) {
- wxMenu* pMenu = m_pView->getFileMenu();
- theApp->getDocManager()->FileHistoryRemoveMenu (pMenu);
- m_pView->canvasClosed();
- m_pView = NULL;
- }
+ m_pView = NULL;
}
void
}
void
@@
-232,14
+224,14
@@
EVT_MENU(IFMENU_PLOT_HISTOGRAM, ImageFileView::OnPlotHistogram)
END_EVENT_TABLE()
ImageFileView::ImageFileView()
END_EVENT_TABLE()
ImageFileView::ImageFileView()
-: wxView(), m_canvas(NULL), m_
f
rame(NULL), m_bMinSpecified(false), m_bMaxSpecified(false), m_pFileMenu(0)
+: wxView(), m_canvas(NULL), m_
pF
rame(NULL), m_bMinSpecified(false), m_bMaxSpecified(false), m_pFileMenu(0)
{
m_iDefaultExportFormatID = ImageFile::FORMAT_PNG;
}
ImageFileView::~ImageFileView()
{
{
m_iDefaultExportFormatID = ImageFile::FORMAT_PNG;
}
ImageFileView::~ImageFileView()
{
-
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
void
}
void
@@
-786,7
+778,11
@@
ImageFileView::CreateCanvas (wxView *view, wxFrame *parent)
return pCanvas;
}
return pCanvas;
}
-wxFrame*
+#if CTSIM_MDI
+wxDocMDIChildFrame*
+#else
+wxDocChildFrame*
+#endif
ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#if CTSIM_MDI
ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#if CTSIM_MDI
@@
-909,23
+905,23
@@
ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view)
bool
ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
{
bool
ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
{
- m_
f
rame = CreateChildFrame(doc, this);
- SetFrame (m_
f
rame);
+ m_
pF
rame = CreateChildFrame(doc, this);
+ SetFrame (m_
pF
rame);
m_bMinSpecified = false;
m_bMaxSpecified = false;
m_dAutoScaleFactor = 1.;
int width, height;
m_bMinSpecified = false;
m_bMaxSpecified = false;
m_dAutoScaleFactor = 1.;
int width, height;
- m_
f
rame->GetClientSize (&width, &height);
- m_
f
rame->SetTitle("ImageFileView");
- m_canvas = CreateCanvas (this, m_
f
rame);
+ m_
pF
rame->GetClientSize (&width, &height);
+ m_
pF
rame->SetTitle("ImageFileView");
+ m_canvas = CreateCanvas (this, m_
pF
rame);
int x, y; // X requires a forced resize
int x, y; // X requires a forced resize
- m_
f
rame->GetSize(&x, &y);
- m_
f
rame->SetSize(-1, -1, x, y);
- m_
f
rame->SetFocus();
- m_
f
rame->Show(true);
+ m_
pF
rame->GetSize(&x, &y);
+ m_
pF
rame->SetSize(-1, -1, x, y);
+ m_
pF
rame->SetFocus();
+ m_
pF
rame->Show(true);
Activate(true);
return true;
Activate(true);
return true;
@@
-934,10
+930,10
@@
ImageFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
void
ImageFileView::OnDraw (wxDC* dc)
{
void
ImageFileView::OnDraw (wxDC* dc)
{
- wxSize sizeWindow = m_
f
rame->GetClientSize();
+ wxSize sizeWindow = m_
pF
rame->GetClientSize();
wxSize sizeBest = m_canvas->GetBestSize();
if (sizeWindow.x > sizeBest.x || sizeWindow.y > sizeBest.y)
wxSize sizeBest = m_canvas->GetBestSize();
if (sizeWindow.x > sizeBest.x || sizeWindow.y > sizeBest.y)
- m_
f
rame->SetClientSize (sizeBest);
+ m_
pF
rame->SetClientSize (sizeBest);
if (m_bitmap.Ok())
dc->DrawBitmap(m_bitmap, 0, 0, false);
if (m_bitmap.Ok())
dc->DrawBitmap(m_bitmap, 0, 0, false);
@@
-982,7
+978,7
@@
ImageFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) )
int xSize = nx;
int ySize = ny;
ySize = clamp (ySize, 0, 800);
int xSize = nx;
int ySize = ny;
ySize = clamp (ySize, 0, 800);
- m_
f
rame->SetClientSize (xSize, ySize);
+ m_
pF
rame->SetClientSize (xSize, ySize);
m_canvas->SetScrollbars(20, 20, nx/20, ny/20);
m_canvas->SetBackgroundColour(*wxWHITE);
}
m_canvas->SetScrollbars(20, 20, nx/20, ny/20);
m_canvas->SetBackgroundColour(*wxWHITE);
}
@@
-998,20
+994,23
@@
ImageFileView::OnClose (bool deleteWindow)
return false;
if (m_canvas) {
return false;
if (m_canvas) {
- // m_canvas->Clear();
+ m_canvas->Clear();
+ m_canvas->Show(false);
m_canvas->setView(NULL);
m_canvas = NULL;
}
wxString s(theApp->GetAppName());
m_canvas->setView(NULL);
m_canvas = NULL;
}
wxString s(theApp->GetAppName());
-
// if (m_f
rame)
-
// m_f
rame->SetTitle(s);
+
if (m_pF
rame)
+
m_pF
rame->SetTitle(s);
SetFrame(NULL);
Activate(false);
if (deleteWindow) {
SetFrame(NULL);
Activate(false);
if (deleteWindow) {
- delete m_frame;
- return true;
+ m_pFrame->Show(false);
+ m_pFrame->Destroy();
+// delete m_pFrame;
+ m_pFrame = NULL;
}
return true;
}
}
return true;
}
@@
-1707,12
+1706,7
@@
PhantomCanvas::PhantomCanvas (PhantomFileView* v, wxFrame *frame, const wxPoint&
PhantomCanvas::~PhantomCanvas ()
{
PhantomCanvas::~PhantomCanvas ()
{
- if (m_pView) {
- wxMenu* pMenu = m_pView->getFileMenu();
- theApp->getDocManager()->FileHistoryRemoveMenu (pMenu);
- m_pView->canvasClosed();
m_pView = NULL;
m_pView = NULL;
- }
}
void
}
void
@@
-1734,11
+1728,11
@@
EVT_MENU(PHMMENU_PROCESS_PROJECTIONS, PhantomFileView::OnProjections)
END_EVENT_TABLE()
PhantomFileView::PhantomFileView()
END_EVENT_TABLE()
PhantomFileView::PhantomFileView()
-: wxView(), m_canvas(NULL), m_
f
rame(NULL), m_pFileMenu(0)
+: wxView(), m_canvas(NULL), m_
pF
rame(NULL), m_pFileMenu(0)
{
m_iDefaultNDet = 367;
m_iDefaultNView = 320;
{
m_iDefaultNDet = 367;
m_iDefaultNView = 320;
- m_iDefaultNSample =
2
;
+ m_iDefaultNSample =
1
;
m_dDefaultRotation = 1;
m_dDefaultFocalLength = 2;
m_dDefaultFieldOfView = 1;
m_dDefaultRotation = 1;
m_dDefaultFocalLength = 2;
m_dDefaultFieldOfView = 1;
@@
-1752,7
+1746,7
@@
PhantomFileView::PhantomFileView()
PhantomFileView::~PhantomFileView()
{
PhantomFileView::~PhantomFileView()
{
-
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
void
}
void
@@
-1838,7
+1832,7
@@
PhantomFileView::OnProjections (wxCommandEvent& event)
rProj.setRemark (os.str());
*theApp->getLog() << os.str().c_str() << "\n";
rProj.setRemark (os.str());
*theApp->getLog() << os.str().c_str() << "\n";
- m_
f
rame->Lower();
+ m_
pF
rame->Lower();
::wxYield();
ProjectionFileView* projView = dynamic_cast<ProjectionFileView*>(pProjectionDoc->GetFirstView());
if (projView) {
::wxYield();
ProjectionFileView* projView = dynamic_cast<ProjectionFileView*>(pProjectionDoc->GetFirstView());
if (projView) {
@@
-1925,7
+1919,11
@@
PhantomFileView::CreateCanvas (wxView *view, wxFrame *parent)
return pCanvas;
}
return pCanvas;
}
-wxFrame*
+#if CTSIM_MDI
+wxDocMDIChildFrame*
+#else
+wxDocChildFrame*
+#endif
PhantomFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#if CTSIM_MDI
PhantomFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#if CTSIM_MDI
@@
-1994,21
+1992,21
@@
PhantomFileView::CreateChildFrame(wxDocument *doc, wxView *view)
bool
PhantomFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
bool
PhantomFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
- m_
f
rame = CreateChildFrame(doc, this);
- SetFrame(m_
f
rame);
+ m_
pF
rame = CreateChildFrame(doc, this);
+ SetFrame(m_
pF
rame);
int width, height;
int width, height;
- m_
f
rame->GetClientSize(&width, &height);
- m_
f
rame->SetTitle("PhantomFileView");
- m_canvas = CreateCanvas (this, m_
f
rame);
+ m_
pF
rame->GetClientSize(&width, &height);
+ m_
pF
rame->SetTitle("PhantomFileView");
+ m_canvas = CreateCanvas (this, m_
pF
rame);
#ifdef __X__
int x, y; // X requires a forced resize
#ifdef __X__
int x, y; // X requires a forced resize
- m_
f
rame->GetSize(&x, &y);
- m_
f
rame->SetSize(-1, -1, x, y);
+ m_
pF
rame->GetSize(&x, &y);
+ m_
pF
rame->SetSize(-1, -1, x, y);
#endif
#endif
- m_
f
rame->Show(true);
+ m_
pF
rame->Show(true);
Activate(true);
return true;
Activate(true);
return true;
@@
-2030,18
+2028,21
@@
PhantomFileView::OnClose (bool deleteWindow)
if (m_canvas) {
m_canvas->Clear();
m_canvas->setView(NULL);
if (m_canvas) {
m_canvas->Clear();
m_canvas->setView(NULL);
+ m_canvas->Show(false);
m_canvas = NULL;
}
wxString s(wxTheApp->GetAppName());
m_canvas = NULL;
}
wxString s(wxTheApp->GetAppName());
- if (m_
f
rame)
- m_
f
rame->SetTitle(s);
+ if (m_
pF
rame)
+ m_
pF
rame->SetTitle(s);
SetFrame(NULL);
Activate(false);
if (deleteWindow) {
SetFrame(NULL);
Activate(false);
if (deleteWindow) {
- delete m_frame;
- m_frame = NULL;
+ m_pFrame->Show(false);
+ m_pFrame->Destroy();
+// delete m_pFrame;
+ m_pFrame = NULL;
}
return true;
}
return true;
@@
-2069,12
+2070,7
@@
ProjectionFileCanvas::ProjectionFileCanvas (ProjectionFileView* v, wxFrame *fram
ProjectionFileCanvas::~ProjectionFileCanvas ()
{
ProjectionFileCanvas::~ProjectionFileCanvas ()
{
- if (m_pView) {
- wxMenu* pMenu = m_pView->getFileMenu();
- theApp->getDocManager()->FileHistoryRemoveMenu (pMenu);
- m_pView->canvasClosed();
- m_pView = NULL;
- }
+ m_pView = NULL;
}
void
}
void
@@
-2109,7
+2105,7
@@
EVT_MENU(PJMENU_CONVERT_FFT_POLAR, ProjectionFileView::OnConvertFFTPolar)
END_EVENT_TABLE()
ProjectionFileView::ProjectionFileView()
END_EVENT_TABLE()
ProjectionFileView::ProjectionFileView()
-: wxView(), m_canvas(NULL), m_
f
rame(NULL), m_pFileMenu(0)
+: wxView(), m_canvas(NULL), m_
pF
rame(NULL), m_pFileMenu(0)
{
m_iDefaultNX = 256;
m_iDefaultNY = 256;
{
m_iDefaultNX = 256;
m_iDefaultNY = 256;
@@
-2136,7
+2132,7
@@
ProjectionFileView::ProjectionFileView()
ProjectionFileView::~ProjectionFileView()
{
ProjectionFileView::~ProjectionFileView()
{
-
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
void
}
void
@@
-2324,7
+2320,11
@@
ProjectionFileView::CreateCanvas (wxView *view, wxFrame *parent)
return pCanvas;
}
return pCanvas;
}
-wxFrame*
+#if CTSIM_MDI
+wxDocMDIChildFrame*
+#else
+wxDocChildFrame*
+#endif
ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#ifdef CTSIM_MDI
ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#ifdef CTSIM_MDI
@@
-2402,21
+2402,21
@@
ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view)
bool
ProjectionFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
bool
ProjectionFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
- m_
f
rame = CreateChildFrame(doc, this);
- SetFrame(m_
f
rame);
+ m_
pF
rame = CreateChildFrame(doc, this);
+ SetFrame(m_
pF
rame);
int width, height;
int width, height;
- m_
f
rame->GetClientSize(&width, &height);
- m_
f
rame->SetTitle("ProjectionFileView");
- m_canvas = CreateCanvas(this, m_
f
rame);
+ m_
pF
rame->GetClientSize(&width, &height);
+ m_
pF
rame->SetTitle("ProjectionFileView");
+ m_canvas = CreateCanvas(this, m_
pF
rame);
#ifdef __X__
int x, y; // X requires a forced resize
#ifdef __X__
int x, y; // X requires a forced resize
- m_
f
rame->GetSize(&x, &y);
- m_
f
rame->SetSize(-1, -1, x, y);
+ m_
pF
rame->GetSize(&x, &y);
+ m_
pF
rame->SetSize(-1, -1, x, y);
#endif
#endif
- m_
f
rame->Show(true);
+ m_
pF
rame->Show(true);
Activate(true);
return true;
Activate(true);
return true;
@@
-2425,11
+2425,11
@@
ProjectionFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
void
ProjectionFileView::OnDraw (wxDC* dc)
{
void
ProjectionFileView::OnDraw (wxDC* dc)
{
- wxSize clientSize = m_
f
rame->GetClientSize();
+ wxSize clientSize = m_
pF
rame->GetClientSize();
wxSize bestSize = m_canvas->GetBestSize();
if (clientSize.x > bestSize.x || clientSize.y > bestSize.y)
wxSize bestSize = m_canvas->GetBestSize();
if (clientSize.x > bestSize.x || clientSize.y > bestSize.y)
- m_
f
rame->SetClientSize (bestSize);
+ m_
pF
rame->SetClientSize (bestSize);
if (m_bitmap.Ok())
dc->DrawBitmap (m_bitmap, 0, 0, false);
if (m_bitmap.Ok())
dc->DrawBitmap (m_bitmap, 0, 0, false);
@@
-2477,7
+2477,7
@@
ProjectionFileView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)
int ySize = nView;
xSize = clamp (xSize, 0, 800);
ySize = clamp (ySize, 0, 800);
int ySize = nView;
xSize = clamp (xSize, 0, 800);
ySize = clamp (ySize, 0, 800);
- m_
f
rame->SetClientSize (xSize, ySize);
+ m_
pF
rame->SetClientSize (xSize, ySize);
m_canvas->SetScrollbars (20, 20, nDet/20, nView/20);
}
m_canvas->SetScrollbars (20, 20, nDet/20, nView/20);
}
@@
-2492,20
+2492,23
@@
ProjectionFileView::OnClose (bool deleteWindow)
return false;
if (m_canvas) {
return false;
if (m_canvas) {
-
//
m_canvas->Clear();
+ m_canvas->Clear();
m_canvas->setView(NULL);
m_canvas->setView(NULL);
+ m_canvas->Show(false);
m_canvas = NULL;
}
m_canvas = NULL;
}
-
//
wxString s(wxTheApp->GetAppName());
-
// if (m_f
rame)
-
// m_f
rame->SetTitle(s);
- SetFrame(NULL);
+ wxString s(wxTheApp->GetAppName());
+
if (m_pF
rame)
+
m_pF
rame->SetTitle(s);
+
//
SetFrame(NULL);
Activate(false);
if (deleteWindow) {
Activate(false);
if (deleteWindow) {
- delete m_frame;
- return true;
+ m_pFrame->Show(false);
+ m_pFrame->Destroy();
+// delete m_pFrame;
+ m_pFrame = NULL;
}
return true;
}
}
return true;
}
@@
-2521,12
+2524,7
@@
PlotFileCanvas::PlotFileCanvas (PlotFileView* v, wxFrame *frame, const wxPoint&
PlotFileCanvas::~PlotFileCanvas ()
{
PlotFileCanvas::~PlotFileCanvas ()
{
- if (m_pView) {
- wxMenu* pMenu = m_pView->getFileMenu();
- theApp->getDocManager()->FileHistoryRemoveMenu (pMenu);
- m_pView->canvasClosed();
m_pView = NULL;
m_pView = NULL;
- }
}
void
}
void
@@
-2549,7
+2547,7
@@
EVT_MENU(PLOTMENU_VIEW_SCALE_FULL, PlotFileView::OnScaleFull)
END_EVENT_TABLE()
PlotFileView::PlotFileView()
END_EVENT_TABLE()
PlotFileView::PlotFileView()
-: wxView(), m_canvas(NULL), m_
f
rame(NULL), m_pEZPlot(NULL), m_pFileMenu(0)
+: wxView(), m_canvas(NULL), m_
pF
rame(NULL), m_pEZPlot(NULL), m_pFileMenu(0)
{
m_bMinSpecified = false;
m_bMaxSpecified = false;
{
m_bMinSpecified = false;
m_bMaxSpecified = false;
@@
-2560,7
+2558,7
@@
PlotFileView::~PlotFileView()
if (m_pEZPlot)
delete m_pEZPlot;
if (m_pEZPlot)
delete m_pEZPlot;
-
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
void
}
void
@@
-2653,7
+2651,11
@@
PlotFileView::CreateCanvas (wxView *view, wxFrame *parent)
return pCanvas;
}
return pCanvas;
}
-wxFrame*
+#if CTSIM_MDI
+wxDocMDIChildFrame*
+#else
+wxDocChildFrame*
+#endif
PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#ifdef CTSIM_MDI
PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view)
{
#ifdef CTSIM_MDI
@@
-2726,25
+2728,25
@@
PlotFileView::CreateChildFrame(wxDocument *doc, wxView *view)
bool
PlotFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
{
bool
PlotFileView::OnCreate (wxDocument *doc, long WXUNUSED(flags) )
{
- m_
f
rame = CreateChildFrame(doc, this);
- SetFrame(m_
f
rame);
+ m_
pF
rame = CreateChildFrame(doc, this);
+ SetFrame(m_
pF
rame);
m_bMinSpecified = false;
m_bMaxSpecified = false;
m_dAutoScaleFactor = 1.;
int width, height;
m_bMinSpecified = false;
m_bMaxSpecified = false;
m_dAutoScaleFactor = 1.;
int width, height;
- m_
f
rame->GetClientSize(&width, &height);
- m_
f
rame->SetTitle ("Plot File");
- m_canvas = CreateCanvas (this, m_
f
rame);
+ m_
pF
rame->GetClientSize(&width, &height);
+ m_
pF
rame->SetTitle ("Plot File");
+ m_canvas = CreateCanvas (this, m_
pF
rame);
#ifdef __X__
int x, y; // X requires a forced resize
#ifdef __X__
int x, y; // X requires a forced resize
- m_
f
rame->GetSize(&x, &y);
- m_
f
rame->SetSize(-1, -1, x, y);
+ m_
pF
rame->GetSize(&x, &y);
+ m_
pF
rame->SetSize(-1, -1, x, y);
#endif
#endif
- m_
f
rame->Show(true);
+ m_
pF
rame->Show(true);
Activate(true);
return true;
Activate(true);
return true;
@@
-2822,20
+2824,23
@@
PlotFileView::OnClose (bool deleteWindow)
return false;
if (m_canvas) {
return false;
if (m_canvas) {
-
//
m_canvas->Clear();
+ m_canvas->Clear();
m_canvas->setView (NULL);
m_canvas->setView (NULL);
+ m_canvas->Show(false);
m_canvas = NULL;
}
m_canvas = NULL;
}
-
//
wxString s(wxTheApp->GetAppName());
-
// if (m_f
rame)
-
// m_f
rame->SetTitle(s);
+ wxString s(wxTheApp->GetAppName());
+
if (m_pF
rame)
+
m_pF
rame->SetTitle(s);
SetFrame(NULL);
Activate(false);
if (deleteWindow) {
SetFrame(NULL);
Activate(false);
if (deleteWindow) {
- delete m_frame;
- return true;
+ m_pFrame->Show(false);
+ m_pFrame->Destroy();
+// delete m_pFrame;
+ m_pFrame = NULL;
}
return true;
}
}
return true;
}
@@
-2848,7
+2853,7
@@
IMPLEMENT_DYNAMIC_CLASS(TextFileView, wxView)
TextFileView::~TextFileView()
{
TextFileView::~TextFileView()
{
-
+ theApp->getDocManager()->FileHistoryRemoveMenu (m_pFileMenu);
}
bool TextFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
}
bool TextFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
@@
-2892,19
+2897,25
@@
TextFileView::OnClose (bool deleteWindow)
if (! GetDocument() || ! GetDocument()->Close())
return false;
if (! GetDocument() || ! GetDocument()->Close())
return false;
-
+
+ m_pCanvas->Show(false);
Activate(false);
Activate(false);
- if (deleteWindow)
- {
- delete m_pFrame;
+ if (deleteWindow) {
+ m_pFrame->Show(false);
+ m_pFrame->Destroy();
+// delete m_pFrame;
m_pFrame = NULL;
}
return TRUE;
}
m_pFrame = NULL;
}
return TRUE;
}
-wxFrame*
+#if CTSIM_MDI
+wxDocMDIChildFrame*
+#else
+wxDocChildFrame*
+#endif
TextFileView::CreateChildFrame (wxDocument *doc, wxView *view)
{
#if CTSIM_MDI
TextFileView::CreateChildFrame (wxDocument *doc, wxView *view)
{
#if CTSIM_MDI
@@
-2968,10
+2979,5
@@
TextFileCanvas::TextFileCanvas (TextFileView* v, wxFrame* frame, const wxPoint&
TextFileCanvas::~TextFileCanvas ()
{
TextFileCanvas::~TextFileCanvas ()
{
- if (m_pView) {
- wxMenu* pMenu = m_pView->getFileMenu();
- theApp->getDocManager()->FileHistoryRemoveMenu (pMenu);
- m_pView->canvasClosed();
- m_pView = NULL;
- }
+ m_pView = NULL;
}
}