Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to trap a change in a ListBox after a MESSAGEBOX()
Message
De
12/03/2016 15:08:53
 
 
À
12/03/2016 12:37:13
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01632877
Message ID:
01632926
Vues:
54
>>User clicks on a list. The item on which he clicked is highlighted. A message box appears. User responds to the message box. The message box disappears. The value of the list and the highlighted item are not in sync.
>>
>>If you think this is regular UI or if you're ok with events triggered by an user explicit action being "eaten away" after they occur, like they never happened, then good for you.
>>
>>It's not good for me.
>
>Perhaps you could track, in the debugger, the moment when the highlighted item in the listbox changes, and the value of its .listindex, .value and perhaps the .selected[.listindex] and if .displayvalue has any meaning in a listbox, that too. Watch them as they were before the messagebox(), then step by step afterwards. Perhaps you'll catch something. Though, as in all things focus-related, the debugger has the focus and the rest of the focus behavior is more or less simulated.
>
>A thing I'd try: after messagebox(), listbox.setfocus() (unless all of this is happening in a .valid(), then you can't do this).

Dragan, thank you for your interest.

I did track the event log, as I told before, and could not find trace of the click in the listbox that starts the text box to lose focus.

Actual profiling from my application (no lines snipped in between but paths partially redacted):

a) change focus from lstElementos to edtValor, all seems normal.
   0.000251,,frmoperacao.lstelementos.interactivechange,15,---\geniua\forms\operacao.sct,1
   0.000411,xeditbox,xeditbox.interactivechange,1,---\comum\basics\basics.vct,1
b) the moment edtValor begins to lose focus (at this time, lstElementos was clicked on a different item that was properly highlighted, but there is no sign of any lstElementos events):
   0.000077,xeditbox,xeditbox.interactivechange,3,---\comum\basics\basics.vct,1
   0.001112,,frmoperacao.edtvalor.valid,1,---\geniua\forms\operacao.sct,1
c) at line 12 of edtValor.Valid(), the Messagebox() is issued and removed by user interaction (3 seconds for that) but no more events are traced (the next event registers accessing the menu to turn profiling off - yes, I have a profiler on/off option in my menu to assist me in application development and test, go figure):
   3.087909,,frmoperacao.edtvalor.valid,12,---\geniua\forms\operacao.sct,1
   0.000358,sfbar,sfbar.click,5,---\xmenu\source\sfmenu.vct,2
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform