|
of_register
|
|
Full name
|
pfc_n_cst_winsrv_statusbar.of_register
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_register(string,string,string,integer,integer,integer)
|
Name
|
Datatype
|
li_cnt
|
Integer
|
li_upper
|
Integer
|
public function integer of_register (string as_id, string as_type, string as_value, integer ai_width, integer ai_bordertype, integer ai_gapwidth);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Register
//
// Access: Public
//
// Arguments:
// as_id The ID of the User Defined object to be Registered.
// as_type The type of object.
// Valid values are 'text' and 'bitmap'.
// as_value The initial value of the object.
// ai_width The desired width of the object.
// ai_bordertype The border type to use around the object.
// ai_gapwidth The gap to use from the previous registered object.
//
// Returns: integer
// 1 if it succeeds and -1 if an error occurs.
//
// Description:
// Registers a new object to be displayed on the GUI Status Bar.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0 Changed to use new constants.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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(as_value) or &
IsNull(ai_width) or ai_width < 0 or IsNull(ai_bordertype) or &
ai_bordertype <0 or ai_bordertype >6 or IsNull(ai_gapwidth) or &
ai_gapwidth <=0 Then
Return -1
End If
// Check for a valid type.
If as_type <> BITMAP And as_type <> TEXT Then
Return -1
End If
// Check for a predefined id.
If of_IsPredefined(Trim(as_id)) Then
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 -3
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 = as_type
inv_dwobjects[li_upper].s_value = as_value
inv_dwobjects[li_upper].i_width = ai_width
inv_dwobjects[li_upper].i_bordertype = ai_bordertype
inv_dwobjects[li_upper].i_gapwidth = ai_gapwidth
// Notify the GUI of a new object.
If IsValid(iw_statusbar) Then
iw_statusbar.of_CreateVisuals()
End If
Return 1
end function