I would like to know if this is a bug or a feature, as it impacts development decisions for me. Any time I select any button, an event fires for all the buttons.
Run this xdialog below and watch the Trace window. Any time you select a button control, the "_changing" event fires for ALL the buttons, not just the one selected. And then a "_" (blank) event fires for the selected button. Perhaps it was never contemplated that someone would want to see all the events for a button control, but I do. Or maybe it's a known feature that I just stumbled upon. I'm using v10.5 build 3432-3608.
Please confirm if you see the same results, thanks.
Run this xdialog below and watch the Trace window. Any time you select a button control, the "_changing" event fires for ALL the buttons, not just the one selected. And then a "_" (blank) event fires for the selected button. Perhaps it was never contemplated that someone would want to see all the events for a button control, but I do. Or maybe it's a known feature that I just stumbled upon. I'm using v10.5 build 3432-3608.
Please confirm if you see the same results, thanks.
Code:
'Buttons seem to fire events TWICE, including an 'unnamed' event dim nTotal as n = 0 dim cTotal as c = "0" ui_dlg_box("Buttons Fire Twice?",<<%dlg% {lf=2}; {wrap=80} When you TAB over to any of these buttons and press ENTER, events fire for ALL the buttons.; {lf=1}; Is this a BUG or is it EXPECTED BEHAVIOR? {lf=3}; {region} Click here to end the demo: | (EndDemo!EndDemo clicked); Total events that fired: | {text=10cTotal} {endregion} {lf=3}; {justify=center,center} <25,2Button 1 - B1!B1_*> <35,2Any Text Here - B2!B2_*> <25,2And One More - B3!B3_*>; <35,2Should be One Event Here - B4!B4> %dlg%,<<%code% nTotal = nTotal + 1 'See how many times we loop through there cTotal = alltrim(str(nTotal)) trace.writeln("E:"+a_dlg_button+", Tot:"+nTotal) 'Show the event if left(a_dlg_button,1) = "B" 'Trap all those events here, then clear it so it loops continuously if right(a_dlg_button,1) = "_" trace.writeln("This event fired: " + a_dlg_button) end if a_dlg_button = "" end if %code%)
Comment