
Wx::Perl::TreeChecker - Tree Control with checkbox functionality

use Wx::Perl::TreeChecker; my $tree = new Wx::Perl::TreeChecker( ... ); $tree -> allow_multiple(0); $tree -> items_only(1); # use tree like a normal treectrl my $tree = new Wx::TreeCtrl(); Wx::Perl::TreeChecker->Convert($tree, $options) my @selection = $tree->GetSelection();

Wx::Perl::TreeChecker is a Wx::TreeCtrl on steroids. It's been given characteristics from a Wx::CheckBox so users can select parts of a tree.
A typical use would be a file-selector for backup / archive.

Exports TC_SELECTED and TC_PART_SELECTED which correspond to the status returned by
$tree -> IsSelected($item)
You can export these constants with the ':status' import tag:
use Wx::Perl::TreeChecker ':status';

The methods listed here are only where there are syntactic differences to Wx::TreeCtrl
Where @std_args are the regular arguments that you would pass to Wx::TreeCtrl->new().
%treechecker is an optional hash of options that customise the way that Wx::Perl::TreeChecker behaves. Valid keys:
allow_multiple # can multiple selections be made (default: TRUE)
containers_only # user can only select containers (default: FALSE)
items_only # user can only select items (default: FALSE)
no_recurse # no recursion when user selects node (default: FALSE)
image_list # Wx::ImageList to use for checkbox icons
# (default provided)
Converts a standard Wx::TreeCtrl into a Wx::Perl::TreeChecker
The first argument is a Wx::TreeCtrl. The seconds argument is an optional hashref as new().
Add a root to the control. Returns root id.
As Wx::TextCtrl::AddRoot, but image indices are removed
Add an item to the control as the last child of $parent. Returns item id.
As Wx::TextCtrl::AppendItem, but image indices are removed
Add a container to the control as the last child of $parent. This does the same as AppendItem() but marks the node as a container.
Add an item to the control as the first child of $parent. Returns item id.
Add a container to the control as the first child of $parent.
Inserts an item after a given one (previous) or before one identified by its position (before).
See InsertItem().
returns the selection status of the item. See Exported flags.
returns TRUE if the item is a container
Select the item, returns TRUE if the item was selected.
Clear the selections on the tree
see new()
see new()
see new()
see new()

A default set of checkbox icons are included. You can override these by supplying a Wx::ImageList to the constructor or the SetImageList method.
The Image list must contain 8 icons, 16 x 16 pixels:
Image number Image description
------------------------------------------------------------------------
0 The root icon
1 Selected root icon
2 Part-selected root icon
3 Container icon
4 Selected container icon
5 Part-selected container icon
6 Item icon
7 Selected item icon

See samples/treechecker.pl

Simon Flack <simonflk _AT_ cpan.org>

I can squash more bugs with your help. Please let me know if you spot something that doesn't work as expected.
You can report bugs via the CPAN RT: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wx-Perl-TreeChecker
If possible, please provide a diff against the test files or sample script that demonstrates the bug(s).

wxWindows: wxTreeCtrl
wxPerl http://wxperl.sourceforge.net

Copyright 2003 Simon Flack <simonflk _AT_ cpan.org>. All rights reserved
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.