BBC (British Broadcasting Corporation) > Wx-Perl-VirtualTreeCtrl > Wx::Perl::VirtualDirSelector

Download:
Wx-Perl-VirtualTreeCtrl-1.017.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.008   Source  

NAME ^

Wx::Perl::VirtualDirSelector - A "virtual" clone of the standard DirSelector

DERIVED FROM ^

    Wx::Dialog

SYNOPSIS ^

    use Wx::Perl::VirtualDirSelector;

    my $dirsel = new Wx::Perl::VirtualDirSelector(
        undef, -1, \&OnDirPopulate, 'Select a folder', 'c:\\'
    );

    $dirsel->SetRootLabel('/');
    $dirsel->ExpandRoot();

    if ($dirsel->ShowModal() == wxID_OK) {
        Wx::MessageBox(sprintf "you selected '%s'", $dirsel->GetSelection);
    }

DESCRIPTION

A clone of the standard windows DirSelector (wxDirSelector()), driven by a Wx::Perl::VirtualTreeCtrl.

METHODS

new ($parent, $id, \&dir_populator, $message, $root_data, $style, $pos)

Returns a virtual dir selector (@ISA Wx::Dialog)

    $parent         - parent window (default: TopWindow)
    $id             - window id
    \&dir_populator - coderef to populate virtual tree control
    $message        - Selection prompt (default: 'Select a directory')
    $root_data      - Data assigned to the root item (default: '')
    $style          - dialog style (default: wxDEFAULT_DIALOG_STYLE)
    $pos            - dialog position (default: wxDefaultPosition)

&dir_populator is a Wx::Perl::VirtualTreeCtrl event callback.

ExpandRoot()

Expand the root Item

GetSelection()

Returns the data for the selected tree item.

GetSelectedPath()

Returns a list of path elements from the root node to the selected node.

See the documentation for Wx::Perl::VirtualTreeCtrl::GetPath for more information.

SetImageList($wx_imagelist)

Set a custom Wx::ImageList for the tree control

SetRootItemSelectable(bool)

If FALSE, the OK button will be greyed-out when the root item is selected.

Default: TRUE

SetRootLabel($label)

Set the root item's text label

SetRootImage($image_id, [$which])

Set the root item's image. See Wx::TreeCtrl::GetItemImage for an explanation of the optional $which parameter.

SEE ALSO

Wx::TreeCtrl

The standard tree control from which this object is derived.

Wx::Perl::VirtualTreeCtrl

A tree control that is populated dynamically.

wxWidgets

http://www.wxwidgets.org

wxPerl

http://wxperl.sourceforge.net

AUTHOR

Simon Flack <cpan _at_ bbc _dot_ co _dot_ uk>

COPYRIGHT ^

(c) BBC 2005. This program is free software; you can redistribute it and/or modify it under the GNU GPL.

See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt

syntax highlighting: