X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fe30bceff0445f540e639d2b6d3977d56b34020..3a39df31ff47004a46cfb06f3fb2d3e317f96d2b:/utils/configtool/src/configitem.cpp diff --git a/utils/configtool/src/configitem.cpp b/utils/configtool/src/configitem.cpp index 05d328e345..fdf4ceac4f 100644 --- a/utils/configtool/src/configitem.cpp +++ b/utils/configtool/src/configitem.cpp @@ -13,15 +13,14 @@ #pragma implementation "configitem.h" #endif -// Includes other headers for precompiled compilation -#include "wx/wx.h" +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #include "wx/tokenzr.h" - #include "configitem.h" #include "configtree.h" #include "configtooldoc.h" @@ -105,10 +104,10 @@ void ctConfigItem::SetName(const wxString& name ) /// Clear children void ctConfigItem::Clear() { - wxNode* node = m_children.GetFirst(); + wxObjectList::compatibility_iterator node = m_children.GetFirst(); while (node) { - wxNode* next = node->GetNext(); + wxObjectList::compatibility_iterator next = node->GetNext(); ctConfigItem* child = (ctConfigItem*) node->GetData(); // This should delete 'node' too, assuming @@ -336,7 +335,7 @@ ctConfigItem* ctConfigItem::FindItem(const wxString& name) if (GetName() == name) return this; - for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() ) { ctConfigItem* child = (ctConfigItem*) node->GetData(); ctConfigItem* found = child->FindItem(name); @@ -351,7 +350,7 @@ ctConfigItem* ctConfigItem::FindNextSibling() { if (!GetParent()) return NULL; - wxNode* node = GetParent()->GetChildren().Member(this); + wxObjectList::compatibility_iterator node = GetParent()->GetChildren().Member(this); if (node && node->GetNext()) { return (ctConfigItem*) node->GetNext()->GetData(); @@ -364,7 +363,7 @@ ctConfigItem* ctConfigItem::FindPreviousSibling() { if (!GetParent()) return NULL; - wxNode* node = GetParent()->GetChildren().Member(this); + wxObjectList::compatibility_iterator node = GetParent()->GetChildren().Member(this); if (node && node->GetPrevious()) { return (ctConfigItem*) node->GetPrevious()->GetData(); @@ -390,7 +389,7 @@ ctConfigItem* ctConfigItem::DeepClone() { ctConfigItem* newItem = Clone(); - for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() ) { ctConfigItem* child = (ctConfigItem*) node->GetData(); ctConfigItem* newChild = child->DeepClone(); @@ -426,7 +425,7 @@ void ctConfigItem::DetachFromTree() data->SetConfigItem(NULL); m_treeItemId = wxTreeItemId(); - for ( wxNode* node = GetChildren().GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext() ) { ctConfigItem* child = (ctConfigItem*) node->GetData(); child->DetachFromTree(); @@ -439,12 +438,14 @@ void ctConfigItem::Attach(ctConfigItem* parent, ctConfigItem* insertBefore) if (parent) { SetParent(parent); - wxNode* node = NULL; if (insertBefore) - node = parent->GetChildren().Member(insertBefore); - - if (node) - parent->GetChildren().Insert(node, this); + { + wxObjectList::compatibility_iterator node = parent->GetChildren().Member(insertBefore); + if (node) + parent->GetChildren().Insert(node, this); + else + parent->GetChildren().Append(this); + } else parent->GetChildren().Append(this); } @@ -474,7 +475,7 @@ bool ctConfigItem::IsInActiveContext() wxList contextItems; StringToItems(GetDocument()->GetTopItem(), context, contextItems); - for ( wxNode* node = contextItems.GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = contextItems.GetFirst(); node; node = node->GetNext() ) { ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); if (otherItem->IsEnabled()) @@ -516,7 +517,7 @@ void ctConfigItem::EvaluateDependencies() wxList tempItems; StringToItems(GetDocument()->GetTopItem(), requires, tempItems); - wxNode* node; + wxObjectList::compatibility_iterator node; for ( node = tempItems.GetFirst(); node; node = node->GetNext() ) { // Only consider the dependency if both items are in @@ -556,7 +557,7 @@ void ctConfigItem::EvaluateDependencies() int disabledCount = 0; int inContextCount = 0; - for ( wxNode* node = items.GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = items.GetFirst(); node; node = node->GetNext() ) { ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); @@ -588,7 +589,7 @@ void ctConfigItem::EvaluateDependencies() int enabledCount = 0; int inContextCount = 0; - for ( wxNode* node = items.GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = items.GetFirst(); node; node = node->GetNext() ) { ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); wxString otherName = otherItem->GetName(); @@ -622,7 +623,7 @@ void ctConfigItem::EvaluateDependencies() // int disabledCount = 0; int inContextCount = 0; - for ( wxNode* node = items.GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = items.GetFirst(); node; node = node->GetNext() ) { ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); @@ -659,7 +660,7 @@ void ctConfigItem::EvaluateDependencies() int enabledCount = 0; int inContextCount = 0; - for ( wxNode* node = items.GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = items.GetFirst(); node; node = node->GetNext() ) { ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); @@ -765,7 +766,7 @@ void ctConfigItem::PropagateChange(wxList& considered) // TODO: what about string, integer? Can they have // dependencies? - for ( wxNode* node = GetDependents().GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = GetDependents().GetFirst(); node; node = node->GetNext() ) { ctConfigItem* child = (ctConfigItem*) node->GetData(); @@ -793,7 +794,7 @@ void ctConfigItem::PropagateRadioButton(wxList& considered) wxList list; StringToItems(GetDocument()->GetTopItem(), mutuallyExclusive, list); - for ( wxNode* node = list.GetFirst(); node; node = node->GetNext() ) + for ( wxObjectList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext() ) { ctConfigItem* child = (ctConfigItem*) node->GetData(); if (child->IsEnabled() && child != this)