]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxView::OnClosingDocument so the application can do
authorJulian Smart <julian@anthemion.co.uk>
Fri, 12 Jul 2002 16:08:03 +0000 (16:08 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 12 Jul 2002 16:08:03 +0000 (16:08 +0000)
cleanup.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/view.tex
include/wx/docview.h
src/common/docview.cpp

index 388db44b888849439cb1c54b625953e181d4f707..01738d4ce22fc97726c4432ecbc2b0a0f9b64d1f 100644 (file)
@@ -213,6 +213,8 @@ All (GUI):
   so that erroneous help strings are no longer found as the hash
   table fills up
 - updated libpng from 1.0.3 to 1.2.4
+- Added wxView::OnClosingDocument so the application can do
+  cleanup.
 
 wxMSW:
 
@@ -302,6 +304,7 @@ All (GUI):
 - wxGrid cell editing veto support (Roger Gammans)
 - wxListCtrl ITEM_FOCUSED event added
 - support for ICO files in wxImage added (Chris Elliott)
+- improvements to wxDragImage (Chuck Messenger)
 
 wxMSW:
 
@@ -312,6 +315,9 @@ wxMSW:
 wxGTK:
 
 - fixed popup menu positioning bug
+- fixed the edit function for wxListCtrl (Chuck Messenger)
+- fixed the key-hitting events for wxListCtrl and wxTreeCtrl, so they
+  correctly return the key which was pressed (Chuck Messenger)
 
 wxMac:
 
index d9fa115fdf33c84e931f003b8e39cb113e67fea5..acb0fc49343ea8c5fc391f418e1c4dd6e2d269a2 100644 (file)
@@ -126,6 +126,13 @@ all share the same window, you need to disassociate the window from the view
 and perhaps clear the window. If {\it deleteWindow} is TRUE, delete the
 frame associated with the view.
 
+\membersection{wxView::OnClosingDocument}\label{wxviewonclosingdocument}
+
+\func{virtual void}{OnClosingDoocument}{\void}
+
+Override this to clean up the view when the document is being
+closed.
+
 \membersection{wxView::OnCreate}
 
 \func{virtual bool}{OnCreate}{\param{wxDocument* }{doc}, \param{long}{ flags}}
index 52f0c250484b63de382898fd0e5b1f91f0c4026a..0fc38cf3d5988af1bab8f5b536b0726dcc89158f 100644 (file)
@@ -133,6 +133,7 @@ public:
     wxView *GetFirstView() const;
 
     virtual void UpdateAllViews(wxView *sender = (wxView *) NULL, wxObject *hint = (wxObject *) NULL);
+    virtual void NotifyClosing();
 
     // Remove all views (because we're closing the document)
     virtual bool DeleteAllViews();
@@ -183,6 +184,7 @@ public:
     virtual void OnDraw(wxDC *dc) = 0;
     virtual void OnPrint(wxDC *dc, wxObject *info);
     virtual void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
+    virtual void OnClosingDocument() {};
     virtual void OnChangeFilename();
 
     // Called by framework if created automatically by the default document
index c368a8ee522ce5b1a8c6f9226d818122ab010a97..c0b5b82c9da9ff119f2cd449effb5ea31f31ef3b 100644 (file)
@@ -164,6 +164,8 @@ bool wxDocument::Close()
 
 bool wxDocument::OnCloseDocument()
 {
+    // Tell all views that we're about to close
+    NotifyClosing();    
     DeleteContents();
     Modify(FALSE);
     return TRUE;
@@ -508,6 +510,17 @@ void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint)
     }
 }
 
+void wxDocument::NotifyClosing()
+{
+    wxNode *node = m_documentViews.First();
+    while (node)
+    {
+        wxView *view = (wxView *)node->Data();
+        view->OnClosingDocument();
+        node = node->Next();
+    }
+}
+
 void wxDocument::SetFilename(const wxString& filename, bool notifyViews)
 {
     m_documentFile = filename;