Wx::Perl::CheckBoxWizardPage - A simple Wx::WizardPage subclass for making a selection from checkboxes
Wx::Perl::CheckBoxWizardPage is a subclass of Wx::WizardPage
use Wx; $self->{_wizard} = Wx::Wizard->new($self, # parent -1, # id "This is a new Wizard", # title Wx::Bitmap->new('logo.jpg', wxBITMAP_TYPE_JPEG)); # bitmap $self->{_startpage} = Wx::WizardPageSimple->new($self->{_wizard}); $self->{_lastpage} = Wx::WizardPageSimple->new($self->{_wizard}); $self->{_selectionpage} = CheckBoxWizardPage->new($self->{_wizard}, # parent $self->{_startpage}, # previous page $self->{_lastpage}); # next page $self->{_selectionpage}->AddText("Select one or more options"); $self->{_selectionpage}->AddItems([ "Option 1", "Option 2", "Option 3", "Option 4" ]);
This class allows you to quickly create a wizard page with some text and one or more checkboxes to choose.
This is the constructor. It takes three arguments:
This is the (parent) wizard that this page will be part of
This is the previous page in the wizard
This is the next page in the wizard
This method will add some (static) text to the page. Keep in mind that the text will appear above the checkboxes ONLY if you call AddText before you call AddItems. In other words, the controls are added to the page sequentially.
This of course also means you can call AddText multiple times and have multiple static text controls on your page...
This method takes a listref of strings that will become the labels of the checkboxes. For example:
$wizardpage->AddItems(['option 1','option 2']);
This method is needed for the wizard to work. It returns the next page in the wizard, as defined in the constructor
This method is needed for the wizard to work. It returns the previous page in the wizard, as defined in the constructor
This method will return a list of index numbers of the selected items (0 is the first item).
This method will return a list of labels of the selected items
This method will return 1 if any of the checkboxes have been selected, undef otherwise
This method defines wether or not the user is allowed to press 'next' without selecting anything. Default, the user is not allowed to go to the next page without making a selection, which results in a MessageBox with a gentle reminder to select something.
If you call SelectionIsOptional(1), the user is allowed to continue without making a selection.
This method will set the next page to the specified Wizard page.
This method will set the previous page to the specified Wizard page.
Jouke Visser jouke@pvoice.org http://jouke.pvoice.org
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl(1), Wx, Wx::WizardPage
To install Wx::Perl::CheckBoxWizardPage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wx::Perl::CheckBoxWizardPage
CPAN shell
perl -MCPAN -e shell install Wx::Perl::CheckBoxWizardPage
For more information on module installation, please visit the detailed CPAN module installation guide.