Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'on key' events seem to have priority over valid method.
Message
De
16/11/2001 00:21:48
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00582463
Message ID:
00582568
Vues:
20
David,

Here's an untested idea ...

Have the function called from your 'on key label' code set a form property called (for instance) .PageTurn with a value of 1 if PageUp or 2 if PageDn, i.e.

on key label Pgup do PageTurn with 1
on key label Pgdn do PageTurn with 2

function PageTurn( pnDirection )
* remember which direction user wanted to move
_Screen.ActiveForm.PageTurn = pnDirection
* force a valid event without moving user out of current control
keyboard {Ctrl+W} plain
endfunc

In your valid code, make a local copy of the form's .PageTurn property and then reset this property to 0. If the valid() is successful, 'move' in the specified direction as specified by the local copy of the form's .PageTurn property. If the valid fails, remain in the control so the user can resolve the problem.

If this works, I would be curious to see what your final code looks like.

Good luck!
Malcolm



>In our application, we use pageframes to accomodate large data entry tasks. To accomodate our customers that don't like mouse-interupts, we have a page-up and page-down utility that is called using the ON KEY PGUP and ON KEY PGDN commands.
>
>This has worked fine, but I have recently discovered some really strange behavior that is new to me (but apparently existing all along). It seems that if we are on an object that has a valid (lostfocus, etc.) method, and press the Page Up key, then the object methods are not executed until the page is loaded the next time.
>
>In our case, this causes program errors to occur when the valid is 'restarted' upon page activate, due to now-incorrect dynamic form properties. It is also causing data to be stored incorrectly for some items, such as measurement conversions.
>
>Is there a standard way to handle this, or does anyone have any ideas how to ensure that the object valid property gets executed prior to leaving a page?
>
>Thanks in advance,
>
>David
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform