Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUGS: Pageframe and Page.Deactivate NODEFAULT
Message
 
 
To
02/07/2005 05:39:29
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01028103
Message ID:
01028568
Views:
17
>I discovered this a long time ago, don't remember when
>
>I have a standard maintenance form class ( a la Tastrade ). A form with a pageframe consisting of two pages
>The left page allows you to modify a record, the right page gives a list (grid) of all records
>
>In the left page's DeActivate event, when the data has changed, you get a prompt: Save ? Yes No Cancel
>
>The cancel does a NODEFAULT.
>
>Now, when one is on page1 caption and a LeftArrow or RightArrow is pressed it produces a page DeActivate event.
>When a NODEFAULT is done there, it is not reliable, ie it switches to page2 anyway
>
>Since then, I have the following code in the form Keypress (the solution you are suggesting)
>
>
>do case
>case inlist(nKeyCode, nKEY_LEFT_ARROW, nKEY_RIGHT_ARROW)
>	local ac
>	ac = this.GetActiveControl()
>	if( !isNull(ac) )
>		if( ac.BaseClass = 'Page' )
>			NODEFAULT
>		endif
>	endif
>...
>
>
>When you are on page1 and you click on the header of page2, the NODEFAULT works without any problem. It's just the arrow keys that may cause a problem

Gregory,

I have two questions:

1) How do you solve the problem of not doing your code if the user clicks on the same page?

2) What if your form's baseclass already has code in KeyPress? How can you add your new code? If you would call dodefault in KeyPress, it would fire key sequence twice, would it?

Thanks.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform