- if (!GetDocument()->Close())
- return FALSE;
-
- // Clear the canvas in case we're in single-window mode,
- // and the canvas stays.
- canvas->Clear();
- canvas->view = (wxView *) NULL;
- canvas = (MyCanvas *) NULL;
-
- wxString s(wxTheApp->GetAppName());
- if (frame)
- frame->SetTitle(s);
-
- SetFrame((wxFrame *) NULL);
-
- Activate(FALSE);
-
- if (deleteWindow && !singleWindowMode)
- {
- delete frame;
- return TRUE;
- }
- return TRUE;
+ if (!GetDocument()->Close())
+ return false;
+
+ // Clear the canvas in case we're in single-window mode,
+ // and the canvas stays.
+ m_canvas->ClearBackground();
+ m_canvas->m_view = NULL;
+ m_canvas = NULL;
+
+ wxString s(wxTheApp->GetAppDisplayName());
+ if (m_frame)
+ m_frame->SetTitle(s);
+
+ SetFrame(NULL);
+
+ Activate(false);
+
+ if (deleteWindow && !singleWindowMode)
+ {
+ delete m_frame;
+ return true;
+ }
+ return true;