Refresh na TreeView

Post Reply
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Refresh na TreeView

Post by ctoas »

Como Refrescar a TreeView ???

Code: Select all

********************************************************************************
STATIC FUNCTION TESTE()
********************************************************************************

    STATIC oTREE

    DEFINE DIALOG oDlg RESOURCE "CAD"

        oTree := TTreeView():Redefine( 4024, oDlgNOVOUSUARIO )

        REDEFINE BUTTONBMP oBtn ID 4025 OF oDlg ACTION ATUALIZATREE(oTree)

   ACTIVATE DIALOG oDlg CENTERED ON INIT MONTATREE( oTree )

RETURN NIL


********************************************************************************
FUNCTION MONTATREE( oTree )
********************************************************************************

   oITEM[01]:= oTREE:ADD( "ITEM1" )
        oSUBITEM[01]:=oITEM[01]:ADD( "ITEM1A" )
      oSUBITEM[02]:=oITEM[01]:ADD( "ITEM1B" )
    oSUBITEM[03]:=oITEM[01]:ADD( "ITEM1C" )
    oSUBITEM[04]:=oITEM[01]:ADD( "ITEM1D" )

   oITEM[02]:= oTREE:ADD( "ITEM2" )
        oSUBITEM[05]:=oITEM[02]:ADD( "ITEM2A" )
      oSUBITEM[06]:=oITEM[02]:ADD( "ITEM2B" )
    oSUBITEM[07]:=oITEM[02]:ADD( "ITEM2C" )
    oSUBITEM[08]:=oITEM[02]:ADD( "ITEM2D" )

    oTREE:EXPAND()

RETURN NIL

********************************************************************************
FUNCTION ATUALIZATREE(oTree)
********************************************************************************

   oITEM[01]:SETCHECK(.T.)
    oSUBITEM[01]:SETCHECK(.T.)
   oSUBITEM[02]:SETCHECK(.T.)
    oSUBITEM[03]:SETCHECK(.T.)
    oSUBITEM[04]:SETCHECK(.T.)

   oITEM[02]:SETCHECK(.T.)
    oSUBITEM[05]:SETCHECK(.T.)
   oSUBITEM[06]:SETCHECK(.T.)
    oSUBITEM[07]:SETCHECK(.T.)
    oSUBITEM[08]:SETCHECK(.T.)

  oTree:REFRESH() //<--- não existe ???
   
RETURN NIL
 
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
Euclides
Posts: 144
Joined: Wed Mar 28, 2007 1:19 pm

Re: Refresh na TreeView

Post by Euclides »

Olá,
Definindo como "local" as variéveis oTree, oItem, oSubItem em Teste()...
Passando os parametros (oTree, oItem, oSubItem) para as funções MontaTree e AtaualizaTree a rotina funciona.
(pelomenos, faz "check" nos itens quando o tree é clicado)
T+
Euclides
Post Reply