Subject: | Enter overrides tabbed selection in dialog box (defined default is chosen) |
This is perl, v5.8.7 built for MSWin32-x86-multi-thread
Binary build 813 [148120] provided by ActiveState http://www.ActiveState.com
Platform: Windows XP SP2 (Build 2600.xpsp_sp2_gdr.050301-1519)
When I bring up a simple dialog box, the default choice is always selected when I press enter, regardless of me having tabbed to another choice. Ie. I tab to "No" in the following example, and press enter, and "YES!" is printed. If I use space to confirm the selection, it works as expected ("No" being chosen and nothing being printed). Choosing with the mouse also works as expected.
This is quite severe as it may very well severely affect the flow of a program, should a user opt to use the keyboard to navigate the dialog boxes.
Code to reproduce:
#######################
my $mw = MainWindow->new;
print "YES!" if GetAnswer('Please reply', 'Do you wish to continue?');
sub GetAnswer {
my ($title, $text) = @_;
my $answer = $mw->Dialog(-title => $title,
-text => $text,
-default_button => 'Yes', -buttons => [ 'Yes', 'No'],
-bitmap => 'question' )->Show( );
return 1 if $answer eq 'Yes';
return 0;
}
#######################