Cara, consegui fazer.. coloquei os 8 elementos lá... segue como eu fiz:

type
 PtvItensPrincipais = ^TtvItensPrincipais;
 TtvItensPrincipais = record
  Texto: string[30];
  ImageIdx: integer;
 end;


procedure TFrmPrincipal.tvProjetoInitNode(Sender: TBaseVirtualTree;
 ParentNode, Node: PVirtualNode;
 var InitialStates: TVirtualNodeInitStates);
var
 DadosPri: PtvItensPrincipais;
 Level: integer;
begin
//==============================================================================
//=  Monto a estrutura da TreeList
//==============================================================================

 DadosPri := Sender.GetNodeData(Node);
 if not Assigned(DadosPri) then Exit;

 Level := Sender.GetNodeLevel(Node);

 with DadosPri^ do
 begin
  if Level = 0 then
  begin
   Texto := 'Projeto de TESTE';
   ImageIdx := 0;
  end
  else
  begin
   case Node.Index of
    0:
     begin
      Texto := 'Propriedades do Projeto';
      ImageIdx := 8;
     end;
    1:
     begin
      Texto := 'Requisitos';
      ImageIdx := 1;
     end;
    2:
     begin
      Texto := 'Erros (Bugs)';
      ImageIdx := 10;
     end;
    3:
     begin
      Texto := 'Validações';
      ImageIdx := 6;
     end;
    4:
     begin
      Texto := 'Fórum de Discussão';
      ImageIdx := 5;
     end;
    5:
     begin
      Texto := 'Rastreabilidade';
      ImageIdx := 3;
     end;
    6:
     begin
      Texto := 'Histórico';
      ImageIdx := 2;
     end;
    7:
     begin
      Texto := 'Aprovações';
      ImageIdx := 7;
     end;
   end;
  end;
 end;
end;


procedure TFrmPrincipal.tvProjetoGetText(Sender: TBaseVirtualTree;
 Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
 var CellText: WideString);
var
 DadosPri: PtvItensPrincipais;
begin
 DadosPri := Sender.GetNodeData(Node);
 if Assigned(DadosPri) then
  with DadosPri^ do
  begin
   CellText := Texto;
  end;
end;

procedure TFrmPrincipal.tvProjetoGetImageIndex(Sender: TBaseVirtualTree;
 Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
 var Ghosted: Boolean; var ImageIndex: Integer);
var
 DadosPri: PtvItensPrincipais;
begin
 DadosPri := Sender.GetNodeData(Node);
 ImageIndex := DadosPri.ImageIdx;
end;



Só que tem um probleminha.. ao fazer isso, blz.. jogou lá meus 8 filhos..
com as imagens blz.. soh que simplemente nao sei porque algumas imagens, a
imagem do root fica sobreposta a ela.. ou seja... alguns filhos ficam com a
imagem perfeita, outros ficam com as imagens deles, mas com a do root em
cima...

Estranho...


To fazendo algo errado?


[]s


[As partes desta mensagem que não continham texto foram removidas]



-- 
<<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>>

<*> Para ver as mensagens antigas, acesse:
    http://br.groups.yahoo.com/group/delphi-br/messages

<*> Para falar com o moderador, envie um e-mail para:
    [EMAIL PROTECTED]
 
Links do Yahoo! Grupos

<*> Para visitar o site do seu grupo na web, acesse:
    http://br.groups.yahoo.com/group/delphi-br/

<*> Para sair deste grupo, envie um e-mail para:
    [EMAIL PROTECTED]

<*> O uso que você faz do Yahoo! Grupos está sujeito aos:
    http://br.yahoo.com/info/utos.html

 


Responder a