Jouke Visser > Wx-Perl-CheckBoxWizardPage-0.03 > Wx::Perl::CheckBoxWizardPage

Download:
Wx-Perl-CheckBoxWizardPage-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

Wx::Perl::CheckBoxWizardPage - A simple Wx::WizardPage subclass for making a selection from checkboxes

SUPERCLASS ^

Wx::Perl::CheckBoxWizardPage is a subclass of Wx::WizardPage

SYNOPSIS ^

    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"  ]);

DESCRIPTION ^

This class allows you to quickly create a wizard page with some text and one or more checkboxes to choose.

USAGE ^

new(wizard, previous, next)

This is the constructor. It takes three arguments:

wizard

This is the (parent) wizard that this page will be part of

previous

This is the previous page in the wizard

next

This is the next page in the wizard

AddText(text)

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...

AddItems(items)

This method takes a listref of strings that will become the labels of the checkboxes. For example:

    $wizardpage->AddItems(['option 1','option 2']);

GetNext

This method is needed for the wizard to work. It returns the next page in the wizard, as defined in the constructor

GetPrev

This method is needed for the wizard to work. It returns the previous page in the wizard, as defined in the constructor

GetSelectionIndex

This method will return a list of index numbers of the selected items (0 is the first item).

GetSelectionLabel

This method will return a list of labels of the selected items

IsAnythingSelected

This method will return 1 if any of the checkboxes have been selected, undef otherwise

SelectionIsOptional(bool)

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.

SetNext(page)

This method will set the next page to the specified Wizard page.

SetPrev(page)

This method will set the previous page to the specified Wizard page.

AUTHOR ^

        Jouke Visser
        jouke@pvoice.org
        http://jouke.pvoice.org

COPYRIGHT ^

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.

SEE ALSO ^

perl(1), Wx, Wx::WizardPage

syntax highlighting: