Added Find dialog

Bumped version to 1.01


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-06-14 16:25:26 +00:00
parent 8cb4919bd4
commit e776786754
14 changed files with 369 additions and 3 deletions

View File

@@ -791,6 +791,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 +1035,4 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
return TRUE;
}