|
of_printtree
|
|
Full name
|
pfc_u_tv.of_printtree
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_printtree(long,boolean,string,string,string[10],string[10])
|
Name
|
Datatype
|
lds_Print
|
n_ds
|
li_Cnt
|
Integer
|
li_RC
|
Integer
|
ls_LevelPicts
|
String
|
ls_Picts
|
String
|
protected function integer of_printtree (long al_handle, boolean ab_canceldialog, string as_pictname, string as_selpictname, string as_levelpicts[10], string as_levelselpicts[10]);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_PrintTree
//
// Access: protected
//
// Arguments:
// al_Handle The handle of the TreeView item to start building the tree. Pass 0
// to print the entire tree.
// ab_CancelDialog True - display the Cancel Printing dialog,
// False - do not display the dialog.
// as_PictName The file name to display as the picture.
// as_SelPictName The file name to display as the selected picture.
// as_LevelPicts[10] The file names for all the pictures to display a different picture for
// each level.
// as_LevelSelPicts[10] The file names for all the pictures to display a different selected
// picture for each level.
//
// Returns: Integer
// 1 if successful, -1 if an error occurrs.
//
// Description: Print the TreeView.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
Integer li_Cnt, li_RC
String ls_Picts, ls_LevelPicts
n_ds lds_Print
If al_Handle < 0 Then Return -1
If al_Handle = 0 Then al_Handle = FindItem(RootTreeItem!, 0)
// Determine the picture and selected picture
If as_PictName = "" Then
ls_Picts = " ~t"
Else
ls_Picts = as_PictName + "~t"
End If
If as_SelPictName = "" Then
ls_Picts = ls_Picts + " "
Else
ls_Picts = ls_Picts + as_SelPictName
End If
For li_Cnt = 1 To 10
ls_LevelPicts = ls_LevelPicts + as_LevelPicts[li_Cnt] + "~t"
Next
ls_LevelPicts = ls_LevelPicts + as_LevelSelPicts[1]
For li_Cnt = 2 To 10
ls_LevelPicts = ls_LevelPicts + "~t" + as_LevelSelPicts[li_Cnt]
Next
// Create the DataStore to be used to print the TreeView
lds_Print = Create n_ds
lds_Print.DataObject = "d_printtree"
If lds_Print.ImportString(of_buildtree(al_Handle, ls_Picts, ls_LevelPicts)) <= 0 Then Return -1
li_RC = lds_Print.Print(ab_CancelDialog)
Destroy lds_Print
Return li_RC
end function
Name
|
Owner
|
treeview.finditem |
treeview
|
datastore.importstring |
datastore
|
datastore.print |
datastore
|
pfc_u_tv.of_buildtree |
pfc_u_tv
|