From 2a4f365c04e93155ea06a6920aaa9651b7f7025c Mon Sep 17 00:00:00 2001
From: Robert Roebling <robert@roebling.de>
Date: Tue, 16 Oct 2007 17:53:01 +0000
Subject: [PATCH] Doc improvements

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/dataviewmodel.tex | 34 ++++++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/docs/latex/wx/dataviewmodel.tex b/docs/latex/wx/dataviewmodel.tex
index 51a73b87cb..4e56edd006 100644
--- a/docs/latex/wx/dataviewmodel.tex
+++ b/docs/latex/wx/dataviewmodel.tex
@@ -33,15 +33,20 @@ one of the following methods:
 \helpref{ItemAdded}{wxdataviewmodelitemadded},
 \helpref{ItemDeleted}{wxdataviewmodelitemdeleted},
 \helpref{ItemChanged}{wxdataviewmodelitemchanged},
-\helpref{Cleared}{wxdataviewmodelcleared}.
+\helpref{Cleared}{wxdataviewmodelcleared}. There are
+plural forms for notification of addition, change
+or removal of several item at once. See 
+\helpref{ItemsAdded}{wxdataviewmodelitesmadded},
+\helpref{ItemsDeleted}{wxdataviewmodelitemsdeleted},
+\helpref{ItemsChanged}{wxdataviewmodelitemschanged},
 
 Note that wxDataViewModel does not define the position or
-index of any item in the control since several control might
-display the data differently, but wxDataViewModel does
+index of any item in the control because different controls
+might display the same data differently. wxDataViewModel does
 provide a \helpref{Compare}{wxdataviewmodelcompare} method
 which the wxDataViewCtrl may use to sort the data either
 in conjunction with a column header or without (see
-\helpref{HasDefaultCompare}{wxdataviewmodelhasdefaultcompare}.
+\helpref{HasDefaultCompare}{wxdataviewmodelhasdefaultcompare}).
 
 This class maintains a list of 
 \helpref{wxDataViewModelNotifier}{wxdataviewmodelnotifier}
@@ -59,6 +64,24 @@ from the base model:
 \helpref{wxDataViewIndexListModel}{wxdataviewindexlistmodel},
 \helpref{wxDataViewTreeStore}{wxdataviewtreestore}.
 
+Note that wxDataViewModel is reference counted, derives from 
+\helpref{wxObjectRefData}{wxobjectrefdata} and cannot be deleted
+directly as it can be shares by several wxDataViewCtrl. This
+implies that you need to decrease the reference count after
+associating the model with a control like this:
+
+{\small%
+\begin{verbatim}
+    wxDataViewCtrl *musicCtrl = new wxDataViewCtrl( this, ID_MUSIC_CTRL, wxDefaultPosition,
+                                                     wxDefaultSize, wxDV_MULTIPLE );
+    wxDataViewModel *musicModel = new MyMusicModel;
+    m_musicCtrl->AssociateModel( musicModel );
+    musicModel->DecRef();  // avoid memory leak !!
+
+    // add columns now
+\end{verbatim}
+}%
+
 \wxheading{Derived from}
 
 \helpref{wxObjectRefData}{wxobjectrefdata}
@@ -137,7 +160,8 @@ an item. Returns the number of items.
 \constfunc{virtual wxDataViewItem}{GetParent}{\param{const wxDataViewItem\& }{item}}
 
 Override this to indicate which wxDataViewItem representing the parent
-of {\it item} or an invalid wxDataViewItem if {\it item} is the root item.
+of {\it item} or an invalid wxDataViewItem if the the root item is
+the parent item.
 
 \membersection{wxDataViewModel::GetValue}\label{wxdataviewmodelgetvalue}
 
-- 
2.50.0

