of_registerpredefined


pfcwnsrv.pbl   >   pfc_n_cst_winsrv_statusbar   >   of_registerpredefined   

Full name pfc_n_cst_winsrv_statusbar.of_registerpredefined
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_registerpredefined(string,integer)

Name Datatype
No Data

Name Datatype
li_cnt Integer
li_upper Integer

protected function integer of_registerpredefined (string as_id, integer ai_width);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_RegisterPreDefined
//
//	Access:  Protected
//
//	Arguments:
//	as_id			The ID of the Pre Defined object to be Registered.
//	ai_width		The desired width of the object.
//	
//	Returns:  integer
//	1 if it succeeds and -1 if an error occurs.
//
//	Description:
//	Registers a Pre-Defined object to be displayed on the GUI Status Bar.
//
//	Note: Will use the current default values for BorderType and GapWidth.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_upper
Integer	li_cnt

// Check arguments.
If IsNull(as_id) or Len(trim(as_id))= 0 or  &
	IsNull(ai_width) or ai_width < 0 Then
	Return -1
End If

// Check for a predefined ID.
If Not of_IsPredefined(Trim(as_id)) Then
	// Only valid for Pre-Defined IDs.
	Return -1
End If

// Get the number of Items currently registered.
li_upper = UpperBound (inv_dwobjects)

// Make sure this is not a duplicate ID.
For li_cnt = 1 to li_upper
	If as_id = inv_dwobjects[li_cnt].s_id Then
		Return -1
	End If
Next

// This is a new valid object.  Increment the counter to add it.
li_upper ++

// Add the new object.
inv_dwobjects[li_upper].s_id = as_id
inv_dwobjects[li_upper].s_type = 'predefined'
inv_dwobjects[li_upper].i_width = ai_width
inv_dwobjects[li_upper].i_bordertype = ii_bordertype
inv_dwobjects[li_upper].i_gapwidth = ii_gapwidth

// Notify the GUI of a new object.
If IsValid(iw_statusbar) Then
	iw_statusbar.of_CreateVisuals()
End If

Return 1
end function

     
Name Owner
pfc_n_cst_winsrv_statusbar.of_setuser pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_setmem pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_settimer pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_setgdi pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_setbar pfc_n_cst_winsrv_statusbar

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_winsrv_statusbar.of_ispredefined pfc_n_cst_winsrv_statusbar
pfc_w_statusbar.of_createvisuals pfc_w_statusbar

     
Full name
No Data

     
Name Scope
No Data