Jouke Visser > Wx-Perl-RadioBoxWizardPage > Wx::Perl::RadioBoxWizardPage

Download:
Wx-Perl-RadioBoxWizardPage-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Wx::Perl::RadioBoxWizardPage - A simple Wx::WizardPage subclass for making a selection from RadioBoxes

SUPERCLASS ^

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

SYNOPSIS ^

    use Wx::Perl::RadioBoxWizardPage;
    $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} = Wx::Perl::RadioBoxWizardPage->new($self->{_wizard},    # parent
                                                                $self->{_startpage}, # previous page
                                                                $self->{_lastpage}); # next page
    
    $self->{_selectionpage}->AddText("Select one or more options");
    
    $self->{_selectionpage}->AddItems('Take your pick',
                                      [ "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 RadioBoxes 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 RadioBoxes 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(caption, items)

This method takes a caption text and a listref of strings that will become the labels of the radiobuttons. For example:

    $wizardpage->AddItems('Take your pick', ['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

GetSelection

This method will return the index of the selected item (0 is the first item).

GetSelectionLabel

This method will return the label of the selected item

IsAnythingSelected

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

OnPageChanging(sub)

This method will take a subroutine reference, which will be executed when the user wants to go 'back' or 'next' in the wizard. The sub will get the wizard page and the event as the parameters.

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: