|
of_updateprep
|
|
Full name
|
pfc_n_cst_luw.of_updateprep
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_updateprep(powerobject[])
|
Name
|
Datatype
|
la_rc
|
Any
|
lb_defined
|
Boolean
|
ldw_nonpfc
|
DataWindow
|
li_i
|
Integer
|
li_max
|
Integer
|
li_rc
|
Integer
|
lpo_tocheck
|
PowerObject
|
ls_args
|
String[]
|
ltab_control
|
Tab
|
luo_control
|
UserObject
|
lw_control
|
Window
|
public function integer of_updateprep (powerobject apo_control[]);//////////////////////////////////////////////////////////////////////////////
//
// Function:
// of_UpdatePrep
//
// Access: public
//
// Arguments:
// apo_control Array of controls that need update preparation.
//
// Returns: integer
// 1 = success
// -1 = error
//
// Description:
// Perform update preparation for each object in the specified powerobject array.
//
// Note:
// This function is called recursively to handle tab controls and user objects.
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 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.
//
//////////////////////////////////////////////////////////////////////////////
Any la_rc
Integer li_max
Integer li_i
Integer li_rc
String ls_args[]
Boolean lb_defined
PowerObject lpo_tocheck
UserObject luo_control
Tab ltab_control
Window lw_control
DataWindow ldw_nonpfc
// If requested use the assist funtionality.
If ib_assist Then
of_Assist(is_instancename+'.of_UpdatePrep('+of_GetClassNames(apo_control)+')')
End If
// Loop thru all the objects
li_max = UpperBound (apo_control)
For li_i = 1 to li_max
lpo_tocheck = apo_control[li_i]
If IsNull(lpo_tocheck) or Not IsValid(lpo_tocheck) Then Continue
Choose Case TypeOf ( lpo_tocheck )
// Windows!, Tabs!, and UserObjects! can either be SelfUpdatingObjects (SUO) or
// they can be controls which may be holding SelfUpdatingObjects.
// If they are found to be SUO then they will treated as such, if not their
// respective control array will be traversed in search of other SUOs.
Case Window!
If Not of_IsSelfUpdatingObject (lpo_tocheck) Then
// Test for Window Controls (which may contain SelfUpdatingObjects)
lw_control = lpo_tocheck
li_rc = This.of_UpdatePrep ( lw_control.control )
If li_rc < 0 Then Return -1
Continue
End If
Case Tab!
If Not of_IsSelfUpdatingObject (lpo_tocheck) Then
// Test for Tab Controls (which contain TabPages which may contain SelfUpdatingObjects)
ltab_control = lpo_tocheck
li_rc = This.of_UpdatePrep ( ltab_control.control )
If li_rc < 0 Then Return -1
Continue
End If
Case UserObject!
If Not of_IsSelfUpdatingObject (lpo_tocheck) Then
// Test for UserObjects (which may contain SelfUpdatingObjects)
luo_control = lpo_tocheck
li_rc = This.of_UpdatePrep ( luo_control.control )
If li_rc < 0 Then Return -1
Continue
End If
End Choose
// -- An object which 'may' be a SUO has been encountered. --
// Determine if the SUO type is one the service has been asked to process.
If Len (is_typetoprocess) > 0 Then
If Pos (is_typetoprocess, of_GetType(lpo_tocheck)) = 0 Then
// Not a SUO type the service has been asked to process.
Continue
End If
End If
// Check/Perform for Functionality
lb_defined = inv_metaclass.of_isFunctionDefined &
(lpo_tocheck.ClassDefinition, "of_UpdatePrep", ls_args)
If lb_defined Then
li_rc = lpo_tocheck.Function Dynamic of_UpdatePrep ()
If li_rc < 0 Then Return -1
Continue
End If
// Handle NonPFC DataWindows/DataStores.
If TypeOf (lpo_tocheck) = DataWindow! or TypeOf (lpo_tocheck) = DataStore! Then
la_rc = lpo_tocheck.Event Dynamic ue_updateprep ()
If ClassName(la_rc) = 'integer' or ClassName(la_rc)='long' Then
// Functionality was found.
If la_rc < 0 Then Return -1
End If
End If
Next
// No errors found.
Return 1
end function