Eric Hansen wrote:
I am experiencing something strange in 1.02 release with textfields not
Exhibiting the WANTRETURN behavior in DialogBoxes, but the do in Windows.
The RichEdit control WANTRETURN works with DialogBoxes as shown in the
Code below.   I have to change to a Window to allow the textfield to exhibit
The WANTRETURN behavior.  The textfield code below was mostly borrowed
 From the NotePad.pl   DEMO script.

[code snipped]

Eric,

When posting code, please post short, complete examples that we can run to see the problems that you are describing.

The ES_WANTRETURN style is only useful for multi-line edit controls that are in a Win32::GUI::DialogBox (or Win32::GUI::Window with the -dialogui option set). What is does is stop the 'return' key firing the default action (usually the 'OK' button on the dialog), instead allowing the edit control to see the return key.

The following works as expected for me. Commenting out the -addstyle line stops the Textfield seeing the return key.

#!perl -w
use strict;
use warnings;

use Win32::GUI;

my $mw = Win32::GUI::DialogBox->new(
        -title => "Want Return",
        -pos => [100,100],
        -size => [400,300],
);

$mw->AddTextfield(
        -size => [200,200],
        -multiline => 1,
        -addstyle => ES_WANTRETURN,
);

$mw->Show();
Win32::GUI::Dialog();
exit(0);
__END__

Regards,
Rob.
--
Robert May
Win32::GUI, a perl extension for native Win32 applications
http://perl-win32-gui.sourceforge.net/

Reply via email to