Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActiveControl and ESC
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
ActiveControl and ESC
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01008805
Message ID:
01008805
Vues:
70
Hi everybody,

In MereMortals framework we can close form by pressing ESC. I noticed, that if I type something in the textbox control, then click on Close button at the upper right corner, I'm asked a question: "Do you want to save your changes?". If I type something and press ESC, the question is not asked and form simply closes and that I typed is lost.

Here is Baseform KeyPress method:
*-----------------------------------------------------------
*-- Allow the form to be released when user hits Escape, if 
*-- lReleaseOnESC is .T.
*-----------------------------------------------------------
LPARAMETERS nKeyCode, nShiftAltCtrl
IF this.lReleaseOnESC AND nKeyCode = KEY_ESCAPE
  nodefault
  IF this.QueryUnload()
  	IF This.WindowType = WIN_MODAL
    	This.Hide()
    ELSE
    	This.Release()
    ENDIF
  ENDIF
ENDIF
I added nodefault, but it didn't help. In QueryUnload there is a method called WriteBuffer. This method checks type('_screen.ActiveForm.ActiveControl') and then executes valid of this control, if it's an object. However, in case of ESC the above test doesn't evaluate to O.

The solution could be having form's property oLastActiveControl and binding object's GotFocus method and changing that property, but it's a little bit cumbersome. Do you see a simpler way to fix this annoying problem?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform