of_setitemattributes


pfcmain.pbl   >   pfc_u_tv   >   of_setitemattributes   

Full name pfc_u_tv.of_setitemattributes
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_setitemattributes(integer,ref n_ds,long,ref treeviewitem)

Name Datatype
No Data

Name Datatype
li_Overlay Integer

protected function integer of_setitemattributes (integer ai_index, ref n_ds ads_obj, long al_row, ref treeviewitem atvi_item);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_SetItemAttributes
//
//	Access:  protected
//
//	Arguments:
//	ai_Index					The index into the data source attribute class for this item.
//	ads_obj			The DataStore with the data used to populate the item.  Passed
//									by reference.
//	al_Row						The row in the DataStore for the item.
//	atvi_Item					The TreeView item that is being populated.  Passed by reference.
//
//	Returns:		Integer
//					Returns 1 if the item was populated successfully, -1 if an error occurrs.
//
//	Description:	Set the attributes of a TreeView item with data from its DataStore.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//	6.0	Correct OverlayIndex to set correctly.  
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_Overlay

SetPointer(Hourglass!)

// Set Label
atvi_Item.Label = ads_obj.GetItemString(al_Row, inv_ds[ai_Index].s_LabelColumn)
	
// Set Data to the unique key
atvi_Item.Data = ads_obj.Object.pfc_tvi_key[al_Row]
	
// Set the various picture indexes
If inv_ds[ai_Index].s_PictureIndexCol <> "" Then
	atvi_Item.PictureIndex = ads_obj.GetItemNumber(al_Row, inv_ds[ai_Index].s_PictureIndexCol)
Else
	atvi_Item.PictureIndex = inv_ds[ai_Index].i_PictureIndex
End if
	
If inv_ds[ai_Index].s_SelectedPictureIndexCol <> "" Then
	atvi_Item.SelectedPictureIndex = ads_obj.GetItemNumber(al_Row, inv_ds[ai_Index].s_SelectedPictureIndexCol)
Else
	atvi_Item.SelectedPictureIndex = inv_ds[ai_Index].i_SelectedPictureIndex
End if
	
If inv_ds[ai_Index].s_StatePictureIndexCol <> "" Then
	atvi_Item.StatePictureIndex = ads_obj.GetItemNumber(al_Row, inv_ds[ai_Index].s_StatePictureIndexCol)
Else
	atvi_Item.StatePictureIndex = inv_ds[ai_Index].i_StatePictureIndex
End if
	
If inv_ds[ai_Index].s_OverlayPictureIndexCol <> "" Then
	atvi_Item.OverlayPictureIndex = ads_obj.GetItemNumber(al_Row, inv_ds[ai_Index].s_OverlayPictureIndexCol)
Else
	atvi_Item.OverlayPictureIndex = inv_ds[ai_Index].i_OverlayPictureIndex
End if

Return 1

end function

     
Name Owner
pfc_u_tv.of_InsertItem pfc_u_tv
pfc_u_tv.of_refreshitem pfc_u_tv
pfc_u_tv.of_populatelevel pfc_u_tv

     
Name Owner
datastore.getitemnumber datastore
datastore.getitemstring datastore
systemfunctions.setpointer systemfunctions

     
Full name
No Data

     
Name Scope
No Data