Refresh na TreeView

Refresh na TreeView

Postby ctoas » Tue Dec 03, 2013 10:57 am

Como Refrescar a TreeView ???

Code: Select all  Expand view

********************************************************************************
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
MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
ctoas
 
Posts: 39
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil

Re: Refresh na TreeView

Postby Euclides » Sun Dec 08, 2013 4:23 pm

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
User avatar
Euclides
 
Posts: 120
Joined: Wed Mar 28, 2007 1:19 pm


Return to All products support

Who is online

Users browsing this forum: No registered users and 1 guest

cron