Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty middle layer class - runs eldest method
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00204785
Message ID:
00205452
Vues:
18
Rick,

I'm not sure how the MessageBox() call is interfering, but it obviously is. It probably messes things up because it is in the keyboard event queue. You might try using debugout commands to track what's happening instead. Your example shows the problem without the need for a class tree. If you substitute TextBox::KeyPress(...) for the DoDefault() it works reliably.

>I didn't know that. I played around with it in 5.0.415 with the following results. The last example is very strange: if it's obvious what's happening there, it's too late at night for me to see it right now.
>
>
-------- Ex. 1 --------  (baseline; works OK)
>DEFINE CLASS myForm AS form
>   ADD OBJECT txt1 AS TextBox
>ENDDEFINE
>
>input: 1234   output: 1234
>
>-------- Ex. 2 -------- (works OK too)
>DEFINE CLASS myForm AS form
>   ADD OBJECT txt1 AS TextBox
>   PROCEDURE txt1.KEYPRESS( nKeyCode, nShiftAltCtrl)
>   ENDPROC
>ENDDEFINE
>
>input: 1234   output: 1234
>
>-------- Ex. 3 -------- (duplicates happen here)
>DEFINE CLASS myForm AS form
>   ADD OBJECT txt1 AS TextBox
>   PROCEDURE txt1.KEYPRESS( nKeyCode, nShiftAltCtrl)
>      dodefault()
>   ENDPROC
>ENDDEFINE
>
>input: 1234   output: 11223344
>
>-------- Ex. 4 -------- (this one's OK...)
>DEFINE CLASS myForm AS form
>   ADD OBJECT txt1 AS TextBox
>   PROCEDURE txt1.KEYPRESS( nKeyCode, nShiftAltCtrl)
>      messagebox( "hello from myForm")
>   ENDPROC
>ENDDEFINE
>
>input: 1234   output: 1234
>
>-------- Ex. 5 -------- (gets duplicates again, as expected)
>DEFINE CLASS myForm AS form
>   ADD OBJECT txt1 AS TextBox
>   PROCEDURE txt1.KEYPRESS( nKeyCode, nShiftAltCtrl)
>      dodefault()
>      messagebox( "hello from myForm")
>   ENDPROC
>ENDDEFINE
>
>input: 1234   output: 11223344
>
>-------- Ex. 6 -------- (and now for something completely different)
>DEFINE CLASS myForm AS form
>   ADD OBJECT txt1 AS TextBox
>   PROCEDURE txt1.KEYPRESS( nKeyCode, nShiftAltCtrl)
>      messagebox( "hello from myForm")
>      dodefault()
>   ENDPROC
>ENDDEFINE
>
>input: 1234   output: 4321 (sic)
>-----------------------
>
>BTW, substituting a WAIT WINDOW for the MESSAGEBOX in Ex. 5 and 6 changes the results and yields 11223344 in both cases.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform