of_lbuttonup


pfcmain.pbl   >   pfc_u_st_splitbar   >   of_lbuttonup   

Full name pfc_u_st_splitbar.of_lbuttonup
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_lbuttonup(unsignedlong,integer,integer)

Name Datatype
No Data

Name Datatype
li_cnt Integer
li_deltax Integer
li_deltay Integer
li_height Integer
li_maxx Integer
li_maxy Integer
li_minx Integer
li_miny Integer
li_pointerx Integer
li_pointery Integer
li_width Integer
li_x Integer
li_y Integer

protected function integer of_lbuttonup (unsignedlong aul_flags, integer ai_xpos, integer ai_ypos);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_LButtonUp
//
//	Access:  		Protected
//
//	Arguments:		
//	 aul_flags
//  ai_xpos
//  ai_ypos
//
//	Returns:  		Integer
//						Returns 1 if it succeeds and -1 if an error occurs.
//
//	Description: 	Resize the objects according to the bar that was just moved
//						and other service attributes.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_cnt
Integer 	li_deltax, li_deltay
Integer	li_pointerx, li_pointery
Integer	li_minx, li_maxx, li_miny, li_maxy
Integer	li_x, li_y, li_width, li_height

// Validate required values.
If ii_style <0 or ii_barwidth <0 Then 
	Return -1
End If

// Validate that objects were registered.
If UpperBound(idrg_lefttop) =0 Or UpperBound(idrg_rightbottom) =0 Then
	Return -1
End If

this.SetPosition(ToTop!)

// Change to the base color.
this.BackColor = il_barcolor

// Validate that the bar has been moved.
If ii_prevpositionx = UNITIALIZED Or ii_prevpositiony = UNITIALIZED Then
	Return 0
End If

// Get the new position.
If IsValid(iuo_parent) Then	
	li_pointerx = iuo_parent.PointerX()
	li_pointery = iuo_parent.PointerY()	
ElseIf IsValid(itab_parent) Then
	li_pointerx = itab_parent.PointerX()
	li_pointery = itab_parent.PointerY()
ElseIf IsValid(iw_parent) Then
	li_pointerx = iw_parent.PointerX()
	li_pointery = iw_parent.PointerY()
Else
	// Reset the Previous position variables to UNITIALIZED.
	ii_prevpositionx = UNITIALIZED
	ii_prevpositiony = UNITIALIZED
	Return -1
End If

// Calculate the Extreme points the split bars can be moved.
If ii_style = HORIZONTAL Then
	li_miny = of_GetExtremePoint(TOPMOST)
	li_maxy = of_GetExtremePoint(BOTTOMMOST)
	If li_pointery < li_miny Then
		li_pointery = li_miny
	ElseIf li_pointery > li_maxy Then
		li_pointery = li_maxy
	End If	
ElseIf ii_style = VERTICAL Then
	li_minx = of_GetExtremePoint(LEFTMOST)
	li_maxx = of_GetExtremePoint(RIGHTMOST)
	If li_pointerx < li_minx Then
		li_pointerx = li_minx
	ElseIf li_pointerx > li_maxx Then
		li_pointerx = li_maxx
	End If
End If

// Calculate delta values.
li_deltax = li_pointerx - ii_prevpositionx
li_deltay = li_pointery - ii_prevpositiony

// Minimize size rounding problems.
of_UpdateObjectData()

If ii_style = HORIZONTAL Then
	// Position bar on its new location.
	this.Y = li_pointery
	// Refresh the Width of the bar.
	this.Height = ii_barwidth

	// Resize the objects above the horizontal split bar.
	For li_cnt = 1 to UpperBound(idrg_lefttop)
		If IsValid(idrg_lefttop[li_cnt]) Then
			ir_lefttopheight[li_cnt] += li_deltay		
			idrg_lefttop[li_cnt].Resize(ir_lefttopwidth[li_cnt], ir_lefttopheight[li_cnt])
		End If
	Next
	
	// Resize the objects below the horizontal split bar.	
	For li_cnt = 1 to UpperBound(idrg_rightbottom)
		If IsValid(idrg_rightbottom[li_cnt]) Then
			ir_rightbottomy[li_cnt] += li_deltay		
			ir_rightbottomheight[li_cnt] -= li_deltay		

			idrg_rightbottom[li_cnt].Move (ir_rightbottomx[li_cnt], ir_rightbottomy[li_cnt])
			idrg_rightbottom[li_cnt].Resize (ir_rightbottomwidth[li_cnt], ir_rightbottomheight[li_cnt])
		End If
	Next	

ElseIf ii_style = VERTICAL Then
	// Position bar on its new location.	
	this.X = li_pointerx
	// Refresh the Width of the bar.
	this.Width = ii_barwidth	
	
	// Resize the objects left of the verticalbar.
	For li_cnt = 1 to UpperBound(idrg_lefttop)
		If IsValid(idrg_lefttop[li_cnt]) Then
			ir_lefttopwidth[li_cnt] += li_deltax
			idrg_lefttop[li_cnt].Resize(ir_lefttopwidth[li_cnt], ir_lefttopheight[li_cnt])
		End If
	Next
	
	// Resize the objects right of the verticalbar.	
	For li_cnt = 1 to UpperBound(idrg_rightbottom)
		If IsValid(idrg_rightbottom[li_cnt]) Then
			ir_rightbottomx[li_cnt] += li_deltax	
			ir_rightbottomWidth[li_cnt] -= li_deltax
			idrg_rightbottom[li_cnt].Move (ir_rightbottomx[li_cnt], ir_rightbottomy[li_cnt])
			idrg_rightbottom[li_cnt].Resize(ir_rightbottomWidth[li_cnt], ir_rightbottomHeight[li_cnt])
		End If
	Next
End If

// Reset the Previous position variables to UNITIALIZED.
ii_prevpositionx = UNITIALIZED
ii_prevpositiony = UNITIALIZED
Return 1
end function

     
Name Owner
pfc_u_st_splitbar.lbuttonup pfc_u_st_splitbar

     
Name Owner
window.pointerx window
window.pointery window
windowobject.move windowobject
windowobject.resize windowobject
dragobject.pointerx dragobject
dragobject.pointery dragobject
dragobject.setposition dragobject
systemfunctions.isvalid systemfunctions
systemfunctions.upperbound systemfunctions
pfc_u_st_splitbar.of_updateobjectdata pfc_u_st_splitbar
pfc_u_st_splitbar.of_getextremepoint pfc_u_st_splitbar

     
Full name
pfc_u_st_splitbar

     
Name Scope
No Data