of_setposition


pfcwnsrv.pbl   >   pfc_w_statusbar   >   of_setposition   

Full name pfc_w_statusbar.of_setposition
Access protected
Override of integer
Return value integer
Prototype protected function integer of_setposition()

Name Datatype
No Data

Name Datatype
li_xpos_extra integer
li_ypos_extra integer
ll_desiredstatubar_xpos long
ll_frame_xpos long
ll_microhelp_ypos long

protected function integer of_setposition ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  	of_SetPosition
//
//	Access:  	public
//
//	Arguments: 	None
//
//	Returns:  	Integer
//	1 if it succeeds and -1 if an error occurs.
//
//	Description:  	
//	Moves this StatusBar window so it is positioned over the lower right
//	hand portion of the Microhelp bar.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 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.
//
//////////////////////////////////////////////////////////////////////////////

long 		ll_microhelp_ypos, ll_frame_xpos, ll_desiredstatubar_xpos
integer	li_xpos_extra=0, li_ypos_extra=0

// Check window reference.
If IsNull(iw_parentwindow) Or Not IsValid(iw_parentwindow) Then
	Return -1
End If

if iw_parentwindow.windowstate = minimized! then 
	return 1
end if

// Windows 95 has a bigger gap on the hand right side.
If ib_win95 Then
	li_xpos_extra = 50
	li_ypos_extra = 1
End If
	
If Not iw_parentwindow.resizable	Then
	li_ypos_extra += 3
End If
	
// The Y Position of the Status Bar is the Bottom of the Frame Window
// minus the MicroHelpHeight minus the MicroHelpBorderHeight.
ll_microhelp_ypos = &
			(iw_parentwindow.y + iw_parentwindow.height + li_ypos_extra) - &
			(iw_parentwindow.mdi_1.microhelpheight + ii_borderheight)				

// The desired X Position of the Status Bar is the Frame Right End minus
// the StatusBar window.  Also subtract the extra spacing on win95.
ll_desiredstatubar_xpos = &
			iw_parentwindow.x + iw_parentwindow.workspacewidth() + &
			ii_borderwidth - (ii_winmaxwidth + 12 + li_xpos_extra)
				
// The Frame X Position.
ll_frame_xpos = iw_parentwindow.x  + (2*ii_borderwidth) + 16

if ll_desiredstatubar_xpos < ll_frame_xpos then 
	// Status Bar would extend to the left of the frame.
	this.move(ll_frame_xpos , ll_microhelp_ypos)
	// Make the StatuBar the width of the frame.
	this.width = workspacewidth(iw_parentwindow) - (20 + li_xpos_extra)
else 
	// Normal as large as defined Status Bar window.
	this.move(ll_desiredstatubar_xpos , ll_microhelp_ypos)
	this.width = ii_winmaxwidth
end if

Return 1
end function

     
Name Owner
pfc_w_statusbar.of_refreshposition pfc_w_statusbar
pfc_w_statusbar.of_createvisuals pfc_w_statusbar
pfc_w_statusbar.open pfc_w_statusbar

     
Name Owner
window.move window
window.workspacewidth window
window.workspacewidth window
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions

     
Full name
pfc_w_frame
pfc_w_master
pfc_w_statusbar

     
Name Scope
No Data