]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxListCtrl::SetItemPtrData()
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 10 May 2007 01:53:21 +0000 (01:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 10 May 2007 01:53:21 +0000 (01:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
docs/changes.txt
docs/latex/wx/listctrl.tex
include/wx/generic/listctrl.h
include/wx/mac/carbon/listctrl.h
include/wx/msw/listctrl.h
include/wx/os2/listctrl.h
include/wx/palmos/listctrl.h
src/generic/listctrl.cpp
src/mac/carbon/listctrl_mac.cpp
src/msw/listctrl.cpp
src/os2/listctrl.cpp
src/palmos/listctrl.cpp

index 80f192640eb04fa9ff70b28331ce728144daacf5..2ba5b299c29e4dc7d0791b8cefcf4c92e7e79e8f 100644 (file)
@@ -163,6 +163,7 @@ All (GUI):
 
 - Allow status bar children in XRC (Edmunt Pienkowski)
 - Fix memory leak in wxWizard when not using sizers for the page layout
 
 - Allow status bar children in XRC (Edmunt Pienkowski)
 - Fix memory leak in wxWizard when not using sizers for the page layout
+- Added wxListCtrl::SetItemPtrData()
 
 wxMSW:
 
 
 wxMSW:
 
index a3ef301c6696edd2bcd9c78623428456e6c76d03..8f031edd976f52d8462100757496af037a3f9275 100644 (file)
@@ -943,6 +943,9 @@ from $0$ to {\it count}.
 
 Associates application-defined data with this item.
 
 
 Associates application-defined data with this item.
 
+Notice that this function cannot be used to associate pointers with the control
+items, use \helpref{SetItemPtrData}{wxlistctrlsetitemptrdata} instead.
+
 
 \membersection{wxListCtrl::SetItemFont}\label{wxlistctrlsetitemfont}
 
 
 \membersection{wxListCtrl::SetItemFont}\label{wxlistctrlsetitemfont}
 
@@ -981,6 +984,18 @@ The image is an index into the image list associated with the list control.
 Sets the position of the item, in icon or small icon view. Windows only.
 
 
 Sets the position of the item, in icon or small icon view. Windows only.
 
 
+\membersection{wxListCtrl::SetItemPtrData}\label{wxlistctrlsetitemptrdata}
+
+\func{bool}{SetItemPtrData}{\param{long }{item}, \param{wxUIntPtr }{data}}
+
+Associates application-defined data with this item. The \arg{data} parameter may
+be either an integer or a pointer cast to the \texttt{wxUIntPtr} type which is
+guaranteed to be large enough to be able to contain all integer types and
+pointers.
+
+\newsince{2.8.4}
+
+
 \membersection{wxListCtrl::SetItemState}\label{wxlistctrlsetitemstate}
 
 \func{bool}{SetItemState}{\param{long }{item}, \param{long }{state}, \param{long }{stateMask}}
 \membersection{wxListCtrl::SetItemState}\label{wxlistctrlsetitemstate}
 
 \func{bool}{SetItemState}{\param{long }{item}, \param{long }{state}, \param{long }{stateMask}}
index 19e874c53e04e4de607560a194d9f55d625ec6f5..24422ec81b0a20b702bb79c60f212f8dc38324f0 100644 (file)
@@ -77,7 +77,8 @@ public:
     wxString GetItemText( long item ) const;
     void SetItemText( long item, const wxString& str );
     wxUIntPtr GetItemData( long item ) const;
     wxString GetItemText( long item ) const;
     void SetItemText( long item, const wxString& str );
     wxUIntPtr GetItemData( long item ) const;
-    bool SetItemData( long item, long data );
+    bool SetItemPtrData(long item, wxUIntPtr data);
+    bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
     bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
     bool GetItemPosition( long item, wxPoint& pos ) const;
     bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC
     bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
     bool GetItemPosition( long item, wxPoint& pos ) const;
     bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC
index 03376614adb2a986b6a1d3c712f8b21fc36b316c..a3949e50d8f7f827c751b97c7eaaf8d765f3b946 100644 (file)
@@ -122,7 +122,8 @@ class WXDLLEXPORT wxListCtrl: public wxControl
   long GetItemData(long item) const ;
 
   // Sets the item data
   long GetItemData(long item) const ;
 
   // Sets the item data
-  bool SetItemData(long item, long data) ;
+  bool SetItemPtrData(long item, wxUIntPtr data);
+  bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
 
   // Gets the item rectangle
   bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
 
   // Gets the item rectangle
   bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
index 97f61eb113eaa8372b3aa5132d3f96d3d2a8dbdf..cf4bfdd64e2c454c2aea89d632c82a80ada45f37 100644 (file)
@@ -163,7 +163,8 @@ public:
     wxUIntPtr GetItemData(long item) const ;
 
     // Sets the item data
     wxUIntPtr GetItemData(long item) const ;
 
     // Sets the item data
-    bool SetItemData(long item, long data) ;
+    bool SetItemPtrData(long item, wxUIntPtr data);
+    bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
 
     // Gets the item rectangle
     bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
 
     // Gets the item rectangle
     bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
index 03db69cf897f19075bc91e3cbb2809aa22c7bc13..ff50c2827738345aef1db2bb02b0927096e41f15 100644 (file)
@@ -150,9 +150,8 @@ public:
     // Item data
     //
     long GetItemData(long lItem) const;
     // Item data
     //
     long GetItemData(long lItem) const;
-    bool SetItemData( long lItem
-                     ,long lData
-                    );
+    bool SetItemPtrData(long item, wxUIntPtr data);
+    bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
 
     //
     // Gets the item rectangle
 
     //
     // Gets the item rectangle
index 1ad47caae04e471608cd7398e300c70eb1d2ab68..43a0883441969c36c2b3430d1d54a49e81d31a41 100644 (file)
@@ -166,7 +166,8 @@ public:
     long GetItemData(long item) const ;
 
     // Sets the item data
     long GetItemData(long item) const ;
 
     // Sets the item data
-    bool SetItemData(long item, long data) ;
+    bool SetItemPtrData(long item, wxUIntPtr data);
+    bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
 
     // Gets the item rectangle
     bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
 
     // Gets the item rectangle
     bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;
index 97c78dfd4230919bb2fe8e0760cd615749b679af..27b1c3f0e9716404fde241a11b2a3c8a6fca0f8b 100644 (file)
@@ -5177,7 +5177,7 @@ wxUIntPtr wxGenericListCtrl::GetItemData( long item ) const
     return info.m_data;
 }
 
     return info.m_data;
 }
 
-bool wxGenericListCtrl::SetItemData( long item, long data )
+bool wxGenericListCtrl::SetItemPtrData( long item, wxUIntPtr data )
 {
     wxListItem info;
     info.m_mask = wxLIST_MASK_DATA;
 {
     wxListItem info;
     info.m_mask = wxLIST_MASK_DATA;
index ddd717dbecdd2d849416697ae082ee30425c7ead..5a1a1f0bc825a525b0c769d581c58b1e0bf74a09 100644 (file)
@@ -1326,7 +1326,7 @@ long wxListCtrl::GetItemData(long item) const
 }
 
 // Sets the item data
 }
 
 // Sets the item data
-bool wxListCtrl::SetItemData(long item, long data)
+bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data)
 {
     if (m_genericImpl)
         return m_genericImpl->SetItemData(item, data);
 {
     if (m_genericImpl)
         return m_genericImpl->SetItemData(item, data);
index 12870a32fa8934b90cc3608e5b479d8fe312a7b4..db616b8940ab35ac3126ff028e46c4486c6bed26 100644 (file)
@@ -948,7 +948,7 @@ wxUIntPtr wxListCtrl::GetItemData(long item) const
 }
 
 // Sets the item data
 }
 
 // Sets the item data
-bool wxListCtrl::SetItemData(long item, long data)
+bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data)
 {
     wxListItem info;
 
 {
     wxListItem info;
 
index 648f43ed62ba0b0c2c7300e951955579ea012e55..1c8a4a0d4dfb2d85b855cd0066aa347707e73549 100644 (file)
@@ -1519,9 +1519,9 @@ long wxListCtrl::GetItemData (
 } // end of wxListCtrl::GetItemData
 
 // Sets the item data
 } // end of wxListCtrl::GetItemData
 
 // Sets the item data
-bool wxListCtrl::SetItemData (
+bool wxListCtrl::SetItemPtrData (
   long                              lItem
   long                              lItem
-, long                              lData
+, wxUIntPtr                         lData
 )
 {
     wxListItem                      vInfo;
 )
 {
     wxListItem                      vInfo;
@@ -1530,7 +1530,7 @@ bool wxListCtrl::SetItemData (
     vInfo.m_itemId = lItem;
     vInfo.m_data   = lData;
     return SetItem(vInfo);
     vInfo.m_itemId = lItem;
     vInfo.m_data   = lData;
     return SetItem(vInfo);
-} // end of wxListCtrl::SetItemData
+} // end of wxListCtrl::SetItemPtrData
 
 // Gets the item rectangle
 bool wxListCtrl::GetItemRect ( long lItem,
 
 // Gets the item rectangle
 bool wxListCtrl::GetItemRect ( long lItem,
index 5d7bdf5371cac33dc640d5310aa762e153a657fc..a2c4920eab71707d58cac23e479702d896f1f2ea 100644 (file)
@@ -283,7 +283,7 @@ long wxListCtrl::GetItemData(long item) const
 }
 
 // Sets the item data
 }
 
 // Sets the item data
-bool wxListCtrl::SetItemData(long item, long data)
+bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data)
 {
     return false;
 }
 {
     return false;
 }