]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/ctrlsub.h
Instead of having wxComboCtrl mimic wxTextEntry interface, make it actually inherit...
[wxWidgets.git] / interface / wx / ctrlsub.h
index f23616e4e02481218e9435d7235855ff81a30574..f03910178252df5a10f3ca8abae54a83aa98ceab 100644 (file)
@@ -348,20 +348,45 @@ public:
     void Delete(unsigned int n);
 
 
+    /**
+        Returns the client object associated with the given item and transfers
+        its ownership to the caller.
+
+        This method, unlike GetClientObject(), expects the caller to delete the
+        returned pointer. It also replaces the internally stored pointer with
+        @NULL, i.e. completely detaches the client object pointer from the
+        control.
+
+        It's an error to call this method unless HasClientObjectData() returns
+        @true.
+
+        @param n
+            The zero-based item index.
+        @return The associated client object pointer to be deleted by caller or
+            @NULL.
+
+        @since 2.9.2
+     */
+    wxClientData *DetachClientObject(unsigned int n);
+
     /**
        Returns true, if either untyped data (@c void*) or object data (wxClientData*)
        is associated with the items of the control.
     */
     bool HasClientData() const;
-    
+
     /**
-       Returns true, if object data (wxClientData*)
-       is associated with the items of the control.
+       Returns true, if object data is associated with the items of the
+       control.
+
+       Object data pointers have the type @c wxClientData* instead of @c void*
+       and, importantly, are owned by the control, i.e. will be deleted by it,
+       unlike their untyped counterparts.
     */
     bool HasClientObjectData() const;
 
     /**
-       Returns true, if untyped data (@c void*) 
+       Returns true, if untyped data (@c void*)
        is associated with the items of the control.
     */
     bool HasClientUntypedData() const;
@@ -390,6 +415,10 @@ public:
         given item doesn't have any client data associated with it (but other
         items do).
 
+        Notice that the returned pointer is still owned by the control and will
+        be deleted by it, use DetachClientObject() if you want to remove the
+        pointer from the control.
+
         @param n
             The zero-based position of the item.
 
@@ -482,6 +511,8 @@ public:
             Array of strings to insert.
         @param pos
             Position to insert the items before, zero based.
+        @return The return value is the index of the last inserted item.
+                If the insertion failed for some reason, -1 is returned.
     */
     int Insert(const wxArrayString& items, unsigned int pos);
 
@@ -498,6 +529,8 @@ public:
         @param clientData
             Array of client data pointers of the same size as @a items to
             associate with the new items.
+        @return The return value is the index of the last inserted item.
+                If the insertion failed for some reason, -1 is returned.
     */
     int Insert(const wxArrayString& items, unsigned int pos,
                 void **clientData);
@@ -515,6 +548,8 @@ public:
         @param clientData
             Array of client data pointers of the same size as @a items to
             associate with the new items.
+        @return The return value is the index of the last inserted item.
+                If the insertion failed for some reason, -1 is returned.
     */
     int Insert(const wxArrayString& items, unsigned int pos,
                 wxClientData **clientData);
@@ -531,6 +566,8 @@ public:
             Array of strings of size @a n.
         @param pos
             Position to insert the items before, zero based.
+        @return The return value is the index of the last inserted item.
+                If the insertion failed for some reason, -1 is returned.
     */
     int Insert(unsigned int n, const wxString* items,
                 unsigned int pos);
@@ -550,6 +587,8 @@ public:
         @param clientData
             Array of client data pointers of size @a n to associate with the
             new items.
+        @return The return value is the index of the last inserted item.
+                If the insertion failed for some reason, -1 is returned.
     */
     int Insert(unsigned int n, const wxString* items,
                 unsigned int pos,
@@ -570,6 +609,8 @@ public:
         @param clientData
             Array of client data pointers of size @a n to associate with the
             new items.
+        @return The return value is the index of the last inserted item.
+                If the insertion failed for some reason, -1 is returned.
     */
     int Insert(unsigned int n, const wxString* items,
                 unsigned int pos,