Is there a bug in the FilePickerCtrl, or am I doing something wrong
here?

Below is a simple program that displays a window with a single
FilePickerCtrl, with the wxPB_USE_TEXTCTRL option.  This option is
supposed to display the chosen filename in a text box next to the
[Browse] button.  Instead, the text box is displayed ON TOP OF the
button, which is pretty useless.
 
Here's the code:
========
#!perl

use strict;
use Wx;

package MyApp;
use base 'Wx::App';

sub OnInit
{
    my $frame = MyFrame->new();
    $frame->Show (1);
}

package MyFrame;
use base 'Wx::Frame';
use Wx qw(wxPB_USE_TEXTCTRL);

sub new
{
    my $class = shift;
    my $self = $class->SUPER::new(
                                  undef,           # parent window
                                  -1,              # ID -1 means any
                                  'FilePicker test',  # title
                                  [-1, -1],        # default position
                                  [400, 250],      # size
                                 );

    $self->{mypanel} = Wx::Panel->new($self, -1);
    $self->{myfilepick} =
        Wx::FilePickerCtrl->new($self->{mypanel}, -1, 'H:\\',
                                'Choose output file name',
                                'Excel spreadsheets (*.xls)|*.xls',
                                [10, 10],
                                [200, 24],
                                wxPB_USE_TEXTCTRL,
                               );

    return $self;
}

package main;

my $app = MyApp->new;
$app->MainLoop;


Reply via email to