Mattia Barbon

NAME

Wx::Perl::BrowseButton - a file/directory browse control

SYNOPSIS

    use Wx::Perl::BrowseButton qw(:everything);

    my $browse = Wx::Perl::BrowseButton->new
        ( $parent, $id, '/home/mbarbon', $position, $size, wxPL_BROWSE_FILE,
          $validator );
    $browse->SetPath( 'C:\\Program Files' );
    my $path = $browse->GetPath

    EVT_PL_BROWSE_PATH_CHANGED( $handler, $browse->GetId, sub {
        my( $self, $event ) = @_;
        print 'New path: ', $event->GetPath;
    };

DESCRIPTION

This simple control displays a text input field asociated with a browse button. The user can either type the path inside the text field or click the browse button to open a file/directory browser.

The control sends a 'path changed' event when either the path is set using the browse dialog or the control loses focus after the contents of the input field have been changed using the keyboard.

CONSTANTS

wxPL_BROWSE_DIR

browse for a directory

wxPL_BROWSE_FILE browse for a file

EVENTS

EVT_PL_BROWSE_PATH_CHANGED( $handler, $id, $function )

Called when the path is changed using the browse button or the path is typed directly in the input field and the field loses focus.

METHODS

new

    my $browse = Wx::Perl::BrowseButton->new
        ( $parent, $id, $initial_path, $position, $size, $style, $validator );

Creates a new browse button.

GetPath

    my $path = $browse->GetPath;

Returns the path currently displayed in the input field.

SetPath

    $browse->SetPath( $path );

Sets the path displayed in the input field. It does not send a 'path changed' event.

AUTHOR

Mattia Barbon <mbarbon@cpan.org>

LICENSE

Copyright (c) 2005 Mattia Barbon <mbarbon@cpan.org>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself