of_buildtree


pfcmain.pbl   >   pfc_u_tv   >   of_buildtree   

Full name pfc_u_tv.of_buildtree
Access protected
Extend of string
Return value string
Prototype protected function string of_buildtree(long,string,string)

Name Datatype
No Data

Name Datatype
ll_Next Long
ls_Return String
ltvi_Item TreeViewItem

protected function string of_buildtree (long al_handle, string as_picts, string as_levelpicts);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_BuildTree
//
//	Access:  protected
//
//	Arguments:
//	al_Handle		The handle of the TreeView item to start building the tree.
//   as_Picts			The file names for the picture and selected picture to display.
//   as_LevelPicts	The file names for all the pictures and selected pictures to display
//						when using a different picture for each level.
//
//	Returns:		String
//					The ImportString data to populate the DataWindow that will be printed.
//
//	Description:	Build the data to populate the DataWindow that will be printed to print
//						a TreeView.  This function is called by of_PrintTree and is recurrsive.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//	6.0	Fix to allow label to only be length of column it is displayed in
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1999 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

String				ls_Return
Long					ll_Next
TreeViewItem		ltvi_Item

If al_Handle <= 0 Then Return ""

GetItem(al_Handle, ltvi_Item)

ls_Return = " ~t" + left(ltvi_Item.Label,55) + "~t" + as_Picts
If ltvi_Item.Selected Then
	ls_Return = ls_Return + "~t1"
Else
	ls_Return = ls_Return + "~t0"
End if
	
If ltvi_Item.Expanded Then
	ls_Return = ls_Return + "~t1"
Else
	ls_Return = ls_Return + "~t0"
End if

If ltvi_Item.Children Then
	ls_Return = ls_Return + "~t1~t0"
Else
	ls_Return = ls_Return + "~t0"
	If FindItem(NextTreeItem!, al_Handle) > 0 Then
		ls_Return = ls_Return + "~t1"
	Else
		ls_Return = ls_Return + "~t0"
	End if
End if

ls_Return = ls_Return + "~t" + String(ltvi_Item.Level) + "~t" + as_LevelPicts + "~r~n"

If ltvi_Item.Expanded And ltvi_Item.Children Then
	ll_Next = FindItem(ChildTreeItem!, al_Handle)
	ls_Return = ls_Return + of_buildtree(ll_Next, as_Picts, as_LevelPicts)
End if

ll_Next = FindItem(NextTreeItem!, al_Handle)
ls_Return = ls_Return + of_buildtree(ll_Next, as_Picts, as_LevelPicts)

Return ls_Return

end function

     
Name Owner
pfc_u_tv.of_buildtree pfc_u_tv
pfc_u_tv.of_printtree pfc_u_tv

     
Name Owner
treeview.finditem treeview
treeview.getitem treeview
systemfunctions.left systemfunctions
systemfunctions.string systemfunctions
pfc_u_tv.of_buildtree pfc_u_tv

     
Full name
No Data

     
Name Scope
No Data