Treeview class question?

Treeview class question?

Postby dutch » 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 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Treeview class question?

Postby dutch » Wed Mar 07, 2012 4: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 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: Treeview class question?

Postby Antonio Linares » 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: Select all  Expand view
#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  


Image
regards, saludos

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

Re: Treeview class question?

Postby dutch » Sat Mar 10, 2012 3:41 pm

Dear Antonio,

Thanks, your example is enough for my app.

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

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