]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/configtool/src/configtooldoc.cpp
missign app.h header
[wxWidgets.git] / utils / configtool / src / configtooldoc.cpp
index d5ae2a8b244534151e01a5946512716bd1f09c8e..660af435357e82289bdb5d2c19babf8dfc25e5a8 100644 (file)
@@ -352,7 +352,7 @@ bool ctConfigToolDoc::DoSave(ctConfigItem* item, wxOutputStream& stream, int ind
         stream << ctEscapeHTMLCharacters(prop->GetVariant().GetString()) ;
         stream << wxT("</") << prop->GetName() << wxT(">");
 
-        node = node->Next();
+        node = node->GetNext();
     }
 
     // Output children
@@ -362,7 +362,7 @@ bool ctConfigToolDoc::DoSave(ctConfigItem* item, wxOutputStream& stream, int ind
         ctConfigItem* child = (ctConfigItem*) node->GetData();
         DoSave(child, stream, indent);
 
-        node = node->Next();
+        node = node->GetNext();
     }
 
     indent --;
@@ -575,6 +575,7 @@ void ctConfigToolDoc::RefreshDependencies(ctConfigItem* item)
     wxString precludes = item->GetPropertyString(wxT("precludes"));
     wxString enabledIf = item->GetPropertyString(wxT("enabled-if"));
     wxString enabledIfNot = item->GetPropertyString(wxT("enabled-if-not"));
+    wxString indeterminateIf = item->GetPropertyString(wxT("indeterminate-if"));
     wxString context = item->GetPropertyString(wxT("context"));
 
     if (!requires.IsEmpty())
@@ -589,6 +590,9 @@ void ctConfigToolDoc::RefreshDependencies(ctConfigItem* item)
     if (!enabledIf.IsEmpty())
         item->StringToArray(enabledIf, requiresArr);
 
+    if (!indeterminateIf.IsEmpty())
+        item->StringToArray(indeterminateIf, requiresArr);
+
     // Add the parent to the list of dependencies, if the
     // parent is a check or radio group.
     ctConfigItem* parent = item->GetParent();
@@ -639,7 +643,7 @@ void ctConfigToolDoc::GenerateSetup(ctConfigItem* item, wxString& str)
     wxString name = item->GetName();
 
     // We don't process the platform choice
-    if (item->GetName() == wxT("Platform"))
+    if (item->GetName() == wxT("Target"))
         return;
 
     if (item->IsInActiveContext() &&
@@ -689,8 +693,8 @@ wxString ctConfigToolDoc::GenerateConfigureCommand()
 
     str << path << wxT("configure");
 
-    // Find the platform option to use
-    ctConfigItem* platformsFolder = GetTopItem()->FindItem(wxT("Platform"));
+    // Find the target to use
+    ctConfigItem* platformsFolder = GetTopItem()->FindItem(wxT("Target"));
     if (platformsFolder)
     {
         for ( wxNode* node = platformsFolder->GetChildren().GetFirst(); node; node = node->GetNext() )
@@ -714,7 +718,7 @@ void ctConfigToolDoc::GenerateConfigureCommand(ctConfigItem* item, wxString& str
 {
     // We don't process the platform group, since we've
     // already done so.
-    if (item->GetName() == wxT("Platform"))
+    if (item->GetName() == wxT("Target"))
         return;
 
     if (item->IsInActiveContext() &&
@@ -791,6 +795,51 @@ wxString ctConfigToolDoc::GetFrameworkDir(bool makeUnix)
     return path;
 }
 
+/// Finds the next item in the tree
+ctConfigItem* ctConfigToolDoc::FindNextItem(ctConfigItem* item, bool wrap)
+{
+    if (!item)
+        return GetTopItem();
+
+    // First, try to find the first child
+    if (item->GetChildCount() > 0)
+    {
+        return item->GetChild(0);
+    }
+    else
+    {
+        ctConfigItem* p = item;
+        while (p)
+        {
+            ctConfigItem* toFind = FindNextSibling(p);
+            if (toFind)
+                return toFind;
+            p = p->GetParent();
+        }
+    }
+
+    // Finally, wrap around to the root.
+    if (wrap)
+        return GetTopItem();
+    else
+        return NULL;
+}
+
+/// Finds the next sibling in the tree
+ctConfigItem* ctConfigToolDoc::FindNextSibling(ctConfigItem* item)
+{
+    if (item->GetParent())
+    {
+        wxNode* node = item->GetParent()->GetChildren().Member(item);
+        if (node && node->GetNext())
+        {
+            ctConfigItem* nextItem = (ctConfigItem*) node->GetNext()->GetData();
+            return nextItem;
+        }
+    }
+    return NULL;
+}
+
 
 /*
  * Implements a document editing command.
@@ -990,3 +1039,4 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
     return TRUE;
 }
 
+