#include "fivewin.ch"
REQUEST DBFCDX
function Main()
field STATE,HIREDATE,CITY
local oDlg, oFont, oBrw
USE CUSTOMER NEW SHARED VIA "DBFCDX"
INDEX ON STATE + STR(INT(YEAR(HIREDATE)/10)*10,4) + CITY TAG STATEYR TO TMP MEMORY
GO TOP
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 700,600 PIXEL TRUEPIXEL FONT oFont
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" ;
COLUMNS "STATE", "STRZERO(INT(YEAR(HIREDATE)/10)*10,4) AS DECADE", ;
"CITY", "FIRST", "AGE", "HIREDATE", "SALARY" ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:AddBitmap( { FWDArrow(), FWRArrow(), "c:\fwh\bitmaps\treevh.bmp" } )
:SetTree( 3 )
:oTree:OpenAll()
:lDisplayZeros := .f.
//
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
I added 3 quick preview-buttons to Your sample.
is it possible to change a treelevel on button-action ?.
I mean close, show level 1 or 2
( I used oBrw:oTree:OpenAll() for level 2 )
regards
Uwe
Last edited by ukoenig on Mon Jul 15, 2019 9:33 am, edited 8 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
ocol:=obrow2:aCols[ 1 ]
ocol:cheader:="科目代码"
ocol:AddBitmap( { "tree1", "tree2", "treevh" } )
// ocol:cFooter := "GRAND TOTAL"
ocol:nEditType := {||if(::ledit,1,0)}
ocol:bEditValue := {||odb2:cquery:="select * from ac where acid='"+obrow2:oTreeItem:cPrompt+"'",odb2:refresh(),obrow2:oTreeItem:cPrompt}
// on chang ,to refresh other columns datas
oCol:bOnPostEdit := {|o, v, n|if( n != VK_ESCAPE ,obrow2:oTreeItem:cPrompt := padr(v,nacidlen," ") ,)}
ocol:bpopup:={||acc0501(,,obrow2)}
// right click call popu menu
// insert sub grade tree item, insert new tree item, delete tree item
ocol:bLDClickData:={||acc0502(obrow2:otreeitem),obrow2:otreeitem:Toggle(),obrow2:refresh()}
//ldbl click tree
// dynamic expand sub trees
Hi
I have a tree of two levels (MariaDb's objetc)
I need to evaluate if the 2nd Level is open.
If open, Then I take an action.
Only when double click on 2nd Level
How I do it?
Thanks
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
Hello Mr Rao
I'm using a Tree and it's good
I'm using the same oTree:MakeTree() that your sample
but when i send oTree:CollapseAll()
it collapse the app
Error occurred at: 20/11/2019, 19:37:33
Error description: Error BASE/1004 Message not found: TLINKLIST:COLLAPSEALL
Args:
[ 1] = O TLINKLIST
Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TLINKLIST:ERROR( 0 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
Called from: ../../../tobject.prg => TLINKLIST:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TLINKLIST:COLLAPSEALL( 0 )
Called from: D:\Fuen32\FeHot\Source\FeH_TGes.prg => (b)TGESTION_RESERVAS( 115 )
what is wrong?
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina