|
of_setdropdowncalculator
|
|
Full name
|
pfc_u_em.of_setdropdowncalculator
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_setdropdowncalculator(boolean)
|
Name
|
Datatype
|
lnv_calculatorattrib
|
n_cst_calculatorattrib
|
lpo_message
|
powerobject
|
ls_classname
|
string
|
lw_parent
|
window
|
public function integer of_setdropdowncalculator (boolean ab_switch);//////////////////////////////////////////////////////////////////////////////
//
// Event: of_SetDropDownCalculator
//
// (Arguments: boolean
// TRUE - Start (create) the service
// FALSE - Stop (destroy ) the service
//
// Returns: Integer
// 1 - Successful operation.
// 0 - No action taken.
// -1 - An error was encountered.
//
// Description: Starts or stops the DropDown Calculator visual object.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
// 6.0.01 Corrected to tell the object to behave as a dropdown object.
// 6.0.01 Enhanced so that the Message object is not overwritten by the
// OpenUserObject function.
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996 Powersoft Corporation. All Rights Reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
window lw_parent
string ls_classname
powerobject lpo_message
n_cst_calculatorattrib lnv_calculatorattrib
//Check arguments
If IsNull(ab_switch) Then
Return -1
End If
// Check for an appropriate Mask Type.
If this.MaskDataType <> DecimalMask! And &
this.MaskDataType <> NumericMask! Then
Return -1
End If
// Get parent window reference.
of_GetParentWindow(lw_parent)
If IsNull(lw_parent) or Not IsValid(lw_parent) Then
Return -1
End If
IF ab_Switch THEN
IF Not IsValid (iuo_calculator) THEN
// If using pfc_n_msg, store the Message Object (dynamic call).
If IsValid(message) Then
ls_classname = Trim(Lower(message.ClassName()))
If ls_classname = 'n_msg' Then lpo_message = Create Using 'n_msg'
If IsValid(lpo_message) Then message.Dynamic of_CopyTo(lpo_message)
End If
// Tell the object to behave as a dropdown object.
lnv_calculatorattrib.ib_dropdown = True
lw_parent.OpenUserObjectWithParm(iuo_calculator, lnv_calculatorattrib)
iuo_calculator.of_SetRequestor (this)
// If using pfc_n_msg, restore the Message Object (dynamic call).
If IsValid(lpo_message) Then
lpo_message.Dynamic of_CopyTo(message)
Destroy lpo_message
End If
Return 1
END IF
ELSE
IF IsValid (iuo_calculator) THEN
lw_parent.CloseUserObject(iuo_calculator)
Return 1
END IF
END IF
Return 0
end function