of_restorefocuspoint


pfcwnsrv.pbl   >   pfc_w_statusbar   >   of_restorefocuspoint   

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

Name Datatype
ago_focus graphicobject

Name Datatype
ldrg_obj dragobject
li_rc integer
lw_obj window

protected function integer of_restorefocuspoint (graphicobject ago_focus);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_RestoreFocusPoint
//
//	Access:  protected
//
//	Arguments:
//	  ago_focus object which should get focus.
//
//	Returns:  Integer
//	1 if it succeeds and -1 if an error occurs.
//
//	Description:  
//	Restore the focus point to the passed in object.  If an invalid object is 
//	passed in or the object passed in belongs to this window, then the focus
// point is passed in to the parentwindow.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0.03 Initial version
// 7.0	Added new controls hprogressbar!, htrackbar!, vprogressbar!,
//			vtrackbar!, picturehyperlink!, statichyperlink!
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

integer	li_rc
window 	lw_obj
dragobject ldrg_obj

If IsValid(ago_focus) Then

	// Make sure we are not trying to restore focus to an object in this window.
	If ago_focus = dw_statusbar or ago_focus = this Then
		// Set focus on the parent frame.
		If IsValid(iw_parentwindow) Then
			li_rc = iw_parentwindow.SetFocus()
		Else
			li_rc = -1
		End If
	Else
		// Attempt to set focus on the passed-in object.
		CHOOSE CASE ago_focus.TypeOf()
			CASE Window!
				lw_obj = ago_focus
				li_rc = lw_obj.SetFocus()

			CASE  checkbox!, commandbutton!, datawindow!, dropdownlistbox!, dropdownpicturelistbox!, &
					editmask!, graph!, groupbox!, hprogressbar!, hscrollbar!, htrackbar!, listbox!,  &
					listview!, multilineedit!, olecontrol!, olecustomcontrol!, omcontrol!, omcustomcontrol!,  &
					omembeddedcontrol!, picture!, picturebutton!, picturehyperlink!, picturelistbox!,  &
					radiobutton!, richtextedit!, singlelineedit!, statichyperlink!, statictext!,  &
					tab!, treeview!, userobject!, vprogressbar!, vscrollbar!, vtrackbar!
				ldrg_obj = ago_focus
				li_rc = ldrg_obj.SetFocus()

			CASE else
				// Not a valid object, set focus on the parent frame.
				If IsValid(iw_parentwindow) Then
					li_rc = iw_parentwindow.SetFocus()
				Else
					li_rc = -1
				End If
			
		END CHOOSE
	End If
Else
	// By default, set focus on the parent frame.	
	If IsValid(iw_parentwindow) Then
		li_rc = iw_parentwindow.SetFocus()
	Else
		li_rc = -1
	End If
End If

Return li_rc
end function

     
Name Owner
pfc_w_statusbar.of_createvisuals pfc_w_statusbar
pfc_w_statusbar.timer pfc_w_statusbar

     
Name Owner
powerobject.typeof powerobject
window.setfocus window
dragobject.setfocus dragobject
systemfunctions.isvalid systemfunctions

     
Full name
pfc_w_statusbar

     
Name Scope
No Data