예제 #1
0
파일: FSMap.cpp 프로젝트: Sethis/FSMapWin32
cFSNode *FileSystem::MapDirectory(const std::wstring &root, const std::wstring &filters, int max_levels)
{
    if(max_levels <= 0)
        return NULL;

    cFSNode *node = new cFSNode(root, ENodeType::Directory, NULL);
    ExpandNode(node, max_levels);

    std::vector<std::wstring> extracted_filters;
    ExtractFilters(filters, extracted_filters);

    if(extracted_filters.size() > 0)
        node->ApplyFileFilters(extracted_filters);

    return node;
}
BOOL COXNetBrowseTree::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
	BOOL bEaten = FALSE;
	*pResult = 0;

	// If expanding and not yet expanded once : expand now
	if (	(	(pNMTreeView->action == TVE_EXPAND)  || 
		((pNMTreeView->action == TVE_TOGGLE) && 
		((pNMTreeView->itemNew.state & TVIS_EXPANDED) != 0)) ) &&
		((pNMTreeView->itemNew.state & TVIS_EXPANDEDONCE) == 0) )
	{
		ExpandNode(pNMTreeView->itemNew.hItem);
	}
	return bEaten;
}
예제 #3
0
bool EventBrowser::SelectEvent(uint32_t eventID)
{
  if(!m_Core->LogLoaded())
    return false;

  QTreeWidgetItem *found = NULL;
  FindEventNode(found, ui->events->topLevelItem(0), eventID);
  if(found != NULL)
  {
    ui->events->clearSelection();
    ui->events->setItemSelected(found, true);
    ui->events->setCurrentItem(found);

    ExpandNode(found);
    return true;
  }

  return false;
}
BOOL COXNetBrowseTree::BuildTreeContents()
{

	SetRedraw(FALSE);

	// If the tree till contains nodes, remove them all
	DeleteAllItems();

	// Cleanup data members
	Cleanup();

	// Create the root node
	if (0 < m_nMaxNumLevels)
		ExpandNode(NULL);

	// Expand all top level items
	HTREEITEM hTopItem = NULL;
	hTopItem = GetRootItem();
	while (hTopItem != NULL)
	{
		ExpandBranch(hTopItem, m_nInitialExpandLevel);
		hTopItem = GetNextSiblingItem(hTopItem);
	}

	// If at least one top level item is expandable, connect lines to 
	// the root of the control otherwise do not
	BOOL bLinesAtRoot = FALSE;
	hTopItem = GetRootItem();
	while(!bLinesAtRoot && (hTopItem  != NULL))
	{
		bLinesAtRoot = ItemHasChildren(hTopItem);
		hTopItem = GetNextSiblingItem(hTopItem);
	}
	if (bLinesAtRoot)
		ModifyStyle(0, TVS_LINESATROOT /* add */);
	else
		ModifyStyle(TVS_LINESATROOT /* remove */, 0);

	SetRedraw(TRUE);

	return TRUE;
}
예제 #5
0
NS_IMETHODIMP
inDOMView::ToggleOpenState(PRInt32 index)
{
  inDOMViewNode* node = nsnull;
  RowToNode(index, &node);
  if (!node) return NS_ERROR_FAILURE;

  PRInt32 oldCount = GetRowCount();
  if (node->isOpen)
    CollapseNode(index);
  else
    ExpandNode(index);

  // Update the twisty.
  mTree->InvalidateRow(index);

  mTree->RowCountChanged(index+1, GetRowCount() - oldCount);

  return NS_OK;
}
예제 #6
0
파일: code.c 프로젝트: CEKrause/WRFV_3.7.1
int ExpandNode( NODE *n, int lastop )
{
int needParen = 0;

  if( n == 0 ) return lastop;

  if( ( n->left ) &&
      ( PRI[ n->left->type ] < PRI[ n->type ] ) )
      needParen = 1;

  if( needParen ) {
    WriteOp( crtop );
    WriteSymbol( O_PAREN );
  }
  lastop = ExpandNode( n->left, lastop );
  if( needParen ) WriteSymbol( C_PAREN );

  switch( n->type ) {
    case ADD:  
    case SUB:   
    case MUL:   
    case DIV:   
    case POW:   crtop = n->type;
                break;
    case NONE:  printf("ERROR - null element"); 
    		break;
    case CONST: 
    case ELM:
    case VELM:
    case MELM:
    case EELM:
		switch( crtop ) {
		  case MUL: case DIV: case POW:
		    WriteOp( crtop );
		    if ( n->sign == -1 ) {
		      WriteSymbol( O_PAREN );
		      WriteOp( SUB );
		      ExpandElm( n );
		      WriteSymbol( C_PAREN );
		    } else {
		      ExpandElm( n );
		    }
		    break;
		  case ADD:  if( n->sign == -1 )
			       crtop = SUB;
			     WriteOp( crtop );
			     ExpandElm( n );
			     break;
		  case SUB:  if( n->sign == -1 )
			       crtop = ADD;
			     WriteOp( crtop );
			     ExpandElm( n );
			     break;
		  case NONE: if( n->sign == -1 )
			       WriteOp( SUB );
			     ExpandElm( n );
			     break;
		}
		break;
  }

  if( ( n->right ) &&
      ( PRI[ n->right->type ] <= PRI[ n->type ] ) )
      needParen = 1; 

  if( needParen ) {
    WriteOp( crtop );
    WriteSymbol( O_PAREN );
  }  
  lastop = ExpandNode( n->right, n->type );
  if( needParen ) WriteSymbol( C_PAREN );
  return lastop;
}
예제 #7
0
파일: code.c 프로젝트: CEKrause/WRFV_3.7.1
void WriteNode( NODE *n )
{
  crtop = NONE;
  ExpandNode( n, NONE );
}