|
of_getextremepoint
|
|
Full name
|
pfc_u_st_splitbar.of_getextremepoint
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_getextremepoint(integer)
|
Name
|
Datatype
|
HIGH_VALUE
|
Integer
|
li_cnt
|
Integer
|
li_extremepoint
|
Integer
|
li_point
|
Integer
|
li_rc
|
Integer
|
LOW_VALUE
|
Integer
|
public function integer of_getextremepoint (integer ai_extremetype);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_GetExtremePoint
//
// Access: Public
//
// Arguments:
// ai_extremetype The extreme point desired. Valid values are:
// LEFTMOST=1
// RIGHTMOST=2
// TOPMOST=3
// BOTTOMMOST=4
//
// Returns: Integer
// Returns the desired extreme point.
//
// Description: Get the desired extreme point coordinate. The coordinate is
// the maximum or minimum point where the split bar can be
// moved to.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_point
Integer li_extremepoint
Integer li_rc
Integer li_cnt
constant Integer LOW_VALUE = -999999
constant Integer HIGH_VALUE = 999999
CHOOSE CASE ai_extremetype
CASE LEFTMOST
// Initialize the extreme point.
li_point = LOW_VALUE
// Find the left most point.
For li_cnt = 1 to UpperBound(idrg_lefttop)
If IsValid(idrg_lefttop[li_cnt]) Then
If idrg_lefttop[li_cnt].X > li_point Then
li_point = idrg_lefttop[li_cnt].X
End If
End If
Next
// Take into account the the minimum object size.
li_extremepoint = li_point + ii_minobjectsize
CASE RIGHTMOST
// Initialize the extreme point.
li_point = HIGH_VALUE
// Find the right most point.
For li_cnt = 1 to UpperBound(idrg_rightbottom)
If IsValid(idrg_rightbottom[li_cnt]) Then
If idrg_rightbottom[li_cnt].X + idrg_rightbottom[li_cnt].Width < li_point Then
li_point = idrg_rightbottom[li_cnt].X + idrg_rightbottom[li_cnt].Width
End If
End If
Next
// Take into account the split bar itself and the minimum object size.
li_extremepoint = li_point - (ii_barwidth + ii_minobjectsize)
CASE TOPMOST
// Initialize the extreme point.
li_point = LOW_VALUE
// Find the top most point.
For li_cnt = 1 to UpperBound(idrg_lefttop)
If IsValid(idrg_lefttop[li_cnt]) Then
If idrg_lefttop[li_cnt].Y > li_point Then
li_point = idrg_lefttop[li_cnt].Y
End If
End If
Next
// Take into account the the minimum object size.
li_extremepoint = li_point + ii_minobjectsize
CASE BOTTOMMOST
// Initialize the extreme point.
li_point = HIGH_VALUE
// Find the bottom most point.
For li_cnt = 1 to UpperBound(idrg_rightbottom)
If IsValid(idrg_rightbottom[li_cnt]) Then
If idrg_rightbottom[li_cnt].Y + idrg_rightbottom[li_cnt].Height < li_point Then
li_point = idrg_rightbottom[li_cnt].Y + idrg_rightbottom[li_cnt].Height
End If
End If
Next
// Take into account the split bar itself and the minimum object size.
li_extremepoint = li_point - (ii_barwidth + ii_minobjectsize)
CASE Else
Return -1
END CHOOSE
// Make sure the initial value was replaced.
If li_point = LOW_VALUE or li_point = HIGH_VALUE Then
Return -1
End If
Return li_extremepoint
end function
Name
|
Owner
|
systemfunctions.isvalid |
systemfunctions
|
systemfunctions.upperbound |
systemfunctions
|