Luiz Fernando Posted November 16, 2022 Report Share Posted November 16, 2022 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 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted November 17, 2022 Report Share Posted November 17, 2022 Tente assim: oTree:GoTop() oTree:Select( oItem:aItems[ 1 ] ) Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted November 17, 2022 Author Report Share Posted November 17, 2022 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.