Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last active control
Message
From
21/09/2007 19:18:09
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01256036
Message ID:
01256051
Views:
16
Hi Hugo,

Thanks for the input. I need to digest this a bit and I'll get back to you with how it goes.



>Jim,
>
>A simplified version, without error checking and assuming all objects in each pageframe are not nested etc.
>
>In the init of the Pageframe put a method similar to this
>
>
>local loPage, loObject
>
>for each loPage in this.Pages
>	loPage.AddProperty('LastActive', loPage.Objects(1))
>	
>	for each loObject in loPage.Objects
>		Bindevent(loObject, 'LostFocus', thisform, 'SomeoneLostFocus')
>	endfor
>endfor
>
>
>In the Activate of each frame you put something like this
>
>
>this.Refresh()
>this.LastActive.setFocus()
>
>
>And finally in the form add a method called SomeoneLostFocus with this code
>
>
>local laEvents(1)
>
>lnEvents = Aevents(laEvents, 0)
>
>laEvents[1].Parent.LastActive	= laEvents[1]
>
>
>As you can see I am using laEvents[1].Parent, this should be replaced with a method to get the parent page of each object to be able to use nested object in each page, but I hope it can give you an idea
>
>
>[Update]
>
>Now I realize that the SomeoneLostFocus should be a method of your pageframe class, not the form, anyways, it was just to give you some idea.
>
>[Update 2]
>
>To make it work with nested objects, create a method in the form (should be in your pageframe class, but to test I used the form) and write this method
>
>
>* no error checking!
>lparameters toObject
>
>loParent			= toObject.Parent
>do while loParent.Parent # thisform.pageFrame1 && Should be this instead of thisform.pageFrame1
>	loParent			= loParent.Parent
>enddo
>
>return loParent
>
>
>Now change SomeoneLostFocus to
>
>
>local laEvents(1), loPage
>
>lnEvents		= Aevents(laEvents, 0)
>loPage			= thisform.getParentPage(laEvents[1])
>loPage.LastActive	= laEvents[1]
>
Jim Newsom
IT Director, ICG Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform