Exemplo n.º 1
0
void nuiContainer::SilentInvalidateChildren(bool Recurse)
{
  CheckValid();
  IteratorPtr pIt;
  if (Recurse)
  {
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      nuiContainerPtr pCont = dynamic_cast<nuiContainerPtr>(pItem);
      if (pCont)
        pCont->SilentInvalidateChildren(Recurse);
      pItem->SilentInvalidate();
    }
  }
  else
  {
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      pItem->SilentInvalidate();
    }
  }
  delete pIt;
}
Exemplo n.º 2
0
void MyTreeCtrl::RefreshTreeStatus(Builder *pBuilder)
{
	VTLOG("(Refreshing Tree Status)\n");

	wxTreeItemId root = GetRootItem();
	wxTreeItemId parent, item;

	wxTreeItemIdValue cookie;
	for (parent = GetFirstChild(root, cookie); parent; parent = GetNextChild(root, cookie))
	{
		wxTreeItemIdValue cookie2;
		for (item = GetFirstChild(parent, cookie2); item; item = GetNextChild(parent, cookie2))
		{
			MyTreeItemData *data = (MyTreeItemData *)GetItemData(item);
			if (data)
			{
				SetItemText(item, MakeItemName(data->m_pLayer));
				if (data->m_pLayer == pBuilder->GetActiveLayer())
					SelectItem(item);
				if (data->m_pLayer->GetVisible())
				{
					SetItemFont(item, *wxNORMAL_FONT);
					SetItemTextColour(item, wxColour(0,0,0));
				}
				else
				{
					SetItemFont(item, *wxITALIC_FONT);
					SetItemTextColour(item, wxColour(80,80,80));
				}
			}
		}
	}
}
//---------------------------------------------------------
void CData_Source_PgSQL::Autoconnect(void)
{
	long Reopen	= 0;

	CONFIG_Read("/DATA", "PROJECT_DB_REOPEN", Reopen);

	if( Reopen != 0 )
	{
		wxTreeItemIdValue srvCookie; wxTreeItemId srvItem = GetFirstChild(GetRootItem(), srvCookie);

		while( srvItem.IsOk() )
		{
			wxTreeItemIdValue Cookie; wxTreeItemId Item = GetFirstChild(srvItem, Cookie);

			while( Item.IsOk() )
			{
				CData_Source_PgSQL_Data	*pData	= Item.IsOk() ? (CData_Source_PgSQL_Data *)GetItemData(Item) : NULL; if( pData == NULL )	return;

				if( pData->Get_Type() == TYPE_SOURCE && !pData->Get_Username().is_Empty() )
				{
					Source_Open(pData, false);
				}

				Item	= GetNextChild(Item, Cookie);
			}

			srvItem	= GetNextChild(srvItem, srvCookie);
		}
	}
}
Exemplo n.º 4
0
wxTreeItemId
SamplesTreeCtrl::getTreeItem( smp::Sample *sample, const wxTreeItemId &parent ) const
{
	wxTreeItemIdValue cookie;

	wxTreeItemId speechtem = GetFirstChild( parent, cookie );

	wxTreeItemId foundItem;
	while( speechtem.IsOk() )
	{
		SamplesTreeData *data = (SamplesTreeData *)GetItemData( speechtem );

		if ( data == NULL )
		{
			speechtem = GetNextChild( parent, cookie );
			continue;
		}

		if ( data->m_sample == sample )
			return speechtem;

		// call recursively on my children
		getTreeItem( sample, speechtem );

		// continue with my next sibling
		speechtem = GetNextChild( parent, cookie );
	}

	return speechtem;
}
Exemplo n.º 5
0
int32 UBTCompositeNode::FindChildToExecute(struct FBehaviorTreeSearchData& SearchData, EBTNodeResult::Type& LastResult) const
{
	FBTCompositeMemory* NodeMemory = GetNodeMemory<FBTCompositeMemory>(SearchData);
	int32 RetIdx = BTSpecialChild::ReturnToParent;

	if (Children.Num())
	{
		for (int32 ChildIdx = GetNextChild(SearchData, NodeMemory->CurrentChild, LastResult);
			ChildIdx >= 0;
			ChildIdx = GetNextChild(SearchData, ChildIdx, LastResult))
		{
			// check decorators
			if (DoDecoratorsAllowExecution(SearchData.OwnerComp, SearchData.OwnerComp->ActiveInstanceIdx, ChildIdx))
			{
				OnChildActivation(SearchData, ChildIdx);
				RetIdx = ChildIdx;
				break;
			}
			else
			{
				LastResult = EBTNodeResult::Failed;
				NotifyDecoratorsOnFailedActivation(SearchData, ChildIdx, LastResult);
			}
		}
	}

	return RetIdx;
}
Exemplo n.º 6
0
Arquivo: iff.cpp Projeto: Scraft/avpmp
	ChildNode * Composite::GetNextChild(ChildNode const * pNode, ID idMatch)
	{
		for (ChildNode * pSrchNode = GetNextChild(pNode); pSrchNode; pSrchNode = GetNextChild(pSrchNode))
		{
			if (pSrchNode->GetChunk()->m_idCk == idMatch && !pSrchNode->GetChunk()->IsUnknown()) return pSrchNode;
		}
		return NULL;
	}
Exemplo n.º 7
0
void svSymbolTree::BuildTree(const wxFileName& fn)
{
    TagEntryPtrVector_t newTags;
    ITagsStoragePtr db = TagsManagerST::Get()->GetDatabase();
    if ( !db ) {
        return;
    }
    
    db->SelectTagsByFile(fn.GetFullPath(), newTags);
    if ( TagsManagerST::Get()->AreTheSame(newTags, m_currentTags) )
        return;
    
    wxWindowUpdateLocker locker(this);
    SymbolTree::BuildTree(fn, &newTags);
    
    // Request from the parsing thread list of include files
    ++m_uid;
    
    ParseRequest *req = new ParseRequest(this);
    req->setFile(fn.GetFullPath());
    req->setType(ParseRequest::PR_PARSE_INCLUDE_STATEMENTS);
    req->_uid = m_uid; // Identifies this request
    ParseThreadST::Get()->Add( req );
    
    wxTreeItemId root = GetRootItem();
    if( root.IsOk() && ItemHasChildren(root) ) {
        wxTreeItemIdValue cookie;
        wxTreeItemId child = GetFirstChild(root, cookie);
        while ( child.IsOk() ) {
            Expand(child);
            child = GetNextChild(root, cookie);
        }
    }
}
Exemplo n.º 8
0
void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
{
    Freeze();
    // first (recursively) collapse all the children
    wxTreeItemIdValue cookie;
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
    for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
          idCurr.IsOk();
          idCurr = GetNextChild(item, cookie) )
    {
        CollapseAllChildren(idCurr);
    }

    // then collapse this element too unless it's the hidden root which can't
    // be collapsed
    if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
        Collapse(item);
    Thaw();
}
Exemplo n.º 9
0
//------------------------------------------------------------------------------
wxTreeItemId OutputTree::FindItem(wxTreeItemId parentId, const wxString &name)
{
   #if DEBUG_OUTPUT_TREE
   MessageInterface::ShowMessage
      ("OutputTree::FindItem() parentId=%s, name=%s\n",
       GetItemText(parentId).c_str(), name.c_str());
   #endif
   
   wxTreeItemId itemId;
   
   if (ItemHasChildren(parentId))
   {
      wxString itemText;
      wxTreeItemIdValue cookie;
      wxTreeItemId childId = GetFirstChild(parentId, cookie);
      
      while (childId.IsOk())
      {
         itemText = GetItemText(childId);
         if (itemText == name)
            return childId;
         
         childId = GetNextChild(parentId, cookie);
      }
   }
   
   return itemId;
}
Exemplo n.º 10
0
bool nuiContainer::DrawChildren(nuiDrawContext* pContext)
{
  CheckValid();
  IteratorPtr pIt;

  if (mReverseRender)
  {
    for (pIt = GetLastChild(); pIt && pIt->IsValid(); GetPreviousChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      if (pItem)
        DrawChild(pContext, pItem);
    }
    delete pIt;
  }
  else
  {
    for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
    {
      nuiWidgetPtr pItem = pIt->GetWidget();
      if (pItem)
        DrawChild(pContext, pItem);
    }
    delete pIt;
  }
  return true;
}
Exemplo n.º 11
0
int CIdXmlUtility::GetFirstChild(const char* szChildTagName, const char* szChildAttr1Name,
							 string& strChildTagValue, string& strChildAttr1Value)
{
	m_domParser->ResetChildPos();
	return GetNextChild(szChildTagName, szChildAttr1Name,
				strChildTagValue, strChildAttr1Value);
}
//---------------------------------------------------------
wxTreeItemId CData_Source_PgSQL::Get_Server_Item(const wxString &Server, bool bCreate)
{
	wxString	Name	= Server.AfterFirst('[').BeforeFirst(']');

	wxTreeItemIdValue Cookie; wxTreeItemId Item = GetFirstChild(GetRootItem(), Cookie);

	while( Item.IsOk() )
	{
		if( !Name.Cmp(GetItemText(Item)) )
		{
			return( Item );
		}

		Item	= GetNextChild(Item, Cookie);
	}

	if( bCreate )
	{
		Item	= AppendItem(GetRootItem(), Name, IMG_SERVER, IMG_SERVER, new CData_Source_PgSQL_Data(TYPE_SERVER, &Name, &Name));

		SortChildren(GetRootItem());
		Expand      (GetRootItem());
	}

	return( Item );
}
Exemplo n.º 13
0
wxTreeItemId wxSpinTreeCtrl::GetTreeItem(const char *nodeId, wxTreeItemId idParent, wxTreeItemIdValue cookie)
{
    if (! idParent.IsOk())
        return NULL;

    wxSpinTreeItemData *treeData = (wxSpinTreeItemData*)GetItemData(idParent);
    if (treeData && treeData->m_pNode.valid())
    {
        if (strcmp(treeData->m_pNode->id->s_name, nodeId) == 0)
        {
            return idParent;
        }
    }

    if (ItemHasChildren(idParent))
    {
        wxTreeItemId child;
        for (child = GetFirstChild(idParent, cookie); child.IsOk(); child = GetNextChild(idParent, cookie))
        {
            wxTreeItemId targetItem = GetTreeItem(nodeId, child, cookie);
            if (targetItem.IsOk())
                return targetItem;
        }
    }
    return GetTreeItem(nodeId, GetNextSibling(idParent), cookie);
}
Exemplo n.º 14
0
VectorTreeItemId BFBackupTree::GetTaskItems (wxTreeItemId idParent, bool bGoDeep /*= true*/)
{
    VectorTreeItemId vec;

    wxTreeItemId idCurr;
    wxTreeItemIdValue idCookie;

    if (ItemHasChildren(idParent))
    {
        for (idCurr = GetFirstChild(idParent, idCookie);
             idCurr.IsOk();
             idCurr = GetNextChild(idParent, idCookie))
        {
            if (ItemHasChildren(idCurr) == bGoDeep)
            {
                VectorTreeItemId vecSub(GetTaskItems(idCurr, true));

                for (ItVectorTreeItemId it = vecSub.begin();
                     it != vecSub.end();
                     it++)
                {
                    vec.push_back(*it);
                }
            }
            else
            {
                if (IsTask(idCurr))
                    vec.push_back(idCurr);
            }
        }
    }

    return vec;
}
Exemplo n.º 15
0
wxTreeItemId BFBackupTree::FindItemByPath (wxTreeItemId idStart, const wxString& strPath)
{
    wxTreeItemId            idCurr, idLast;
    wxTreeItemIdValue       idCookie;
    wxString                str;

    // check start item
    if (HasPath(idStart, strPath))
        return idStart;

    if (ItemHasChildren(idStart))
    {
        for (idCurr = GetFirstChild(idStart, idCookie);
             idCurr.IsOk();
             idCurr = GetNextChild(idStart, idCookie))
        {
            idLast = FindItemByPath(idCurr, strPath);

            if (idLast.IsOk())
                return idLast;
        }
    }

    return wxTreeItemId();
}
Exemplo n.º 16
0
 bool MenuBar::SetActiveTab(MenuTab* tab)
 {
   bool found = false;
   MenuTab*  pChild = (MenuTab*)Group::GetFirstChild();
   int i=0;
   while(pChild)
   {
     ++i;
     if(pChild == tab)
     {
       pChild->SetActive(true);
       SetCurrentChild(pChild);
       found = true;
     }
     else
     {
       pChild->SetActive(false);
     }
     pChild = (MenuTab*)GetNextChild(pChild);
   }
   // Activate first tab if none where found.
   if(!found)
   {
     pChild = (MenuTab*)Group::GetFirstChild();
     pChild->SetActive();
     SetCurrentChild(pChild);
   }
   return found;
 }
Exemplo n.º 17
0
static RealDTEntry
FindChild(RealDTEntry cur, char *buf)
{
	RealDTEntry	child;
	unsigned long	index;
	char *		str;
	int		dummy;

	if (cur->nChildren == 0) {
		return NULL;
	}
	index = 1;
	child = GetFirstChild(cur);
	while (1) {
		if (DTGetProperty(child, "name", (void **)&str, &dummy) != kSuccess) {
			break;
		}
		if (strcmp(str, buf) == 0) {
			return child;
		}
		if (index >= cur->nChildren) {
			break;
		}
		child = GetNextChild(child);
		index++;
	}
	return NULL;
}
//---------------------------------------------------------
void CData_Source_PgSQL::Update_Sources(const wxTreeItemId &Root)
{
	Freeze();

	//-----------------------------------------------------
	wxTreeItemIdValue Cookie; wxTreeItemId Item = GetFirstChild(Root, Cookie);

	while( Item.IsOk() )
	{
		Update_Source(Item);

		Item	= GetNextChild(Item, Cookie);
	}

	//-----------------------------------------------------
	CSG_Table	Connections;

	RUN_MODULE(DB_PGSQL_Get_Connections, false, SET_PARAMETER("CONNECTIONS", &Connections));	// CGet_Connections

	for(int i=0; i<Connections.Get_Count(); i++)
	{
		if( !Find_Source(Connections[i].asString(0)) )
		{
			Update_Source(Connections[i].asString(0));
		}
	}

	//-----------------------------------------------------
	SortChildren(Root);
	Expand      (Root);

	Thaw();
}
Exemplo n.º 19
0
/**
 * Method used to draw the box around a specified node
 * 
 * @param id    The node that needs the box
 */
void DecoratedTree::DrawOutline(wxTreeItemId id)
{
    // Add the new decorations
    wxRect bound;
    int w, h;
    bool visible;
    wxTreeItemIdValue cookie;
    wxTreeItemId current = GetFirstChild(id, cookie);
    
    GetSize(&w, &h);
    wxClientDC dc(this);

    //wxWidgets-2.6.3:deprecated->dc.BeginDrawing();
    
    while (current > (wxTreeItemId)0) {
        visible = GetBoundingRect(current, bound, TRUE);
        dc.SetPen(wxPen(wxColour(0xaf, 0xaf, 0xaf), 1, wxSOLID));

        // Top and bottom
        dc.DrawLine(bound.x, bound.y-1, w-offset, bound.y-1);
        dc.DrawLine(bound.x, bound.y+rowHeight+1, w-offset, bound.y+rowHeight+1);
        dc.DrawLine(bound.x, bound.y-1, bound.x, bound.y+rowHeight+1);
        dc.DrawLine(w-offset, bound.y+1, w-offset, bound.y+rowHeight+1);

//          dc.DrawLine(4, bound.y-1, w-20, bound.y-1);
//          dc.DrawLine(4, bound.y+rowHeight+1, w-20, bound.y+rowHeight+1);
//          dc.DrawLine(4, bound.y-1, 4, bound.y+rowHeight+1);
//          dc.DrawLine(w-20, bound.y+1, w-20, bound.y+rowHeight+1);
        
        DrawOutline(current);
        current = GetNextChild(id, cookie);
    }
    
    //wxWidgets-2.6.3:deprecated->dc.EndDrawing();
}
Exemplo n.º 20
0
void gxSceneNode::Update()
{
	for(gxSceneNode * child = GetFirstChild(); child != NULL; child = GetNextChild(child))
	{
		child->Update();
	}
}
Exemplo n.º 21
0
nuiRect nuiZoomView::CalcIdealSize()
{
  nuiRect rect;

  nuiSize HorizontalZoomLevel = mHorizontalZoomLevel; 
  nuiSize VerticalZoomLevel = mVerticalZoomLevel;

  if (mpVerticalSlider)
    VerticalZoomLevel = mpVerticalSlider->GetRange().GetValue();
  if (mpHorizontalSlider)
    HorizontalZoomLevel = mpHorizontalSlider->GetRange().GetValue();


  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    nuiRect itemRect = pItem->GetIdealRect();
    itemRect.SetSize(itemRect.GetWidth() * HorizontalZoomLevel, itemRect.GetHeight() * VerticalZoomLevel);
    rect.Union(rect, itemRect); 
  }
  delete pIt;

  rect.mLeft = 0;
  rect.mTop = 0;

  mIdealRect = rect;
  return mIdealRect;
}
Exemplo n.º 22
0
bool nuiScrollView::Draw(nuiDrawContext* pContext)
{
  nuiSize scrollv = (mpVertical->IsVisible() && !mForceNoVertical && !mVerticalIsExternal)?mBarSize:0;
  nuiSize scrollh = (mpHorizontal->IsVisible() && !mForceNoHorizontal && !mHorizontalIsExternal)?mBarSize:0;
  nuiRect rect(0.0f,0.0f,mRect.GetWidth()-scrollv, mRect.GetHeight()-scrollh);

  IteratorPtr pIt;
  for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
  {
    nuiWidgetPtr pItem = pIt->GetWidget();
    nuiRect intersect;
    if (intersect.Intersect(rect, pItem->GetOverDrawRect(true, true)))
    {
      DrawChild(pContext, pItem);
    }
  }

  delete pIt;

  if (GetDebug())
  {
    pContext->SetStrokeColor(nuiColor("red"));
    pContext->DrawRect(GetRect().Size(), eStrokeShape);
    pContext->SetStrokeColor(nuiColor("blue"));
    pContext->DrawRect(GetIdealRect().Size(), eStrokeShape);
    pContext->SetStrokeColor("yellow");
    float h = GetRect().GetHeight() - scrollh - 1;
    pContext->DrawLine(0, h, GetRect().GetWidth(), h);
  }
  return true;
}
Exemplo n.º 23
0
void CLocalTreeView::OnVolumesEnumerated(wxCommandEvent& event)
{
	if (!m_pVolumeEnumeratorThread)
		return;

	std::list<CVolumeDescriptionEnumeratorThread::t_VolumeInfo> volumeInfo;
	volumeInfo = m_pVolumeEnumeratorThread->GetVolumes();

	if (event.GetEventType() == fzEVT_VOLUMESENUMERATED)
	{
		delete m_pVolumeEnumeratorThread;
		m_pVolumeEnumeratorThread = 0;
	}

	for (std::list<CVolumeDescriptionEnumeratorThread::t_VolumeInfo>::const_iterator iter = volumeInfo.begin(); iter != volumeInfo.end(); iter++)
	{
		wxString drive = iter->volume;

		wxTreeItemIdValue tmp;
		wxTreeItemId item = GetFirstChild(m_drives, tmp);
		while (item)
		{
			wxString name = GetItemText(item);
			if (name == drive || name.Left(drive.Len() + 1) == drive + _T(" "))
			{
				SetItemText(item, drive + _T(" (") + iter->volumeName + _T(")"));
				break;
			}
			item = GetNextChild(m_drives, tmp);
		}
	}
}
Exemplo n.º 24
0
wxTreeItemId SessionTreeControl::findSession( wxTreeItemId root,
                                                std::string address )
{
    wxTreeItemIdValue temp; // unused var, needed in getchild
    wxTreeItemId targetItem;
    wxTreeItemId current = GetFirstChild( root, temp );

    while ( current.IsOk() )
    {
        wxString text = GetItemText( current );
        std::string target = std::string( text.char_str() );
        if ( target.compare( address ) == 0 )
            return current;

        if ( ItemHasChildren( current ) )
        {
            targetItem = findSession( current, address );
            if ( targetItem.IsOk() )
                return targetItem;
        }
        current = GetNextChild( root, temp );
    }

    wxTreeItemId none;
    return none; // return default value if not found
}
Exemplo n.º 25
0
bool               P3DPlantModelTreeCtrl::FindItemByModel
                                      (wxTreeItemId       *FoundItemId,
                                       wxTreeItemId        RootId,
                                       const P3DBranchModel
                                                          *BranchModel) const
 {
  wxTreeItemId                         ChildId;
  #if wxCHECK_VERSION(2,8,0)
  wxTreeItemIdValue                    Cookie;
  #else
  long                                 Cookie;
  #endif

  if (((P3DPlantModelTreeCtrlItemData*)(GetItemData(RootId)))->GetBranchModel()
       == BranchModel)
   {
    *FoundItemId = RootId;

    return(true);
   }

  ChildId = GetFirstChild(RootId,Cookie);

  while (ChildId.IsOk())
   {
    if (FindItemByModel(FoundItemId,ChildId,BranchModel))
     {
      return(true);
     }

    ChildId = GetNextChild(RootId,Cookie);
   }

  return(false);
 }
Exemplo n.º 26
0
//---------------------------------------------------------
void CACTIVE_History::_Expand(wxTreeItemId Node, const wxString &Name, bool bExpand)
{
	if( !GetItemText(Node).Cmp(Name) )
	{
		if( bExpand )
		{
			Expand(Node);
		}
		else
		{
			Collapse(Node);
		}
	}
	else
	{
		wxTreeItemIdValue	Cookie;

		wxTreeItemId	Child	= GetFirstChild(Node, Cookie);

		while( Child.IsOk() )
		{
			_Expand(Child, Name, bExpand);

			Child	= GetNextChild(Node, Cookie);
		}
	}
}
Exemplo n.º 27
0
RealDTEntry
FindChild(RealDTEntry cur, CHAR8 *buf)
{
	RealDTEntry	child;
	UINT32      index;
	CHAR8*			str;
	UINT32      dummy;

	if (cur->nChildren == 0) {
		return NULL;
	}
	index = 1;
	child = GetFirstChild(cur);
	while (1) {
		if (DTGetProperty(child, "name", (VOID **)&str, &dummy) != kSuccess) {
			break;
		}
		if (AsciiStrCmp((CHAR8*)str, (CHAR8*)buf) == 0) {
			return child;
		}
		if (index >= cur->nChildren) {
			break;
		}
		child = GetNextChild(child);
		index++;
	}
	return NULL;
}
Exemplo n.º 28
0
bool
AllChildrenIterator::Seek(nsIContent* aChildToFind)
{
  if (mPhase == eAtBegin || mPhase == eAtBeforeKid) {
    mPhase = eAtExplicitKids;
    nsIFrame* frame = mOriginalContent->GetPrimaryFrame();
    if (frame) {
      nsIFrame* beforeFrame = nsLayoutUtils::GetBeforeFrame(frame);
      if (beforeFrame) {
        if (beforeFrame->GetContent() == aChildToFind) {
          mPhase = eAtBeforeKid;
          return true;
        }
      }
    }
  }

  if (mPhase == eAtExplicitKids) {
    if (ExplicitChildIterator::Seek(aChildToFind)) {
      return true;
    }
    mPhase = eAtAnonKids;
  }

  nsIContent* child = nullptr;
  do {
    child = GetNextChild();
  } while (child && child != aChildToFind);

  return child == aChildToFind;
}
Exemplo n.º 29
0
wxTreeItemId PHPFileLayoutTree::RecurseSearch(const wxTreeItemId& item, const wxString& word)
{
    if(!item.IsOk()) return wxTreeItemId();

    if(item != GetRootItem()) {
        wxString curtext = GetItemText(item);
        curtext.MakeLower();

        if(curtext.StartsWith(word)) {
            return item;
        }
    }

    if(ItemHasChildren(item)) {
        wxTreeItemIdValue cookie;
        wxTreeItemId child = GetFirstChild(item, cookie);
        while(child.IsOk()) {
            wxTreeItemId selection = RecurseSearch(child, word);
            if(selection.IsOk()) {
                return selection;
            }
            child = GetNextChild(item, cookie);
        }
    }
    return wxTreeItemId();
}
Exemplo n.º 30
0
void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item)
{
    Freeze();
    // expand this item first, this might result in its children being added on
    // the fly
    if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
        Expand(item);
    //else: expanding hidden root item is unsupported and unnecessary

    // then (recursively) expand all the children
    wxTreeItemIdValue cookie;
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
    for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
          idCurr.IsOk();
          idCurr = GetNextChild(item, cookie) )
    {
        ExpandAllChildren(idCurr);
    }
    Thaw();
}