Error in TTreeView

Error in TTreeView

Postby Enrico Maria Giordano » Mon Dec 04, 2006 2:50 pm

ScanItem must be ScanItems:

Code: Select all  Expand view
METHOD GetSelected() CLASS TTreeView

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

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

METHOD GetItem( hItem ) CLASS TTreeView

return ScanItem( ::aItems, hItem )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error in TTreeView

Postby Enrico Maria Giordano » Mon Dec 04, 2006 4:03 pm

No, it is not enough. Please look at

Code: Select all  Expand view
static function ScanItems( aItems, lExpand, lToggle )


and at

Code: Select all  Expand view
return ScanItems( ::aItems, TVGetSelected( ::hWnd ) )


and

Code: Select all  Expand view
return ScanItems( ::aItems, hItem )


It seems that the second parameter has to be logical.

What am I missing?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Error in TTreeView

Postby Enrico Maria Giordano » Mon Dec 04, 2006 4:08 pm

Found! It seems that ScanItem() function is missing from the latest TTreeView:

Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Dec 05, 2006 4: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:
Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby hua » Fri Dec 08, 2006 9:29 am

After applying the instructions here, I tried compiling and running testtre2.prg in \Samples. This is what I got:

Image

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
hua
 
Posts: 1070
Joined: Fri Oct 28, 2005 2:27 am

Postby Antonio Linares » Fri Dec 08, 2006 10:02 am

Hua,

See how it looks here:
Image
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
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » 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"
Image
regards, saludos

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

Postby hua » Fri Dec 08, 2006 8:38 pm

thanks Antonio! that did the trick
hua
 
Posts: 1070
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 57 guests