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

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

Postby Alexandre Oliveira » Thu Dec 18, 2008 5:45 pm

Because the item "Imprimir..." the TREE not appear with the check?

Image

Code: Select all  Expand view
#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
Alexandre Oliveira
 
Posts: 10
Joined: Mon Sep 29, 2008 1:06 pm
Location: Brasil

Postby JC » Thu Dec 18, 2008 8:51 pm

Alexandre,

Try this:
Code: Select all  Expand view
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
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

TREE does not work!

Postby Alexandre Oliveira » Fri Dec 19, 2008 12:05 pm

JC,

grateful for the help, but it did not work.

Code: Select all  Expand view
  //oSubMenu[ 1 ]:SetCheck( .T. )
   TVSetCheck( oTree:hWnd, oSubMenu[1]:hItem, .t. )

Alexandre Oliveira
FHW 8.11 + xHarbour
User avatar
Alexandre Oliveira
 
Posts: 10
Joined: Mon Sep 29, 2008 1:06 pm
Location: Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests