X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b619c109e6bc85fe2f9e5824c378d6135bc3a510..574be073c070a9bbe81ad68e98187b0b9e82c2df:/interface/wx/dynarray.h?ds=sidebyside diff --git a/interface/wx/dynarray.h b/interface/wx/dynarray.h index 4046bc5230..6001afe745 100644 --- a/interface/wx/dynarray.h +++ b/interface/wx/dynarray.h @@ -200,11 +200,11 @@ @section array_predef Predefined array types wxWidgets defines the following dynamic array types: - - wxArrayShort - - wxArrayInt - - wxArrayDouble - - wxArrayLong - - wxArrayPtrVoid + - ::wxArrayShort + - ::wxArrayInt + - ::wxArrayDouble + - ::wxArrayLong + - ::wxArrayPtrVoid To use them you don't need any macro; you just need to include @c dynarray.h. @@ -214,6 +214,7 @@ @see @ref overview_container, wxList, wxVector */ +template class wxArray { public: @@ -545,14 +546,16 @@ public: @code T *item = array[n]; + array.Remove(item); delete item; - array.Remove(n); @endcode See also WX_CLEAR_ARRAY() macro which deletes all elements of a wxArray (supposed to contain pointers). + + @see RemoveAt() */ - Remove(T item); + void Remove(T item); /** Removes @a count elements starting at @a index from the array. When an @@ -570,7 +573,7 @@ public: See also WX_CLEAR_ARRAY() macro which deletes all elements of a wxArray (supposed to contain pointers). */ - RemoveAt(size_t index, size_t count = 1); + void RemoveAt(size_t index, size_t count = 1); //@} @@ -595,6 +598,7 @@ public: another, identical, element is in the array. */ int Index(T& item, bool searchFromEnd = false) const; + /** This version of Index() is for wxSortedArray only. @@ -603,7 +607,7 @@ public: @c wxNOT_FOUND is returned if the element is not found, otherwise the index of the element is returned. */ - const int Index(T& item) const; + int Index(T& item) const; /** Search for a place to insert @a item into the sorted array (binary @@ -794,3 +798,13 @@ public: */ #define WX_PREPEND_ARRAY(wxArray_arrayToModify, wxArray_arrayToBePrepended) +//@{ +/** + Predefined specialization of wxArray for standard types. +*/ +typedef wxArray wxArrayInt; +typedef wxArray wxArrayLong; +typedef wxArray wxArrayShort; +typedef wxArray wxArrayDouble; +typedef wxArray wxArrayPtrVoid; +//@}