of_setdropdowncalendar


pfcmain.pbl   >   pfc_u_em   >   of_setdropdowncalendar   

Full name pfc_u_em.of_setdropdowncalendar
Access public
Extend of integer
Return value integer
Prototype public function integer of_setdropdowncalendar(boolean)

Name Datatype
No Data

Name Datatype
lnv_calendarattrib n_cst_calendarattrib
lpo_message powerobject
ls_classname string
lw_parent window

public function integer of_setdropdowncalendar (boolean ab_switch);//////////////////////////////////////////////////////////////////////////////
// 
//	Event:  of_SetDropDownCalendar
//
//	(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 Calendar 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_calendarattrib lnv_calendarattrib

//Check arguments
If IsNull(ab_switch) Then
	Return -1
End If

// Check for an appropriate Mask Type.
If this.MaskDataType <> DateMask! 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_calendar) 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_calendarattrib.ib_dropdown = True		
		lw_parent.OpenUserObjectWithParm(iuo_calendar, lnv_calendarattrib)
		iuo_calendar.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_calendar) THEN
		lw_parent.CloseUserObject(iuo_calendar)
		Return 1
	END IF	
END IF 

Return 0
end function

     
Name Owner
pfc_u_em.destructor pfc_u_em

     
Name Owner
powerobject.classname powerobject
window.closeuserobject window
window.openuserobjectwithparm window
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.trim systemfunctions
pfc_u_calendar.of_setrequestor pfc_u_calendar
pfc_u_em.of_getparentwindow pfc_u_em
pfc_n_msg.of_copyto pfc_n_msg

     
Full name
demopfc

     
Name Scope
No Data