FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TREE -> oSubMenu[ 1 ]:SetCheck( .T. ) does not work!
Posts: 10
Joined: Mon Sep 29, 2008 01:06 PM
TREE -> oSubMenu[ 1 ]:SetCheck( .T. ) does not work!
Posted: Thu Dec 18, 2008 05:45 PM
Because the item "Imprimir..." the TREE not appear with the check?



#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
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
TREE -> oSubMenu[ 1 ]:SetCheck( .T. ) does not work!
Posted: Thu Dec 18, 2008 08:51 PM
Alexandre,

Try this:
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
Posts: 10
Joined: Mon Sep 29, 2008 01:06 PM
TREE does not work!
Posted: Fri Dec 19, 2008 12:05 PM
JC,

grateful for the help, but it did not work.

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

FHW 8.11 + xHarbour

Continue the discussion