]> git.saurik.com Git - wxWidgets.git/commitdiff
wxX11 and wxMotif STL-ification, part 1. it does not compile.
authorMattia Barbon <mbarbon@cpan.org>
Mon, 21 Jul 2003 20:00:38 +0000 (20:00 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Mon, 21 Jul 2003 20:00:38 +0000 (20:00 +0000)
yet, but keeps the diff between my local copy and HEAD < 4000
lines...

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

22 files changed:
src/common/bmpbase.cpp
src/generic/mdig.cpp
src/motif/button.cpp
src/motif/choice.cpp
src/motif/clipbrd.cpp
src/motif/cursor.cpp
src/motif/font.cpp
src/motif/frame.cpp
src/motif/menu.cpp
src/motif/palette.cpp
src/motif/radiobut.cpp
src/motif/toolbar.cpp
src/univ/menu.cpp
src/univ/radiobut.cpp
src/univ/themes/gtk.cpp
src/univ/themes/win32.cpp
src/univ/toolbar.cpp
src/univ/winuniv.cpp
src/x11/evtloop.cpp
src/x11/font.cpp
src/x11/palette.cpp
src/x11/window.cpp

index 09d126126602e66ac14b80ad7b49e9adc4075954..951ff347c78ef523e2974d16e94a0f6798dd6f8d 100644 (file)
@@ -60,7 +60,7 @@ bool wxBitmapBase::RemoveHandler(const wxString& name)
 
 wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name)
 {
-    wxList::Node *node = sm_handlers.GetFirst();
+    wxList::compatibility_iterator node = sm_handlers.GetFirst();
     while ( node )
     {
         wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
@@ -73,7 +73,7 @@ wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name)
 
 wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& extension, wxBitmapType bitmapType)
 {
-    wxList::Node *node = sm_handlers.GetFirst();
+    wxList::compatibility_iterator node = sm_handlers.GetFirst();
     while ( node )
     {
         wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
@@ -87,7 +87,7 @@ wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& extension, wxBitmapTy
 
 wxBitmapHandler *wxBitmapBase::FindHandler(wxBitmapType bitmapType)
 {
-    wxList::Node *node = sm_handlers.GetFirst();
+    wxList::compatibility_iterator node = sm_handlers.GetFirst();
     while ( node )
     {
         wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
@@ -100,13 +100,13 @@ wxBitmapHandler *wxBitmapBase::FindHandler(wxBitmapType bitmapType)
 
 void wxBitmapBase::CleanUpHandlers()
 {
-    wxList::Node *node = sm_handlers.GetFirst();
+    wxList::compatibility_iterator node = sm_handlers.GetFirst();
     while ( node )
     {
         wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
-        wxList::Node *next = node->GetNext();
+        wxList::compatibility_iterator next = node->GetNext();
         delete handler;
-        delete node;
+        sm_handlers.Erase(node);
         node = next;
     }
 }
index 7919782ea51df15fecb84f009b7497c07dc48b87..17c5bab868e0fa2de1d2257cd6ce28bb0dbf38cc 100644 (file)
@@ -590,7 +590,7 @@ void wxGenericMDIChildFrame::OnSize(wxSizeEvent& WXUNUSED(event))
     {
         // do we have _exactly_ one child?
         wxWindow *child = (wxWindow *)NULL;
-        for ( wxWindowList::Node *node = GetChildren().GetFirst();
+        for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
               node;
               node = node->GetNext() )
         {
index 5272ec5984fb8fbff4511bf42c92bdca15bd2785..d56e59900e67185428d8768378551632947627ca 100644 (file)
@@ -127,7 +127,7 @@ void wxButton::SetDefault()
     // wxButton in the same row, correction is straighforward: we set
     // resource for all wxButton in this parent (but not sub panels)
 
-    for (wxWindowList::Node * node = parent->GetChildren().GetFirst ();
+    for (wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst ();
          node; node = node->GetNext ())
     {
         wxWindow *win = node->GetData ();
index 466b14e7e583830cac203b9f806b97e785aff62d..37f3a967cf691438e125147cd5664db77eba5839 100644 (file)
@@ -222,7 +222,7 @@ void wxChoice::Delete(int n)
     Widget w = (Widget)m_widgetArray[n];
     XtRemoveCallback(w, XmNactivateCallback, (XtCallbackProc)wxChoiceCallback,
                      (XtPointer)this);
-    m_stringList.DeleteNode(m_stringList.Item(n));
+    m_stringList.Erase(m_stringList.Item(n));
     m_widgetArray.RemoveAt(size_t(n));
     m_clientDataDict.Delete(n, HasClientObjectData());
 
@@ -267,7 +267,7 @@ int wxChoice::GetSelection() const
     if (!s.IsEmpty())
     {
         int i = 0;
-        for (wxStringListNode* node = m_stringList.GetFirst ();
+        for (wxStringList::compatibility_iterator node = m_stringList.GetFirst ();
              node; node = node->GetNext ())
         {
             if (wxStrcmp(node->GetData(), s.c_str()) == 0)
@@ -287,7 +287,7 @@ void wxChoice::SetSelection(int n)
 {
     m_inSetValue = TRUE;
 
-    wxStringListNode *node = m_stringList.Item(n);
+    wxStringList::compatibility_iterator node = m_stringList.Item(n);
     if (node)
     {
 #if 0
@@ -318,7 +318,7 @@ void wxChoice::SetSelection(int n)
 int wxChoice::FindString(const wxString& s) const
 {
     int i = 0;
-    for (wxStringListNode* node = m_stringList.GetFirst();
+    for (wxStringList::compatibility_iterator node = m_stringList.GetFirst();
          node; node = node->GetNext ())
     {
         if (s == node->GetData())
@@ -332,7 +332,7 @@ int wxChoice::FindString(const wxString& s) const
 
 wxString wxChoice::GetString(int n) const
 {
-    wxStringListNode *node = m_stringList.Item(n);
+    wxStringList::compatibility_iterator node = m_stringList.Item(n);
     if (node)
         return node->GetData();
     else
@@ -523,7 +523,7 @@ wxSize wxChoice::GetItemsSize() const
     // get my
     GetTextExtent( "|", &x, &my );
 
-    wxStringList::Node* curr = m_stringList.GetFirst();
+    wxStringList::compatibility_iterator curr = m_stringList.GetFirst();
     while( curr )
     {
         GetTextExtent( curr->GetData(), &x, &y );
index 275c02fd53dcb1743168c2ac876b9e3bbc3ae1aa..1d067954ff9a3316a2333185781e11f22ee3208a 100644 (file)
@@ -195,7 +195,7 @@ wxClipboard::~wxClipboard()
 
 void wxClipboard::Clear()
 {
-    wxDataObjectList::Node* node = m_data.GetFirst();
+    wxDataObjectList::compatibility_iterator node = m_data.GetFirst();
     while (node)
     {
         delete node->GetData();
@@ -203,7 +203,7 @@ void wxClipboard::Clear()
     }
     m_data.Clear();
 
-    for( wxDataIdToDataObjectList::Node* node2 = m_idToObject.GetFirst();
+    for( wxDataIdToDataObjectList::compatibility_iterator node2 = m_idToObject.GetFirst();
          node2; node2 = node2->GetNext() )
         delete node->GetData();
     m_idToObject.Clear();
@@ -244,7 +244,7 @@ void wxClipboardCallback( Widget xwidget, long* data_id,
     wxDataObject* dobj = NULL;
     size_t size = 0;
 
-    for( wxDataIdToDataObjectList::Node* node2 =
+    for( wxDataIdToDataObjectList::compatibility_iterator node2 =
              wxTheClipboard->m_idToObject.GetFirst();
          node2; node2 = node2->GetNext() )
     {
index 3c5f636840a0ea9879b50df7e4781b5613739b6b..4ecaddf1b759c95da639a269da51211cb9ea170d 100644 (file)
@@ -69,7 +69,7 @@ wxCursorRefData::wxCursorRefData()
 
 wxCursorRefData::~wxCursorRefData()
 {
-    wxXCursorList::Node* node = m_cursors.GetFirst();
+    wxXCursorList::compatibility_iterator node = m_cursors.GetFirst();
     while (node)
     {
         wxXCursor* c = node->GetData();
@@ -299,7 +299,7 @@ WXCursor wxCursor::GetXCursor(WXDisplay* display)
 {
     if (!M_CURSORDATA)
         return (WXCursor) 0;
-    wxXCursorList::Node* node = M_CURSORDATA->m_cursors.GetFirst();
+    wxXCursorList::compatibility_iterator node = M_CURSORDATA->m_cursors.GetFirst();
     while (node)
     {
         wxXCursor* c = node->GetData();
@@ -452,7 +452,7 @@ wxXSetBusyCursor (wxWindow * win, wxCursor * cursor)
 
     XFlush (display);
 
-    for(wxWindowList::Node *node = win->GetChildren().GetFirst (); node; 
+    for(wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst (); node; 
         node = node->GetNext())
     {
         wxWindow *child = node->GetData ();
@@ -466,7 +466,7 @@ void wxBeginBusyCursor(wxCursor *cursor)
     wxBusyCursorCount++;
     if (wxBusyCursorCount == 1)
     {
-        for(wxWindowList::Node *node = wxTopLevelWindows.GetFirst (); node;
+        for(wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst (); node;
             node = node->GetNext())
         {
             wxWindow *win = node->GetData ();
@@ -484,7 +484,7 @@ void wxEndBusyCursor()
     wxBusyCursorCount--;
     if (wxBusyCursorCount == 0)
     {
-        for(wxWindowList::Node *node = wxTopLevelWindows.GetFirst (); node;
+        for(wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst (); node;
             node = node->GetNext())
         {
             wxWindow *win = node->GetData ();
index 4e7186a805602aa932f4c2b874c2ff39996cc32a..dd3de8f55a8fff0c3d4bba6ba129c8cfb28ecd09 100644 (file)
@@ -188,7 +188,7 @@ void wxFontRefData::Init(int pointSize,
 
 wxFontRefData::~wxFontRefData()
 {
-    wxList::Node* node = m_fonts.GetFirst();
+    wxList::compatibility_iterator node = m_fonts.GetFirst();
     while (node)
     {
         wxXFont* f = (wxXFont*) node->GetData();
@@ -511,7 +511,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
     int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
 
     // search existing fonts first
-    wxList::Node* node = M_FONTDATA->m_fonts.GetFirst();
+    wxList::compatibility_iterator node = M_FONTDATA->m_fonts.GetFirst();
     while (node)
     {
         wxXFont* f = (wxXFont*) node->GetData();
index 4e8cedb04fd90c97ab34e05220a760b132c2513e..ea10fe25541038c34311e14c91cd7006a095d69f 100644 (file)
@@ -581,7 +581,7 @@ void wxFrame::OnActivate(wxActivateEvent& event)
     if (!event.GetActive())
         return;
 
-    for(wxWindowList::Node *node = GetChildren().GetFirst(); node;
+    for(wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); node;
         node = node->GetNext())
     {
         // Find a child that's a subwindow, but not a dialog box.
index 8699350bbb503fc63afd5efca75cdcd8e7e66e64..c0ab80701266fde768ca6ef92840e4ba78113416 100644 (file)
@@ -151,7 +151,7 @@ void wxMenu::SetTitle(const wxString& label)
 {
     m_title = label;
 
-    wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
     if ( !node )
         return;
 
@@ -334,7 +334,7 @@ int wxMenuBar::FindMenuItem (const wxString& menuString, const wxString& itemStr
     {
         wxStripMenuCodes (wxConstCast(m_titles[i].c_str(), char), buf2);
         if (strcmp (buf1, buf2) == 0)
-            return m_menus[i]->FindItem (itemString);
+            return m_menus.Item(i)->GetData()->FindItem (itemString);
     }
     return -1;
 }
@@ -347,7 +347,7 @@ wxMenuItem *wxMenuBar::FindItem(int id, wxMenu ** itemMenu) const
     wxMenuItem *item = NULL;
     size_t menuCount = GetMenuCount();
     for (size_t i = 0; i < menuCount; i++)
-        if ((item = m_menus[i]->FindItem(id, itemMenu)))
+        if ((item = m_menus.Item(i)->GetData()->FindItem(id, itemMenu)))
             return item;
         return NULL;
 }
@@ -442,12 +442,13 @@ void wxMenu::DestroyWidgetAndDetach()
         wxMenu *menuParent = GetParent();
         if ( menuParent )
         {
-            wxMenuItemList::Node *node = menuParent->GetMenuItems().GetFirst();
+            wxMenuItemList::compatibility_iterator node = menuParent->GetMenuItems().GetFirst();
             while ( node )
             {
                 if ( node->GetData()->GetSubMenu() == this )
                 {
-                    menuParent->GetMenuItems().DeleteNode(node);
+                    delete node->GetData();
+                    menuParent->GetMenuItems().Erase(node);
 
                     break;
                 }
@@ -513,7 +514,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
     m_menuBar = menuBar;
     m_topLevelMenu = topMenu;
 
-    for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -534,7 +535,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
 // do a CreateMenu again.
 void wxMenu::DestroyMenu (bool full)
 {
-    for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -569,7 +570,7 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const
         return m_buttonWidget;
     }
 
-    for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -604,7 +605,7 @@ void wxMenu::SetBackgroundColour(const wxColour& col)
     if (m_buttonWidget)
         wxDoChangeBackgroundColour(m_buttonWidget, (wxColour&) col, TRUE);
 
-    for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -627,7 +628,7 @@ void wxMenu::SetForegroundColour(const wxColour& col)
     if (m_buttonWidget)
         wxDoChangeForegroundColour(m_buttonWidget, (wxColour&) col);
 
-    for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -661,7 +662,7 @@ void wxMenu::ChangeFont(bool keepOriginalSize)
                        NULL);
     }
 
-    for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -692,7 +693,7 @@ bool wxMenuBar::SetBackgroundColour(const wxColour& col)
 
     size_t menuCount = GetMenuCount();
     for (size_t i = 0; i < menuCount; i++)
-        m_menus[i]->SetBackgroundColour((wxColour&) col);
+        m_menus.Item(i)->GetData()->SetBackgroundColour((wxColour&) col);
 
     return TRUE;
 }
@@ -705,7 +706,7 @@ bool wxMenuBar::SetForegroundColour(const wxColour& col)
 
     size_t menuCount = GetMenuCount();
     for (size_t i = 0; i < menuCount; i++)
-        m_menus[i]->SetForegroundColour((wxColour&) col);
+        m_menus.Item(i)->GetData()->SetForegroundColour((wxColour&) col);
 
     return TRUE;
 }
@@ -722,7 +723,7 @@ bool wxMenuBar::SetFont(const wxFont& font)
 
     size_t menuCount = GetMenuCount();
     for (size_t i = 0; i < menuCount; i++)
-        m_menus[i]->SetFont(font);
+        m_menus.Item(i)->GetData()->SetFont(font);
 
     return TRUE;
 }
index 8db16a4440e64314b38088bea52e9bd67544cd4b..48368b8e349b5a614b7c1e787abcf456e1015d39 100644 (file)
@@ -77,7 +77,7 @@ wxPaletteRefData::~wxPaletteRefData()
 {
     Display *display = (Display*) NULL;
 
-    wxList::Node *node, *next;
+    wxList::compatibility_iterator node, next;
 
     for (node = m_palettes.GetFirst(); node; node = next) {
         wxXPalette *c = (wxXPalette *)node->GetData();
@@ -104,7 +104,7 @@ wxPaletteRefData::~wxPaletteRefData()
             XFreeColormap(display, cmap);
 
         next = node->GetNext();
-        m_palettes.DeleteNode(node);
+        m_palettes.Erase(node);
         delete c;
     }
 }
@@ -192,7 +192,7 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
     if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.GetCount() == 0))
         return wxTheApp->GetMainColormap(display);
 
-    wxList::Node* node = M_PALETTEDATA->m_palettes.GetFirst();
+    wxList::compatibility_iterator node = M_PALETTEDATA->m_palettes.GetFirst();
     if (!display && node)
     {
         wxXPalette* p = (wxXPalette*) node->GetData();
@@ -320,7 +320,7 @@ unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
 {
     if (!M_PALETTEDATA)
         return (unsigned long*) 0;
-    wxList::Node *node;
+    wxList::compatibility_iterator node;
 
     for (node = M_PALETTEDATA->m_palettes.GetFirst(); node;
          node = node->GetNext())
index 4cada5de0e5e206a1301ba89db3a488c4527a7af..cedc3277b627dc1f7ee4b34947a75f0799e91a92 100644 (file)
@@ -110,7 +110,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
     {
         /* search backward for last group start */
         wxRadioButton *chief = (wxRadioButton*) NULL;
-        wxWindowList::Node *node = parent->GetChildren().GetLast();
+        wxWindowList::compatibility_iterator node = parent->GetChildren().GetLast();
         while (node)
         {
             wxWindow *child = node->GetData();
index 6bdc23d9cd9e37c9a4fccf7ccf0d0a9b6a8f4cb0..2a75efa5b13dbab169ad2e3e486a3c4f7d8f9e08 100644 (file)
@@ -281,7 +281,7 @@ bool wxToolBar::Realize()
     Pixmap pixmap, insensPixmap;
     wxBitmap bmp, insensBmp;
 
-    wxToolBarToolsList::Node *node = m_tools.GetFirst();
+    wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
     while ( node )
     {
         wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
@@ -507,7 +507,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
     int packing = GetToolPacking();
     int offset = 0;
 
-    for( wxToolBarToolsList::Node *node = m_tools.GetFirst();
+    for( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
          node; node = node->GetNext() )
     {
         wxToolBarTool *t = (wxToolBarTool*)node->GetData();
@@ -644,7 +644,7 @@ void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags)
 
 wxToolBarToolBase *wxToolBar::FindToolByWidget(WXWidget w) const
 {
-    wxToolBarToolsList::Node* node = m_tools.GetFirst();
+    wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
     while ( node )
     {
         wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
index a4e117655227f453b38a2058a77cae2f6b32b8ff..a71678454b65bed0833913fee3a9a9a940d05125 100644 (file)
@@ -145,7 +145,7 @@ public:
     }
 
     // find the menu item at given position
-    wxMenuItemList::Node *GetMenuItemFromPoint(const wxPoint& pt) const;
+    wxMenuItemList::compatibility_iterator GetMenuItemFromPoint(const wxPoint& pt) const;
 
     // refresh the given item
     void RefreshItem(wxMenuItem *item);
@@ -183,10 +183,10 @@ protected:
     void ResetCurrent();
 
     // set the current node and item withotu refreshing anything
-    void SetCurrent(wxMenuItemList::Node *node);
+    void SetCurrent(wxMenuItemList::compatibility_iterator node);
 
     // change the current item refreshing the old and new items
-    void ChangeCurrent(wxMenuItemList::Node *node);
+    void ChangeCurrent(wxMenuItemList::compatibility_iterator node);
 
     // activate item, i.e. call either ClickItem() or OpenSubmenu() depending
     // on what it is, return TRUE if something was done (i.e. it's not a
@@ -216,23 +216,23 @@ protected:
     bool HasOpenSubmenu() const { return m_hasOpenSubMenu; }
 
     // get previous node after the current one
-    wxMenuItemList::Node *GetPrevNode() const;
+    wxMenuItemList::compatibility_iterator GetPrevNode() const;
 
     // get previous node before the given one, wrapping if it's the first one
-    wxMenuItemList::Node *GetPrevNode(wxMenuItemList::Node *node) const;
+    wxMenuItemList::compatibility_iterator GetPrevNode(wxMenuItemList::compatibility_iterator node) const;
 
     // get next node after the current one
-    wxMenuItemList::Node *GetNextNode() const;
+    wxMenuItemList::compatibility_iterator GetNextNode() const;
 
     // get next node after the given one, wrapping if it's the last one
-    wxMenuItemList::Node *GetNextNode(wxMenuItemList::Node *node) const;
+    wxMenuItemList::compatibility_iterator GetNextNode(wxMenuItemList::compatibility_iterator node) const;
 
 private:
     // the menu we show
     wxMenu *m_menu;
 
     // the menu node corresponding to the current item
-    wxMenuItemList::Node *m_nodeCurrent;
+    wxMenuItemList::compatibility_iterator m_nodeCurrent;
 
     // do we currently have an opened submenu?
     bool m_hasOpenSubMenu;
@@ -328,19 +328,23 @@ wxPopupMenuWindow::~wxPopupMenuWindow()
 
 void wxPopupMenuWindow::ResetCurrent()
 {
+#if wxUSE_STL
+    SetCurrent(wxMenuItemList::compatibility_iterator());
+#else
     SetCurrent(NULL);
+#endif
 }
 
-void wxPopupMenuWindow::SetCurrent(wxMenuItemList::Node *node)
+void wxPopupMenuWindow::SetCurrent(wxMenuItemList::compatibility_iterator node)
 {
     m_nodeCurrent = node;
 }
 
-void wxPopupMenuWindow::ChangeCurrent(wxMenuItemList::Node *node)
+void wxPopupMenuWindow::ChangeCurrent(wxMenuItemList::compatibility_iterator node)
 {
     if ( node != m_nodeCurrent )
     {
-        wxMenuItemList::Node *nodeOldCurrent = m_nodeCurrent;
+        wxMenuItemList::compatibility_iterator nodeOldCurrent = m_nodeCurrent;
 
         m_nodeCurrent = node;
 
@@ -364,15 +368,15 @@ void wxPopupMenuWindow::ChangeCurrent(wxMenuItemList::Node *node)
     }
 }
 
-wxMenuItemList::Node *wxPopupMenuWindow::GetPrevNode() const
+wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetPrevNode() const
 {
     // return the last node if there had been no previously selected one
     return m_nodeCurrent ? GetPrevNode(m_nodeCurrent)
                          : m_menu->GetMenuItems().GetLast();
 }
 
-wxMenuItemList::Node *
-wxPopupMenuWindow::GetPrevNode(wxMenuItemList::Node *node) const
+wxMenuItemList::compatibility_iterator 
+wxPopupMenuWindow::GetPrevNode(wxMenuItemList::compatibility_iterator node) const
 {
     if ( node )
     {
@@ -387,15 +391,15 @@ wxPopupMenuWindow::GetPrevNode(wxMenuItemList::Node *node) const
     return node;
 }
 
-wxMenuItemList::Node *wxPopupMenuWindow::GetNextNode() const
+wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetNextNode() const
 {
     // return the first node if there had been no previously selected one
     return m_nodeCurrent ? GetNextNode(m_nodeCurrent)
                          : m_menu->GetMenuItems().GetFirst();
 }
 
-wxMenuItemList::Node *
-wxPopupMenuWindow::GetNextNode(wxMenuItemList::Node *node) const
+wxMenuItemList::compatibility_iterator 
+wxPopupMenuWindow::GetNextNode(wxMenuItemList::compatibility_iterator node) const
 {
     if ( node )
     {
@@ -488,7 +492,7 @@ void wxPopupMenuWindow::DismissAndNotify()
 // wxPopupMenuWindow geometry
 // ----------------------------------------------------------------------------
 
-wxMenuItemList::Node *
+wxMenuItemList::compatibility_iterator
 wxPopupMenuWindow::GetMenuItemFromPoint(const wxPoint& pt) const
 {
     // we only use the y coord normally, but still check x in case the point is
@@ -496,7 +500,7 @@ wxPopupMenuWindow::GetMenuItemFromPoint(const wxPoint& pt) const
     if ( wxWindow::HitTest(pt) == wxHT_WINDOW_INSIDE )
     {
         wxCoord y = 0;
-        for ( wxMenuItemList::Node *node = m_menu->GetMenuItems().GetFirst();
+        for ( wxMenuItemList::compatibility_iterator node = m_menu->GetMenuItems().GetFirst();
               node;
               node = node->GetNext() )
         {
@@ -510,7 +514,11 @@ wxPopupMenuWindow::GetMenuItemFromPoint(const wxPoint& pt) const
         }
     }
 
+#if wxUSE_STL
+    return wxMenuItemList::compatibility_iterator();
+#else
     return NULL;
+#endif
 }
 
 // ----------------------------------------------------------------------------
@@ -544,7 +552,7 @@ void wxPopupMenuWindow::DoDraw(wxControlRenderer *renderer)
 
     wxCoord y = 0;
     const wxMenuGeometryInfo& gi = m_menu->GetGeometryInfo();
-    for ( wxMenuItemList::Node *node = m_menu->GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = m_menu->GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -692,7 +700,7 @@ bool wxPopupMenuWindow::ProcessLeftDown(wxMouseEvent& event)
 
 void wxPopupMenuWindow::OnLeftUp(wxMouseEvent& event)
 {
-    wxMenuItemList::Node *node = GetMenuItemFromPoint(event.GetPosition());
+    wxMenuItemList::compatibility_iterator node = GetMenuItemFromPoint(event.GetPosition());
     if ( node )
     {
         ActivateItem(node->GetData(), WithMouse);
@@ -726,7 +734,7 @@ void wxPopupMenuWindow::OnMouseMove(wxMouseEvent& event)
 
 void wxPopupMenuWindow::ProcessMouseMove(const wxPoint& pt)
 {
-    wxMenuItemList::Node *node = GetMenuItemFromPoint(pt);
+    wxMenuItemList::compatibility_iterator node = GetMenuItemFromPoint(pt);
 
     // don't reset current to NULL here, we only do it when the mouse leaves
     // the window (see below)
@@ -817,7 +825,11 @@ void wxPopupMenuWindow::OnMouseLeave(wxMouseEvent& event)
 
         if ( resetCurrent )
         {
+#if wxUSE_STL
+            ChangeCurrent(wxMenuItemList::compatibility_iterator());
+#else
             ChangeCurrent(NULL);
+#endif
         }
     }
 
@@ -889,9 +901,9 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
             {
                 bool up = key == WXK_UP;
 
-                wxMenuItemList::Node *nodeStart = up ? GetPrevNode()
+                wxMenuItemList::compatibility_iterator nodeStart = up ? GetPrevNode()
                                                      : GetNextNode(),
-                                     *node = nodeStart;
+                                     node = nodeStart;
                 while ( node && node->GetData()->IsSeparator() )
                 {
                     node = up ? GetPrevNode(node) : GetNextNode(node);
@@ -900,7 +912,11 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
                     {
                         // nothing but separators and disabled items in this
                         // menu, break out
+#if wxUSE_STL
+                        node = wxMenuItemList::compatibility_iterator();
+#else
                         node = NULL;
+#endif
                     }
                 }
 
@@ -934,7 +950,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
                 // we want to start from the item after this one because
                 // if we're already on the item with the given accel we want to
                 // go to the next one, not to stay in place
-                wxMenuItemList::Node *nodeStart = GetNextNode();
+                wxMenuItemList::compatibility_iterator nodeStart = GetNextNode();
 
                 // do we have more than one item with this accel?
                 bool notUnique = FALSE;
@@ -944,8 +960,12 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key)
 
                 // loop through all items searching for the item with this
                 // accel
-                wxMenuItemList::Node *node = nodeStart,
-                                     *nodeFound = NULL;
+                wxMenuItemList::compatibility_iterator node = nodeStart,
+#if wxUSE_STL
+                                                       nodeFound = wxMenuItemList::compatibility_iterator();
+#else
+                                                       nodeFound = NULL;
+#endif
                 for ( ;; )
                 {
                     item = node->GetData();
@@ -1113,7 +1133,7 @@ bool wxMenu::DoAppend(wxMenuItem *item)
         {
             // we need to update its end item
             item->SetRadioGroupStart(m_startRadioGroup);
-            wxMenuItemList::Node *node = GetMenuItems().Item(m_startRadioGroup);
+            wxMenuItemList::compatibility_iterator node = GetMenuItems().Item(m_startRadioGroup);
 
             if ( node )
             {
@@ -1398,7 +1418,7 @@ bool wxMenu::ProcessAccelEvent(const wxKeyEvent& event)
     }
 
     // try our submenus
-    for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -1584,7 +1604,7 @@ void wxMenuItem::Check(bool check)
         }
 
         // also uncheck all the other items in this radio group
-        wxMenuItemList::Node *node = items.Item(start);
+        wxMenuItemList::compatibility_iterator node = items.Item(start);
         for ( int n = start; n <= end && node; n++ )
         {
             if ( n != pos )
@@ -2335,7 +2355,7 @@ int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
 bool wxMenuBar::ProcessAccelEvent(const wxKeyEvent& event)
 {
     size_t n = 0;
-    for ( wxMenuList::Node *node = m_menus.GetFirst();
+    for ( wxMenuList::compatibility_iterator node = m_menus.GetFirst();
           node;
           node = node->GetNext(), n++ )
     {
index f0ddaa727a042db9e1f90ae5f6d85cfe4d3684ea..5357f948d7faca1660a533f9c2991fb6e231e314 100644 (file)
@@ -78,7 +78,7 @@ void wxRadioButton::OnCheck()
     // find the radio button which is the first in the group, i.e. the one
     // with wxRB_GROUP style
     const wxWindowList& siblings = GetParent()->GetChildren();
-    wxWindowList::Node *nodeStart = siblings.Find(this);
+    wxWindowList::compatibility_iterator nodeStart = siblings.Find(this);
     while ( nodeStart )
     {
         // stop if we found a radio button with wxRB_GROUP style or it we
index a2d98dd2990a4f728dff7eec1bf4b4e76a5d0d5a..50c81098b755364b06b6fcc0397d60e8da532ece 100644 (file)
@@ -2155,7 +2155,7 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win,
             widthAccelMax = 0,
             widthBmpMax = MENU_LEFT_MARGIN;
 
-    for ( wxMenuItemList::Node *node = menu.GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = menu.GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
index d1f5cde01322d9d52ca561c0dad77014a92d4748..ef654c4ad56609a8600bb0e1b758f42e0c2ef06d 100644 (file)
@@ -3122,7 +3122,7 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win,
             widthAccelMax = 0,
             widthBmpMax = MENU_LEFT_MARGIN;
 
-    for ( wxMenuItemList::Node *node = menu.GetMenuItems().GetFirst();
+    for ( wxMenuItemList::compatibility_iterator node = menu.GetMenuItems().GetFirst();
           node;
           node = node->GetNext() )
     {
index e3d23777509a0243af1fcb8349da663c51139fa3..c8ec9c1a209d65669b05f446158d8518d9485c19 100644 (file)
@@ -211,7 +211,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const
             return NULL;
     }
 
-    for ( wxToolBarToolsList::Node *node = m_tools.GetFirst();
+    for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -444,7 +444,7 @@ void wxToolBar::DoLayout()
            *pCur = IsVertical() ? &y : &x;
 
     // calculate the positions of all elements
-    for ( wxToolBarToolsList::Node *node = m_tools.GetFirst();
+    for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
           node;
           node = node->GetNext() )
     {
@@ -568,7 +568,7 @@ void wxToolBar::DoDraw(wxControlRenderer *renderer)
     GetRectLimits(rectUpdate, &start, &end);
 
     // and redraw all the tools intersecting it
-    for ( wxToolBarToolsList::Node *node = m_tools.GetFirst();
+    for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
           node;
           node = node->GetNext() )
     {
index 3d4292e5c31011eb66265939bb1acf573dd24b07..f4aeb43620bce7d755844fc36904fba567afc982 100644 (file)
@@ -393,7 +393,7 @@ void wxWindow::Refresh(bool eraseBackground, const wxRect *rectClient)
     wxWindowNative::Refresh(eraseBackground, &rectWin);
 
     // Refresh all sub controls if any.
-    wxWindowList::Node *node = GetChildren().GetFirst();
+    wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
     while ( node )
     {
         wxWindow *win = node->GetData();
@@ -954,7 +954,7 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
     // scroll children accordingly:
     wxPoint offset(dx, dy);
 
-    for (wxWindowList::Node *node = GetChildren().GetFirst();
+    for (wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
          node; node = node->GetNext())
     {
         wxWindow *child = node->GetData();
index 20da77c3e790b129137dab0a64b9ed38c3f4d2cf..701d4cd9735714192d824d323e8da06182414bce 100644 (file)
@@ -73,7 +73,7 @@ class wxSocketTable: public wxHashTable
     }
     ~wxSocketTable()
     {
-        DeleteContents(TRUE);
+        WX_CLEAR_HASH_TABLE(*this)
     }
 
     wxSocketTableEntry* FindEntry(int fd);
@@ -171,7 +171,7 @@ bool wxSocketTable::CallCallback(int fd, wxSocketTableType socketType)
 void wxSocketTable::FillSets(fd_set* readset, fd_set* writeset, int* highest)
 {
     BeginFind();
-    wxNode* node = Next();
+    wxHashTable::compatibility_iterator node = Next();
     while (node)
     {
         wxSocketTableEntry* entry = (wxSocketTableEntry*) node->GetData();
@@ -197,7 +197,7 @@ void wxSocketTable::FillSets(fd_set* readset, fd_set* writeset, int* highest)
 void wxSocketTable::ProcessEvents(fd_set* readset, fd_set* writeset)
 {
     BeginFind();
-    wxNode* node = Next();
+    wxHashTable::compatibility_iterator node = Next();
     while (node)
     {
         wxSocketTableEntry* entry = (wxSocketTableEntry*) node->GetData();
index 16aeceff709fef65c516f6f1e94d587d4113d724..3e57b0e44442be978244d6085698e0c0b02f598c 100644 (file)
@@ -424,7 +424,7 @@ void wxFontRefData::ClearX11Fonts()
 {
 #if wxUSE_UNICODE
 #else
-    wxNode* node = m_fonts.GetFirst();
+    wxList::compatibility_iterator node = m_fonts.GetFirst();
     while (node)
     {
         wxXFont* f = (wxXFont*) node->GetData();
@@ -872,7 +872,7 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
     int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
 
     // search existing fonts first
-    wxNode* node = M_FONTDATA->m_fonts.GetFirst();
+    wxList::compatibility_iterator node = M_FONTDATA->m_fonts.GetFirst();
     while (node)
     {
         wxXFont* f = (wxXFont*) node->GetData();
index 7a035ffd1835b3b80df70fe03803db21cfa7b2e0..67c40ced5400ef64dd7e6d1302f9ad81e82ec8d4 100644 (file)
@@ -77,7 +77,7 @@ wxPaletteRefData::~wxPaletteRefData()
 {
     Display *display = (Display*) NULL;
 
-    wxNode *node, *next;
+    wxList::compatibility_iterator node, next;
 
     for (node = m_palettes.GetFirst(); node; node = next) {
         wxXPalette *c = (wxXPalette *)node->GetData();
@@ -106,7 +106,7 @@ wxPaletteRefData::~wxPaletteRefData()
             XFreeColormap(display, cmap);
 
         next = node->GetNext();
-        m_palettes.DeleteNode(node);
+        m_palettes.Erase(node);
         delete c;
     }
 }
@@ -194,7 +194,7 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
     if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.GetCount() == 0))
         return wxTheApp->GetMainColormap(display);
 
-    wxNode* node = M_PALETTEDATA->m_palettes.GetFirst();
+    wxList::compatibility_iterator node = M_PALETTEDATA->m_palettes.GetFirst();
     if (!display && node)
     {
         wxXPalette* p = (wxXPalette*) node->GetData();
@@ -319,7 +319,7 @@ unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
 {
     if (!M_PALETTEDATA)
         return (unsigned long*) 0;
-    wxNode *node;
+    wxList::compatibility_iterator node;
 
     for (node = M_PALETTEDATA->m_palettes.GetFirst(); node; node = node->GetNext())
     {
index 1edf8c66047b7ba9de9f9224e90abdf7efbc7d9e..fe52bbff49c248b6ad17b2330ab01b99ff109574 100644 (file)
@@ -1261,7 +1261,7 @@ void wxWindowX11::SendNcPaintEvents()
 // Responds to colour changes: passes event on to children.
 void wxWindowX11::OnSysColourChanged(wxSysColourChangedEvent& event)
 {
-    wxWindowList::Node *node = GetChildren().GetFirst();
+    wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
     while ( node )
     {
         // Only propagate to non-top-level windows