|
of_register
|
|
Full name
|
pfc_u_st_splitbar.of_register
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_register(dragobject,integer)
|
Name
|
Datatype
|
li_obj
|
Integer
|
li_rc
|
Integer
|
li_upperbound
|
Integer
|
public function integer of_register (dragobject adrg_object, integer ai_position);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Register
//
// Access: public
//
// Arguments:
// adrg_object The object to register with the service.
// ai_position The position of the object in relation to the splitbar.
//
// Returns: integer
// 1 if it succeeds
// -1 if an error registering the objects occurs.
//
// Description: Register controls which need to either be moved and/or resized
// when the split bar object is moved.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996 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_rc
Integer li_upperbound
Integer li_obj
// Validate required values.
If ii_style <0 or ii_barwidth <0 Then
Return -1
End If
// Validate the dragobject.
If IsNull(adrg_object) Or Not IsValid(adrg_object) Then
Return -1
End If
// Validate the position parameter.
If IsNull(ai_position) Or ai_position < 0 Or ai_position > 4 Then
Return -1
Else
If (ii_style = HORIZONTAL) And &
(ai_position = LEFT Or ai_position = RIGHT) Then
Return -1
ElseIf (ii_style = VERTICAL) And &
(ai_position = ABOVE Or ai_position = BELOW) Then
Return -1
End If
End If
// Make sure this object is not already registered on the left/top array.
li_upperbound = UpperBound (idrg_lefttop)
For li_obj = 1 to li_upperbound
If IsValid(idrg_lefttop[li_obj]) Then
If adrg_object = idrg_lefttop[li_obj] Then
Return -1
End If
End If
Next
// Make sure this object is not already registered on the right/bottom array.
li_upperbound = UpperBound (idrg_rightbottom)
For li_obj = 1 to li_upperbound
If IsValid(idrg_rightbottom[li_obj]) Then
If adrg_object = idrg_rightbottom[li_obj] Then
Return -1
End If
End If
Next
// Register the new object.
If ai_position = LEFT Or ai_position = ABOVE Then
ii_lefttopbound = UpperBound (idrg_lefttop) + 1
idrg_lefttop[ii_lefttopbound] = adrg_object
ir_lefttopx[ii_lefttopbound] = adrg_object.X
ir_lefttopy[ii_lefttopbound] = adrg_object.Y
ir_lefttopwidth[ii_lefttopbound] = adrg_object.Width
ir_lefttopheight[ii_lefttopbound] = adrg_object.Height
Else
ii_rightbottombound = UpperBound (idrg_rightbottom) + 1
idrg_rightbottom[ii_rightbottombound] = adrg_object
ir_rightbottomx[ii_rightbottombound] = adrg_object.X
ir_rightbottomy[ii_rightbottombound] = adrg_object.Y
ir_rightbottomwidth[ii_rightbottombound] = adrg_object.Width
ir_rightbottomheight[ii_rightbottombound] = adrg_object.Height
End If
Return 1
end function
Name
|
Owner
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.isvalid |
systemfunctions
|
systemfunctions.upperbound |
systemfunctions
|