It's "patrick . mast @ winfakt . com"James Bott wrote:If you will send me your email address, I will send you some sample code that I got from somewhere. I haven't tried it myself.
It is several files in a zip file or I would just post it here.
Got the files. Thank you. But.. This is exactly how we did it for the printscreen I posted in this 1st message. But this is not NATIVE. It's tricking the classJames Bott wrote:If you will send me your email address, I will send you some sample code that I got from somewhere. I haven't tried it myself.
It is several files in a zip file or I would just post it here.
#include <windows.h>
#include <commctrl.h>
#include <hbapi.h>
HB_FUNC( TVSETCHECK )
{
HWND hWnd = ( HWND ) hb_parnl( 1 );
HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
TreeView_SetItemState( hWnd, hItem, hb_parl( 3 ) );
}
HB_FUNC( TVGETCHECK )
{
HWND hWnd = ( HWND ) hb_parnl( 1 );
HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
hb_retl( TreeView_GetCheckState( hWnd, hItem ) );
}
METHOD GetCheck( oItem ) INLINE ;
If( oItem == nil, oItem := ::GetSelected(), nil ), ;
TVGetCheck( ::hWnd, oItem:hWnd )
METHOD SetCheck( oItem, lOnOff ) INLINE ;
If( oItem == nil, oItem := ::GetSelected(), nil ), ;
TVSetCheck( ::hWnd, oItem:hWnd, lOnOff )
Antonio Linares wrote:Christiano,
You have to include it in the Class TTreeView at source/classes/treeview.prg
Antonio Linares wrote:Gustavo,
Por favor proporciona un pequeño ejemplo PRG autocontenido para probarlo aqui, gracias
METHOD pantalla() CLASS TABMUSUARIOS
LOCAL oDlg,;
oTree,;
oFolder,;
oDatos := Array(3),;
vDatos := Array(3),;
oTextos := Array(4),;
oBtns := Array(2)
::oQuery:= ::oConexion:query(::cQuery)
DEFINE DIALOG oDlg resource "DLG_USUARIOS"
//----------( Botones principales )----------
REDEFINE BUTTON oBtns[1] ID 204 OF oDlg
REDEFINE BUTTON oBtns[2] ID 205 OF oDlg
//----------( Folder )----------
REDEFINE FOLDER oFolder ID 4002 OF oDlg ;
PROMPT "Datos", "Permisos", "Llave";
DIALOGS "DLG_TAB1", "DLG_TAB2", "DLG_TAB3"
oFolder:aEnable := {.T., .T., .T.}
//----------( Tree )----------
oTree:= TTreeView():REDEFINE(206, oFolder:aDialogs[2])
//----------( Acción botones )----------
oBtns[2]:bAction:={|| oDlg:END() }
ACTIVATE DIALOG oDlg CENTERED ON INIT (definirTree(oTree))
msgstop( oTree:IsChecked( 1 ) )
RETURN (NIL)
//------------------------------------------------------------------------------
FUNCTION definirTree(oTree)
LOCAL oMenu := array(3), ;
oSubMenu := array(10)
oMenu[1]:= oTree:ADD("Principal")
oSubMenu[1]:= oMenu[1]:ADD("Imprimir...")
oMenu[2]:= oTree:ADD("Proyectos")
oSubMenu[6]:= oMenu[2]:ADD("Definir Proyectos")
oSubmenu[7]:= oMenu[2]:ADD("Actualización datos")
oTree:expand()
RETURN (NIL)
Patrick Mast wrote:Hello,
How can we make a treeview with checkboxes in FWH so it looks something like this:
Patrick
#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 definirTree( oTree )
MsgInfo( oTree:GetCheck( oTree:aItems[ 1 ] ) )
return nil
function definirTree(oTree)
local oMenu := array(3), ;
oSubMenu := array(10)
oMenu[1]:= oTree:Add( "Principal" )
oSubMenu[1]:= oMenu[1]:Add( "Imprimir..." )
oMenu[2]:= oTree:Add( "Proyectos" )
oSubMenu[6]:= oMenu[2]:Add( "Definir Proyectos" )
oSubmenu[7]:= oMenu[2]:Add( "Actualización datos" )
oTree:expand()
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 86 guests