Hi,
I have a strange problem with a WxPerl-based program I made a few years ago.
No matter if I run it with Perl directly or from a perlapp package, all the
controls and menus it uses show and work fine, but 2 multiline fields don't
work nor show well.
Actually I don't know how they show, but my screen reader sees them now as
read-only password fields with a star in them, and I can't write inside them.
They are created with the code:
$self->{SourceText} = Wx::TextCtrl->new($self->{panel}, -1,
"", wxDefaultPosition, [500, 200], wxTE_MULTILINE|wxVSCROLL);
They were working well in the past, and they are also working fine in the
Windows executable created with perlapp a few years ago.
Just for testing, I have removed "wxTE_MULTILINE|wxVSCROLL" and I was able to
use them this way.
I use Perl 5.10.1, WxPerl 0.99.0.1 under Windows XP Pro.
Please tell me if the syntax for using a multiline text field has changed, or
if I have done something wrong from the start.
I have included a longer part of code after my message... maybe it helps.
Thanks a lot.
Octavian
sub new {
my ( $class, $config ) = @_;
my $self = $class->SUPER::new( undef, -1, "MT", [ -1, -1 ], [ -1, -1 ] );
#Some lines skipped here - configuration, I18N...
$self->{panel} = Wx::Panel->new( $self, -1, wxDefaultPosition,
wxDefaultSize );
$self->{SourceLanguage_label} = Wx::StaticText->new( $self->{panel}, -1,
t("&Source language:"), wxDefaultPosition, wxDefaultSize );
$self->{SourceLanguage} = Wx::ComboBox->new( $self->{panel}, -1, "",
wxDefaultPosition, wxDefaultSize, [], wxCB_READONLY );
$self->{DestinationLanguage_label} = Wx::StaticText->new( $self->{panel},
-1, t("&Destination language:"), wxDefaultPosition, wxDefaultSize );
$self->{DestinationLanguage} = Wx::ComboBox->new( $self->{panel}, -1, "",
wxDefaultPosition, wxDefaultSize, [], wxCB_READONLY );
# Here is the first control that doesn't work well:
$self->{SourceText} = Wx::TextCtrl->new($self->{panel}, -1, "",
wxDefaultPosition, [500, 200], wxTE_MULTILINE|wxVSCROLL);
#But the following temporary replacement - single line works:
# $self->{SourceText} = Wx::TextCtrl->new( $self->{panel}, -1, "",
wxDefaultPosition, [ 500, 200 ] );
$self->{TranslateButton} = Wx::Button->new( $self->{panel}, -1,
t("&Translate"), wxDefaultPosition, wxDefaultSize );
$self->{TranslateButton}->SetDefault;
$self->{StopButton} = Wx::Button->new( $self->{panel}, -1, t("Stop"),
wxDefaultPosition, wxDefaultSize );
$self->{StopButton}->Disable;
#And here is the second control that doesn't work:
$self->{DestinationText} = Wx::TextCtrl->new($self->{panel}, -1, "",
wxDefaultPosition, [500, 200], wxTE_MULTILINE|wxVSCROLL);
#But its temporary replacement - single line works:
# $self->{DestinationText} = Wx::TextCtrl->new( $self->{panel}, -1, "",
wxDefaultPosition, [ 500, 200 ] );
$self->{ProgressBar} = Wx::Gauge->new( $self->{panel}, -1, 100,
wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL | wxGA_SMOOTH );
$self->{StatusBar} = Wx::StatusBar->new( $self->{panel}, -1 );
$self->{StatusBar}->SetStatusText( t( "MT version {version}", version =>
$VERSION ) );
$self->{sizer0} = Wx::BoxSizer->new(wxVERTICAL);
$self->{sizer0}->Add( $self->{panel}, 1, wxGROW, 0 );
$self->SetSizer( $self->{sizer0} );
$self->{sizer0}->SetSizeHints($self);
$self->{sizer1} = Wx::BoxSizer->new(wxHORIZONTAL);
$self->{sizer1}->AddWindow( $self->{SourceLanguage_label}, 0 );
$self->{sizer1}->AddWindow( $self->{SourceLanguage}, 0 );
$self->{sizer1}->AddWindow( $self->{DestinationLanguage_label}, 0 );
$self->{sizer1}->AddWindow( $self->{DestinationLanguage}, 0 );
$self->{sizer3} = Wx::BoxSizer->new(wxHORIZONTAL);
$self->{sizer3}->AddWindow( $self->{TranslateButton}, 0, wxALIGN_CENTER );
$self->{sizer3}->AddWindow( $self->{StopButton}, 0, wxALIGN_CENTER );
$self->{sizer2} = Wx::BoxSizer->new(wxVERTICAL);
$self->{sizer2}->Add( $self->{sizer1}, 0, wxALIGN_CENTER );
$self->{sizer2}->AddWindow( $self->{SourceText}, 1, wxGROW );
$self->{sizer2}->Add( $self->{sizer3} );
$self->{sizer2}->AddWindow( $self->{DestinationText}, 1, wxGROW );
$self->{sizer2}->AddWindow( $self->{ProgressBar}, 0, wxALIGN_CENTER );
$self->{sizer2}->AddWindow( $self->{StatusBar}, 0, wxGROW );
$self->{panel}->SetSizer( $self->{sizer2} );
$self->{sizer2}->SetSizeHints( $self->{panel} );
$self->SetSize( 700, 600 );
#Here are defined the event handlers for menus and controls
my $sendqueue = Thread::Queue->new;
my $worker = threads->create( \&worker, $self, $sendqueue );
$self->{queue} = $sendqueue;
$self->{worker} = $worker;
$self->Show(1);
return $self;
}