Page 1 of 1

TREE -> oSubMenu[ 1 ]:SetCheck( .T. ) does not work!

Posted: Thu Dec 18, 2008 5:45 pm
by Alexandre Oliveira
Because the item "Imprimir..." the TREE not appear with the check?

Image

Code: Select all

#include "FiveWin.ch"

function Main()

   local oDlg, oTree 

   DEFINE DIALOG oDlg

   @ 0, 0 TREEVIEW oTree OF oDlg SIZE 200, 200 CHECKBOXES

   ACTIVATE DIALOG oDlg CENTERED ON INIT BuildTree( oTree ) 

   MsgInfo( oTree:aItems[ 1 ]:GetCheck() ) 

return nil 

function BuildTree( oTree ) 

   local oMenu := Array( 2 ), oSubMenu := Array( 3 ) 

   oMenu[ 1 ]:= oTree:Add( "Principal" ) 
      oSubMenu[ 1 ]:= oMenu[ 1 ]:Add( "Imprimir..." )
      oSubMenu[ 1 ]:SetCheck( .T. ) 

   oMenu[ 2 ]:= oTree:Add( "Proyectos" ) 
      oSubMenu[ 2 ]:= oMenu[ 2 ]:Add( "Definir Proyectos" ) 
      oSubmenu[ 3 ]:= oMenu[ 2 ]:Add( "ActualizaciĆ³n datos" ) 

   oTree:Expand() 

return nil 

Posted: Thu Dec 18, 2008 8:51 pm
by JC
Alexandre,

Try this:

Code: Select all

TVGetCheck( oTree:hWnd, oItem:hItem )
TVSetCheck( oTree:hWnd, oItem:hItem, lOnOff )

TREE does not work!

Posted: Fri Dec 19, 2008 12:05 pm
by Alexandre Oliveira
JC,

grateful for the help, but it did not work.

Code: Select all

  //oSubMenu[ 1 ]:SetCheck( .T. ) 
   TVSetCheck( oTree:hWnd, oSubMenu[1]:hItem, .t. )