]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
Some stubs includes removed from wxMotif; wxNotebook sample hack to make it display;
[wxWidgets.git] / include / wx / list.h
index 625387f67ea3057df787d3e717c16159dd839bcb..a65bb8d4856224fa2764a264521d1648303fdc71 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     29/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Julian Smart
-// Licence:    wxWindows license
+// Licence:       wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 /*
@@ -163,6 +163,9 @@ protected:
     void *GetData() const { return m_data; }
     void SetData(void *data) { m_data = data; }
 
+    // get 0-based index of this node within the list or NOT_FOUND
+    int IndexOf() const;
+
     virtual void DeleteData() { }
 
 private:
@@ -192,11 +195,25 @@ public:
     size_t GetCount() const { return m_count; }
 
     // operations
+    
         // delete all nodes
     void Clear();
+    
         // instruct it to destroy user data when deleting nodes
     void DeleteContents(bool destroy) { m_destroy = destroy; }
 
+       // query if to delete
+    bool GetDeleteContents() const
+        { return m_destroy; }
+    
+      // get the keytype
+    wxKeyType GetKeyType() const
+        { return m_keyType; }
+
+      // set the keytype (required by the serial code)
+    void SetKeyType(wxKeyType keyType)
+        { wxASSERT( m_count==0 ); m_keyType = keyType; }
+
 protected:
     // all methods here are "overloaded" in derived classes to provide compile
     // time type checking
@@ -248,7 +265,7 @@ protected:
     bool DeleteNode(wxNodeBase *node);
         // finds object pointer and deletes node (and object if DeleteContents
         // is on), returns FALSE if object not found
-    bool DeleteObject(void *object);  
+    bool DeleteObject(void *object);
 
     // search (all return NULL if item not found)
         // by data
@@ -257,6 +274,9 @@ protected:
         // by key
     wxNodeBase *Find(const wxListKey& key) const;
 
+    // get 0-based index of object or NOT_FOUND
+    int IndexOf( void *object ) const;
+
     // this function allows the sorting of arbitrary lists by giving
     // a function to compare two list elements. The list is sorted in place.
     void Sort(const wxSortCompareFunction compfunc);
@@ -265,7 +285,7 @@ protected:
     void *FirstThat(wxListIterateFunction func);
     void ForEach(wxListIterateFunction func);
     void *LastThat(wxListIterateFunction func);
-
+    
 private:
     // helpers
         // common part of all ctors
@@ -377,6 +397,9 @@ private:
         virtual nodetype *Find(const wxListKey& key) const                  \
             { return (nodetype *)wxListBase::Find(key); }                   \
                                                                             \
+        int IndexOf( T *object ) const                                      \
+            { return wxListBase::IndexOf(object); }                         \
+                                                                            \
         void Sort(wxSortFuncFor_##name func)                                \
             { wxListBase::Sort((wxSortCompareFunction)func); }              \
                                                                             \
@@ -430,7 +453,7 @@ public:
 // -----------------------------------------------------------------------------
 // wxStringList class for compatibility with the old code
 // -----------------------------------------------------------------------------
-    
+
 WX_DECLARE_LIST_2(char, wxStringListBase, wxStringListNode);
 
 class WXDLLEXPORT wxStringList : public wxStringListBase