Treeview with checkbox ?

Postby goosfancito » Mon Oct 27, 2008 1:54 pm

Funciona, gracias.

JC wrote:Gustavo,

This procedure can do it!

Code: Select all  Expand view
PROCEDURE checkTreeView( oItemTree, lComplete, lCheckComplete )

LOCAL oObjTree, oObjItem

LOCAL nPos := 0

DEFAULT lComplete      := NIL, ;
        lCheckComplete := NIL



oObjTree := iif( valType( oItemTree ) == "O" .AND. upper( oItemTree:className() ) == "TTREEVIEW", oItemTree, oItemTree:oTree )

IF !isNull( lComplete )

   FOR nPos := 1 TO len( oObjTree:aItems )

       oObjItem := oObjTree:aItems[nPos]

       IF !isEmpty( oObjItem:aItems )
          checkTreeView( oObjItem,, lComplete )
       ELSE
          oObjTree:setCheck( oObjItem, lComplete )
       ENDIF

   NEXT

ELSE

   oObjTree:setCheck( oItemTree, iif( !isNull( lCheckComplete ), lCheckComplete, !oObjTree:getCheck( oItemTree ) ) )

   FOR nPos := 1 TO len( oItemTree:aItems )

       oObjItem := oItemTree:aItems[nPos]

       IF !isEmpty( oObjItem:aItems )
          checkTreeView( oObjItem,, lCheckComplete )
       ELSE
          oObjTree:setCheck( oObjItem, iif( !isNull( lCheckComplete ), lCheckComplete, !oObjTree:getCheck( oObjItem ) ) )
       ENDIF

   NEXT

ENDIF

RETURN( NIL )
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests