]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
Implement GetLabel and SetLabel
[wxWidgets.git] / include / wx / list.h
index 56c3a674302781a3de8e4297bfb96264241107d7..ffddd09a581ec24af774e10dfad03e0414c14684 100644 (file)
@@ -42,9 +42,6 @@
     #include "wx/beforestd.h"
     #include <list>
     #include "wx/afterstd.h"
-    #if defined(__WXMSW__) && defined(__MINGW32__)
-        #include "wx/msw/winundef.h"
-    #endif
 #endif
 
 // ----------------------------------------------------------------------------
@@ -54,6 +51,7 @@
 // type of compare function for list sort operation (as in 'qsort'): it should
 // return a negative value, 0 or positive value if the first element is less
 // than, equal or greater than the second
+
 extern "C"
 {
 typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
@@ -661,14 +659,16 @@ private:
         {                                                                   \
             typedef name list;                                              \
         public:                                                             \
-            typedef list::Node Node;                                        \
+            typedef nodetype Node;                                          \
             typedef iterator itor;                                          \
-            typedef list::value_type* ptr_type;                             \
+            typedef T* value_type;                                          \
+            typedef value_type* ptr_type;                                   \
+            typedef value_type& reference;                                  \
                                                                             \
             Node* m_node;                                                   \
             Node* m_init;                                                   \
         public:                                                             \
-            typedef list::reference reference_type;                         \
+            typedef reference reference_type;                               \
             typedef ptr_type pointer_type;                                  \
                                                                             \
             iterator(Node* node, Node* init) : m_node(node), m_init(init) {}\
@@ -700,14 +700,16 @@ private:
         {                                                                   \
             typedef name list;                                              \
         public:                                                             \
-            typedef list::Node Node;                                        \
+            typedef nodetype Node;                                          \
+            typedef T* value_type;                                          \
+            typedef const value_type& const_reference;                      \
             typedef const_iterator itor;                                    \
-            typedef list::value_type* ptr_type;                             \
+            typedef value_type* ptr_type;                                   \
                                                                             \
             Node* m_node;                                                   \
             Node* m_init;                                                   \
         public:                                                             \
-            typedef list::const_reference reference_type;                   \
+            typedef const_reference reference_type;                         \
             typedef const ptr_type pointer_type;                            \
                                                                             \
             const_iterator(Node* node, Node* init)                          \
@@ -742,14 +744,16 @@ private:
         {                                                                   \
             typedef name list;                                              \
         public:                                                             \
-            typedef list::Node Node;                                        \
+            typedef nodetype Node;                                          \
+            typedef T* value_type;                                          \
             typedef reverse_iterator itor;                                  \
-            typedef list::value_type* ptr_type;                             \
+            typedef value_type* ptr_type;                                   \
+            typedef value_type& reference;                                  \
                                                                             \
             Node* m_node;                                                   \
             Node* m_init;                                                   \
         public:                                                             \
-            typedef list::reference reference_type;                         \
+            typedef reference reference_type;                               \
             typedef ptr_type pointer_type;                                  \
                                                                             \
             reverse_iterator(Node* node, Node* init)                        \
@@ -780,14 +784,16 @@ private:
         {                                                                   \
             typedef name list;                                              \
         public:                                                             \
-            typedef list::Node Node;                                        \
+            typedef nodetype Node;                                          \
+            typedef T* value_type;                                          \
             typedef const_reverse_iterator itor;                            \
-            typedef list::value_type* ptr_type;                             \
+            typedef value_type* ptr_type;                                   \
+            typedef const value_type& const_reference;                      \
                                                                             \
             Node* m_node;                                                   \
             Node* m_init;                                                   \
         public:                                                             \
-            typedef list::const_reference reference_type;                   \
+            typedef const_reference reference_type;                         \
             typedef const ptr_type pointer_type;                            \
                                                                             \
             const_reverse_iterator(Node* node, Node* init)                  \
@@ -1044,6 +1050,20 @@ WX_DECLARE_LIST_XO(wxString, wxStringListBase, class WXDLLEXPORT);
 class WXDLLEXPORT wxStringList : public wxStringListBase
 {
 public:
+    compatibility_iterator Append(wxChar* s)
+        { wxString tmp = s; delete[] s; return wxStringListBase::Append(tmp); }
+    compatibility_iterator Insert(wxChar* s)
+        { wxString tmp = s; delete[] s; return wxStringListBase::Insert(tmp); }
+    compatibility_iterator Insert(size_t pos, wxChar* s)
+    {
+        wxString tmp = s;
+        delete[] s;
+        return wxStringListBase::Insert(pos, tmp);
+    }
+    compatibility_iterator Add(const wxChar* s)
+        { push_back(s); return GetLast(); }
+    compatibility_iterator Prepend(const wxChar* s)
+        { push_front(s); return GetFirst(); }
 };
 
 #endif // wxUSE_STL