I'd like use the treeview class of Fwh .
Until now I used another class of Goran Savckic.
I have these fields FrN1, FrN2, FrN3, FrN4 y Frn5
(1,0,0,0,0)
···(1,1,0,0,0)
······(1,1,1,0,0)
······(1,1,2,0,0)
···(1,2,0,0,0)
I have some problem to converte the funcs to use fwh treeview.
on init old app I have :
- Code: Select all Expand view
@ 0, nSplit+2 TREE oApp():oGrid OF oApp():oDlg ;
SIZE (oApp():oDlg:nWidth())/2, (oApp():oDlg:nHeight()-22)/2 PIXEL ;
BITMAPS { "SH_PCLAVE","SH_MATERIA"} ;
FONT oApp():oFont ;
TREE STYLE nOr( TVS_HASLINES, TVS_HASBUTTONS ) ;
ON DBLCLICK FrClickTree(oApp():oGrid) ;
ON CHANGE ( oLink := oApp():oGrid:GetLinkAt( oApp():oGrid:GetCursel() ) ,;
xPrompt := oLink:TreeItem:cPrompt ,;
FR->(DbSetOrder(2)) ,;
FR->(DbSeek(UPPER(xPrompt))) ,;
FR->(DbSetOrder(1)) ,;
RefreshCont(oCont,"FR") )
FrTreeLoad(oApp():oGrid)
STATIC function FrTreeLoad( oTree )
local oDatabase
local nStep
local oLink
local oLink1, oLink2, oLink3, oLink4, oLink5
local N1 := 0
local N2 := 0
local N3 := 0
local N4 := 0
// oTree:bRClicked = {|nRow,nCol| MenuTree(oTree,nRow,nCol)}
oLink := oTree:GetRoot()
SELECT FR
FR->(DbGoTop())
DO WHILE ! FR->(EOF())
if FR->FrN2 == 0
oLink1 := oLink:AddLastChild(FR->FrTipo,Iif(FR->FrHoja,1,2),Iif(FR->FrHoja,1,2),.t.)
oLink1:Cargo := Str(FR->Frn1,2)+Str(FR->Frn2,2)+Str(FR->Frn3,2)+Str(FR->Frn4,2)+Str(FR->Frn5,2)
elseif FR->FrN3 == 0
oLink2 := olink1:AddLastChild(FR->FrTipo,Iif(FR->FrHoja,1,2),Iif(FR->FrHoja,1,2),.t.)
oLink2:Cargo := Str(FR->Frn1,2)+Str(FR->Frn2,2)+Str(FR->Frn3,2)+Str(FR->Frn4,2)+Str(FR->Frn5,2)
elseif FR->FrN4 == 0
oLink3 := olink2:AddLastChild(FR->FrTipo,Iif(FR->FrHoja,1,2),Iif(FR->FrHoja,1,2),.t.)
oLink3:Cargo := Str(FR->Frn1,2)+Str(FR->Frn2,2)+Str(FR->Frn3,2)+Str(FR->Frn4,2)+Str(FR->Frn5,2)
elseif FR->FrN5 == 0
oLink4 := olink3:AddLastChild(FR->FrTipo,Iif(FR->FrHoja,1,2),Iif(FR->FrHoja,1,2),.t.)
oLink4:Cargo := Str(FR->Frn1,2)+Str(FR->Frn2,2)+Str(FR->Frn3,2)+Str(FR->Frn4,2)+Str(FR->Frn5,2)
else
oLink5:= oLink4:AddLastChild(FR->FrTipo,Iif(FR->FrHoja,1,2),Iif(FR->FrHoja,1,2),.t.)
oLink5:Cargo := Str(FR->Frn1,2)+Str(FR->Frn2,2)+Str(FR->Frn3,2)+Str(FR->Frn4,2)+Str(FR->Frn5,2)
endif
FR->(DbSkip())
ENDDO
oTree:UpdateTV()
oTree:SetFocus()
return nil
Someone can help me please