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

Post Reply
User avatar
Alexandre Oliveira
Posts: 10
Joined: Mon Sep 29, 2008 1:06 pm
Location: Brasil

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

Post 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 
Alexandre Oliveira
FHW 8.11 + xHarbour
User avatar
JC
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil
Contact:

Post by JC »

Alexandre,

Try this:

Code: Select all

TVGetCheck( oTree:hWnd, oItem:hItem )
TVSetCheck( oTree:hWnd, oItem:hItem, lOnOff )
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
User avatar
Alexandre Oliveira
Posts: 10
Joined: Mon Sep 29, 2008 1:06 pm
Location: Brasil

TREE does not work!

Post 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. )

Alexandre Oliveira
FHW 8.11 + xHarbour
Post Reply