FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Treeview class question?
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Treeview class question?
Posted: Tue Mar 06, 2012 10:16 PM

Dear All,

I've a few question with TTreeview class with DIALOG.

  1. How can I know the nLevel when click?
  2. Can I add bAction on Treelists?
  3. How do I identify on click in Expand (+) or click treelists?
  4. oItem1:Add( "xBase & OOPS", 1, {|| Test1( oDlg ) } ) Does it work with DIALOG?

Thanks for any help

Regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Treeview class question?
Posted: Wed Mar 07, 2012 04:30 PM

Dear Antonio,

I've tried as Testtre2.prg....Testtre5.prg

  1. TTreeview has no nLevel as TTreeItem. How can I do?
  2. I use ::OnClick method but it will effect all click.
  3. It doesn't action anything when I use as Number 4 in TDIALOG. Does it work on WINDOW only?
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Treeview class question?
Posted: Thu Mar 08, 2012 12:00 PM
Dutch,

Here you have a working example, please let me know if you need something else, thanks :-)

TreeView example
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oTrv
   
   DEFINE DIALOG oDlg TITLE "Preferences" SIZE 500, 400
   
   @ 0, 0 TREEVIEW oTrv OF oDlg SIZE 80, 300 ;
      ON CHANGE oDlg:SetText( oTrv:GetSelected():cPrompt + ", " + ;
                              AllTrim( Str( oTrv:GetSelected():ItemLevel() + 1 ) ) )

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oTrv:nHeight := oDlg:nHeight, BuildPreferencesTree( oTrv ) )

return nil

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

function BuildPreferencesTree( oTree )

   local oItem, oItem2

   oItem = oTree:Add( "Editor" )
   
   oItem2 = oItem:Add( "Colors" )
      oItem2:Add( "Strings" )
      oItem2:Add( "Numbers" )
      oItem2:Add( "Comments" )
   
   oItem:Add( "Spaces" ) 
   
   oItem = oTree:Add( "Compiler" )
      oItem:Add( "Path" )
      oItem:Add( "Libraries" )
   
   oTree:ExpandAll()
   
return nil


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Treeview class question?
Posted: Sat Mar 10, 2012 03:41 PM

Dear Antonio,

Thanks, your example is enough for my app.

Regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion