Jump to content
Fivewin Brasil

Ajuda com Tree (RESOLVIDO)


Luiz Fernando

Recommended Posts

Pessoal como faço para atualizar uma tree

na função mostra_tree é aonde adiciono ou excluo um item da tree, mais preciso sair da janela e entrar novamente para ver o resultado

tentei com oTree:refresh() mais não da certo

 

  DEFINE DIALOG oplanod RESOURCE"PLANO1_D"

    oTree := TTreeView():Redefine( 170, oplanod  )
    oTree:nClrPane:= nRGB( 219, 230, 244 ) 
    oTree:oFont:=Couriern8
    oTree:BLDBLClick = { | nRow, nCol, nKeyFlags | mostra_tree( nRow, nCol, oTree, oplanod,@aplanod,@wTarefa,oGet,oBtn ) }

  ACTIVATE DIALOG oplanod CENTER ON INIT (BuildTree( oTree ) 


function mostra_tree(nRow, nCol, oTree, oplanod,aplanod,wTarefa,oGet,oBtn)
  local oPopup, oFont
  oItem := oTree:HitTest( nRow, nCol )
  if oItem = nil
     return .t.
  endif
  MENU oPopup POPUP 2007
    //MENUITEM "Incluir nova conta" action novo(@aplanod,oplanod,@wTarefa,oGet,oBtn,2,oItem:Cargo)
    MENUITEM "Alterar conta selecionada" action editar(@aplanod,oplanod,@wTarefa,oGet,oBtn,2,oItem:Cargo) 
    MENUITEM "Excluir conta selecionada" action excluir(@aplanod,oplanod,@wTarefa,oGet,oBtn,2,oItem:Cargo,oTree)
    SEPARATOR
    MENUITEM "Incluir conta 1 Grau" action novo(@aplanod,oplanod,@wTarefa,oGet,oBtn,3,oItem:Cargo)
    MENUITEM "Incluir conta 2 Grau" action novo(@aplanod,oplanod,@wTarefa,oGet,oBtn,4,oItem:Cargo)
    MENUITEM "Incluir conta 3 Grau" action novo(@aplanod,oplanod,@wTarefa,oGet,oBtn,5,oItem:Cargo)
  ENDMENU

  ACTIVATE POPUP oPopup OF oPlanod AT nRow, nCol
return nil

 

obg

Link to comment
Share on other sites

1 hora atrás, kapiaba disse:

Tente assim:

oTree:GoTop()


oTree:Select( oItem:aItems[ 1 ] )

Kapiaba obg pelo retorno, mais não deu certo, eu tinha que saber como executar novamente o

ACTIVATE DIALOG oplanod CENTER ON INIT (BuildTree( oTree ) 

 pq se dentro da dialog eu conseguir executar esse ON INIT novamente, o problema estara resolvido

 

Obs: nossa na verdade é só usar BuildTree ( oTree ) aonde eu quiser atualizar, não acredito que solução estava tão simples assim rsrs, resolvido 

Obg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...