I use TreeView like below.
- Code: Select all Expand view
- #include "fivewin.ch"
Procedure Main()
Local Cx1:=136, CY1 := 74, CX2 := 652, CY2 := 911, ODlg, oFont
Local XNAME:=SPACE(25), oName
DEFINE DIALOG oDlg FROM CX1,CY1 TO CX2,CY2 PIXEL ;
STYLE nOr( WS_OVERLAPPEDWINDOW ) TRANSPARENT
oDlg:SetColor(,10150628,)
@ 10,7 TREEVIEW oTree OF oDlg SIZE 95, 100 PIXEL
oTree:bChanged := { | oItem | oItem := oTree:GetSelected(), ;
If( ValType( oItem:Cargo ) == "B", Eval( oItem:Cargo ),) }
@ 2, 03 GROUP oGrp1 TO 80,195 Pixel
@ 3, 90 GROUP oGrp TO 200,90 OF oDlg PIXEL
// This lines are the same as Opt_Page1 Procedure, but nTop, nLeft does not print the
// same place in same dialog. It is also change the get's height.
@ 60,110 SAY "Enter your Name and Surname" OF oDlg PIXEL TRANSPARENT
@ 58,210 GET oNAME VAR XNAME OF oDlg PIXEL SIZE 150,10 UPDATE
ACTIVATE DIALOG ODlg ;
ON INIT (oDlg:nHeight:=CX2-cx1, oDlg:nWidth:=CY2-cy1, ;
oDlg:bResized := {|| ONRESIZE(oDlg, oGrp1, oGrp, oTree) })
RETURN .T.
Procedure ONRESIZE(oDlg, oGrp1, oGrp, oTree)
oGrp1:nWidth:=oDlg:nWidth-30
oGrp1:nHeight:=oDlg:nHeight-45
oGrp:nTop := oGrp1:nTop
oGrp:nLeft := oGrp1:nLeft
oGrp:nHeight := oGrp1:nHeight
oGrp:nWidth := 205
oTree:nHeight := oGrp1:nHeight-25
IF len(oTree:aItems)=0
oTree:Add( "Selection 1"):Cargo = GenBlock("Opt_Page1", oDlg)
oTree:Add( "Selection 2")
oTree:Add( "Selection 3")
oTree:Add( "Selection 4")
oTree:Add( "Selection 5")
ENDIF
RETURN
PROCEDURE Opt_Page1( oDlg )
Local XNAME:=SPACE(25), oName
// This lines are the same as Opt_Page1 Procedure, but nTop, nLeft does not print the
// same place in same dialog. It is also change the get's height.
@ 60,110 SAY "Enter your Name and Surname" OF oDlg PIXEL TRANSPARENT
@ 58,210 GET oNAME VAR XNAME OF oDlg PIXEL SIZE 150,10 UPDATE
RETURN
Static FUNCTION GenBlock(DialogName, oDlg)
RETURN {|| &(DialogName)( oDlg ) }
.RC File.
- Code: Select all Expand view
- 1 24 "WindowsXP.Manifest"
I have get and say classes in dialog. But When I try to write same lines in another procedure that is sended from Treeview On change method, My get and says does not printed the same place. Is there any wrong code in my application?
Thanks