FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error in TTreeView
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Error in TTreeView
Posted: Mon Dec 04, 2006 02:50 PM
ScanItem must be ScanItems:

METHOD GetSelected() CLASS TTreeView

return ScanItem( ::aItems, TVGetSelected( ::hWnd ) )

//----------------------------------------------------------------------------//

METHOD GetItem( hItem ) CLASS TTreeView

return ScanItem( ::aItems, hItem )


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Error in TTreeView
Posted: Mon Dec 04, 2006 04:03 PM
No, it is not enough. Please look at

static function ScanItems( aItems, lExpand, lToggle )


and at

return ScanItems( ::aItems, TVGetSelected( ::hWnd ) )


and

return ScanItems( ::aItems, hItem )


It seems that the second parameter has to be logical.

What am I missing?

EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Error in TTreeView
Posted: Mon Dec 04, 2006 04:08 PM
Found! It seems that ScanItem() function is missing from the latest TTreeView:

static function ScanItem( aItems, hItem )

   local n, oItem

   for n = 1 to Len( aItems )
      if Len( aItems[ n ]:aItems ) > 0
         if ( oItem := ScanItem( aItems[ n ]:aItems, hItem ) ) != nil
            return oItem
         endif
      endif
      if aItems[ n ]:hItem == hItem
         return aItems[ n ]
      endif
   next

return nil


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Error in TTreeView
Posted: Tue Dec 05, 2006 04:34 AM
Enrico,

Yes, you are right, thanks! We accepted some Class modifications and they broke the code. Lets use different names to avoid conflicts:
METHOD GetSelected() CLASS TTreeView

return SearchItem( ::aItems, TVGetSelected( ::hWnd ) )

//----------------------------------------------------------------------------//

METHOD GetItem( hItem ) CLASS TTreeView

return SearchItem( ::aItems, hItem )

//----------------------------------------------------------------------------//

static function SearchItem( aItems, hItem ) 

...

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Error in TTreeView
Posted: Fri Dec 08, 2006 09:29 AM
After applying the instructions here, I tried compiling and running testtre2.prg in \Samples. This is what I got:



Correct me if I'm mistaken but isn't the +/- sign is missing? Shouldn't there be texts to the right of the all 3 folder images?

Thanks.
--
xHB 0.99.61 FWHX2.8 Nov BCC55 Win98SE
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Error in TTreeView
Posted: Fri Dec 08, 2006 10:02 AM
Hua,

See how it looks here:

Though we use gray for the window color. Probably you don't see the text cause is painted in white color. Lets see how to change it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Error in TTreeView
Posted: Fri Dec 08, 2006 10:12 AM
Hua,

Make this change in samples\TestTre2.prg:

DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 ;
TITLE "Welcome to " + FWVERSION COLOR "N/W"
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Error in TTreeView
Posted: Fri Dec 08, 2006 08:38 PM

thanks Antonio! that did the trick

FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion