FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour problemas con END() en el nodo raiz de un tree
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
problemas con END() en el nodo raiz de un tree
Posted: Fri Aug 11, 2023 02: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/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: problemas con END() en el nodo raiz de un tree
Posted: Sat Aug 12, 2023 05:56 AM
Estimado Gustavo,

Tienes que modificar el método End() en source\classes\TTVITEM.PRG de esta manera:
Code (fw): Select all Collapse
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
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: problemas con END() en el nodo raiz de un tree
Posted: Sat Aug 12, 2023 06:53 AM
Antonio Linares wrote:Estimado Gustavo,

Tienes que modificar el método End() en source\classes\TTVITEM.PRG de esta manera:
Code (fw): Select all Collapse
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/

Continue the discussion