of_refreshvisuals


pfcwnsrv.pbl   >   pfc_w_statusbar   >   of_refreshvisuals   

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

Name Datatype
No Data

Name Datatype
ll_resource long
ls_modifyexp string
ls_rc string

protected function integer of_refreshvisuals ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_RefreshVisuals
//
//	Access:  Public
//
//	Arguments:	None
//	
//	Returns:  Integer
//	1 if it succeeds and -1 if an error occurs.
//
//	Description:
//	Refreshes the Pre-Defined Visual Objects. 
//
//////////////////////////////////////////////////////////////////////////////
//	
//	Revision History
//
//	Version
//	5.0   Initial version
// 5.0.03 When appropriate display N/A (for NotApplicable or NotAvailable)
//		instead of a negative return code.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_resource
string	ls_modifyexp
string	ls_rc

// Validate required references.
If IsNull(iw_parentwindow) Or Not IsValid(iw_parentwindow) Then
	Return -1
End If
If IsNull(iw_parentwindow.inv_statusbar) Or &
	Not IsValid(iw_parentwindow.inv_statusbar) Then 
	Return -1
End If

// If appropriate update the Memory value.
If iw_parentwindow.inv_statusbar.of_GetMem() Then
	ll_resource = inv_platform.of_GetFreememory()
	If ll_resource <> -1 then
		// Display the reading.  Color it if below threshold.
		ls_modifyexp = "pfc_mem.Expression=~"'"+ &
							'Mem: '+string(ll_resource/1048576,"###.0")+ " MB'~" "
		if ll_resource < iw_parentwindow.inv_statusbar.of_GetMemThreshold() then
			ls_modifyexp = ls_modifyexp + "pfc_mem.Background.Color='"+ &
								string(il_warningcolor)+"' "
		Else
			ls_modifyexp =	ls_modifyexp + "pfc_mem.Background.Color='"+ &
								string(il_buttonface)+"' "
		End if
	Else
		// Display NotApplicable/NotAvailable.		
		ls_modifyexp = "pfc_mem.Expression=~"'"+ "Mem: N/A'~" " + &
							"pfc_mem.Background.Color='"+ string(il_buttonface)+"' "
	End If
	ls_rc = dw_statusbar.Modify (ls_modifyexp)		
End If

// If appropriate update the User Memory value.
If iw_parentwindow.inv_statusbar.of_GetUser() Then
	ll_resource = inv_platform.of_GetFreeResources(2)
	If ll_resource <> -1 Then
		// Display the reading.  Color it if below threshold.		
		ls_modifyexp = "pfc_user.Expression=~"'"+ &
							'User: '+string(ll_resource,"###")+ " %'~" "
		if ll_resource < iw_parentwindow.inv_statusbar.of_GetUserThreshold() then
			ls_modifyexp = ls_modifyexp + "pfc_user.Background.Color='"+ &
								string(il_warningcolor)+"' "
		Else
			ls_modifyexp =	ls_modifyexp + "pfc_user.Background.Color='"+ &
								string(il_buttonface)+"' "
		End if
	Else
		// Display NotApplicable/NotAvailable.
		ls_modifyexp = "pfc_user.Expression=~"'"+ "User: N/A'~" " + &
							"pfc_user.Background.Color='"+ string(il_buttonface)+"' "	
	End If
	ls_rc = dw_statusbar.Modify (ls_modifyexp)		
End If

// If appropriate update the GDI Memory value.
If iw_parentwindow.inv_statusbar.of_GetGDI() Then
	ll_resource = inv_platform.of_GetFreeResources(1)
	If ll_resource <> -1 then
		// Display the reading.  Color it if below threshold.		
		ls_modifyexp = "pfc_gdi.Expression=~"'"+ &
							'GDI: '+string(ll_resource,"###")+ " %'~" "
		if ll_resource < iw_parentwindow.inv_statusbar.of_GetGDIThreshold() then
			ls_modifyexp = ls_modifyexp + "pfc_gdi.Background.Color='"+ &
								string(il_warningcolor)+"' "
		Else
			ls_modifyexp =	ls_modifyexp + "pfc_gdi.Background.Color='"+ &
								string(il_buttonface)+"' "
		End if
	Else
		// Display NotApplicable/NotAvailable.		
		ls_modifyexp = "pfc_gdi.Expression=~"'"+ "GDI: N/A'~" " + &
							"pfc_gdi.Background.Color='"+ string(il_buttonface)+"' "				
	End If		
	ls_rc = dw_statusbar.Modify (ls_modifyexp)		
End If

Return 1
end function

     
Name Owner
pfc_w_statusbar.of_createvisuals pfc_w_statusbar
pfc_w_statusbar.timer pfc_w_statusbar

     
Name Owner
datawindow.modify datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.string systemfunctions
systemfunctions.string systemfunctions
pfc_n_cst_platform.of_GetFreeMemory pfc_n_cst_platform
pfc_n_cst_platform.of_GetFreeResources pfc_n_cst_platform
pfc_n_cst_winsrv_statusbar.of_getmem pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_getuser pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_getuserthreshold pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_getmemthreshold pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_getgdi pfc_n_cst_winsrv_statusbar
pfc_n_cst_winsrv_statusbar.of_getgdithreshold pfc_n_cst_winsrv_statusbar

     
Full name
pfc_w_statusbar

     
Name Scope
No Data