|
of_SetDropDownCalculator
|
|
Full name
|
pfc_u_dw.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);//////////////////////////////////////////////////////////////////////////////
// Public Function: of_SetDropDownCalculator
// Arguments: boolean
// true - Start (create) the service
// false - Stop (destroy ) the service
// Returns: Integer - 1 if Successful operation, 0 = No action taken and -1 if an error occured
// Description: Starts or stops the DropDown Calculator visual object.
//////////////////////////////////////////////////////////////////////////////
// Rev. History Version
// 6.0 Initial version
// 6.0.01 Enhanced so that the Message object is not overwritten by the
// OpenUserObject function.
//////////////////////////////////////////////////////////////////////////////
// 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.
//////////////////////////////////////////////////////////////////////////////
window lw_parent
string ls_classname
powerobject lpo_message
n_cst_calculatorattrib lnv_calculatorattrib
// Check arguments
if IsNull(ab_switch) then return FAILURE
// Get parent window reference.
of_GetParentWindow(lw_parent)
if IsNull(lw_parent) or not IsValid(lw_parent) then return FAILURE
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 SUCCESS
end if
else
if IsValid (iuo_Calculator) then
lw_parent.CloseUserObject(iuo_Calculator)
return SUCCESS
end if
end if
return NO_ACTION
end function