problemas con END() en el nodo raiz de un tree

problemas con END() en el nodo raiz de un tree

Postby goosfancito » Fri Aug 11, 2023 2:32 pm

Hola.
Voy agregando ramas al arbol, y puedo eliminar todas ellas sin problemas (una por una como quiero) pero al querer eliminar el "nodo" me tira error, me dice
Error description: Error BASE/1004 No existe el método: AITEMS
Args:
[ 1] = U

Stack Calls
===========
Called from: => AITEMS( 0 )
Called from: .\source\classes\TTVITEM.PRG => TTVITEM:END( 166 )


que puede estar pasando?
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: problemas con END() en el nodo raiz de un tree

Postby Antonio Linares » Sat Aug 12, 2023 5:56 am

Estimado Gustavo,

Tienes que modificar el método End() en source\classes\TTVITEM.PRG de esta manera:
Code: Select all  Expand view
METHOD End() CLASS TTVItem

   local nAt := 0

   if ! Empty( ::oParent )
      nAt := AScan( ::oParent:aItems, { | o | o == Self } )
   endif

   if nAt != 0
      if ::oParent:IsKindOf( "TTREEVIEW" )
         ADel( ::oTree:aItems, nAt )
         ASize( ::oTree:aItems, Len( ::oTree:aItems ) - 1 )
      else
         ADel( ::oParent:aItems, nAt )
         ASize( ::oParent:aItems, Len( ::oParent:aItems ) - 1 )
      endif
   endif

   TVDeleteItem( ::oTree:hWnd, ::hItem )

return nil
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: problemas con END() en el nodo raiz de un tree

Postby goosfancito » Sat Aug 12, 2023 6:53 am

Antonio Linares wrote:Estimado Gustavo,

Tienes que modificar el método End() en source\classes\TTVITEM.PRG de esta manera:
Code: Select all  Expand view
METHOD End() CLASS TTVItem

   local nAt := 0

   if ! Empty( ::oParent )
      nAt := AScan( ::oParent:aItems, { | o | o == Self } )
   endif

   if nAt != 0
      if ::oParent:IsKindOf( "TTREEVIEW" )
         ADel( ::oTree:aItems, nAt )
         ASize( ::oTree:aItems, Len( ::oTree:aItems ) - 1 )
      else
         ADel( ::oParent:aItems, nAt )
         ASize( ::oParent:aItems, Len( ::oParent:aItems ) - 1 )
      endif
   endif

   TVDeleteItem( ::oTree:hWnd, ::hItem )

return nil
 


Anda Perfecto! gracias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 55 guests