Lo pones igual..
Code: Select all
CLASS MDITree FROM TMdiChild
CLASSDATA oApp
DATA oDbf, oDbfSlave
DATA oTree, oBrw
DATA nPosition
.......
METHOD New() CONSTRUCTOR
METHOD Activate()
.......
ENDCLASS
METHOD New( oApp, nId, nTop, nLeft, nBottom, nRight, oDbf, oDbfSlave ) CLASS MDITree
......
Super:New( ::nTop, ::nLeft, ::nBottom, ::nRight, , Nil, Nil, oApp:oWnd, ;
oApp:oWnd:oIcon, .F., ::nClrText, ::nClrPane, Nil, Nil, .T., .F., Nil, Nil, .T., ;
.T., .T., .T. )
::oTree := TTreeView():New( 0, 0, Self, ::nClrtext, ::nClrPane, , , ::nPosition - 1 )
::oTree:SetFont( ::oFont )
If oDbfSlave != Nil
::oDbfSlave := oDbfSlave
::lSplitter := .T.
::oBrw := tsBrowse():New( 0, ::nPosition + 4, Nil, Nil, Nil, Nil, , Self, Nil, Nil, Nil, ;
Nil, Nil, Nil, ::oFont, Nil, { ::nClrText }, Nil, .T., ;
oDbfSlave:cAlias, .T., Nil, Nil, Nil, Nil )
::oBrw:SetoDbf( oDbfSlave )
::oBrw:bLDblClick:= { || ::Edition() }
::oClient := TSplitter():New( 0, ::nPosition, .T., { ::oTree }, .T., { ::oBrw }, .T., ;
Nil, Nil, Self, Nil, , , .T., .T., Nil, .F., .F. )
::oTree:bChanged := { |o,i| i := o:GetSelected(), ;
If( !Empty( i:Cargo ) .and. ::oDbf:nArea > 0, ;
( ::oDbfSlave:SetScope( i:Cargo ), ;
::oBrw:Reset() ), ) }
EndIf
.......
Return Self
METHOD Activate( bEnd ) CLASS MDITree
::bEnd := bEnd
If ::lDefault
::ToolBar()
Endif
::MakeTree()
Super:Activate( , , , , ;
{ || If( ::lSplitter, ::oClient:adjClient(), ) } )
::oTree:SetFocus()
Return Self