Kevin Ryde > Wx-Perl-PodBrowser > Wx::Perl::PodBrowser

Download:
Wx-Perl-PodBrowser-14.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 14   Source  

NAME ^

Wx::Perl::PodBrowser -- toplevel POD browser window

SYNOPSIS ^

 use Wx::Perl::PodBrowser;
 my $browser = Wx::Perl::PodBrowser->new;
 $browser->Show;
 $browser->goto_pod (module => 'Foo::Bar');

CLASS HIERARCHY ^

Wx::Perl::PodBrowser is a Wx::Frame toplevel window.

    Wx::Object
      Wx::EvtHandler
        Wx::Window
          Wx::TopLevelWindow
            Wx::Frame
              Wx::Perl::PodBrowser

DESCRIPTION ^

This is a POD documentation browser frame. The POD is displayed using Wx::Perl::PodRichText (which is a RichTextCtrl). There's menus for various features and the links in the text can be followed to other documents.

    +-------------------------------------------+
    | File  Section  Help                       |
    +-------------------------------------------+
    | NAME                                      |
    |   Foo - some thing                        |
    | DESCRIPTION                               |
    |   Blah blah.                              |
    | SEE ALSO                                  |
    |   Bar                                     |
    +-------------------------------------------+
    | (statusbar)                               |
    +-------------------------------------------+

Programming

The initial window size follows the 80x30 initial size of the Wx::Perl::PodRichText display widget. Program code or the user can make the window bigger or smaller as desired.

The menubar is available from the usual Wx::Frame method $browser->GetMenuBar() to make additions or modifications. The quit menu item (Wx::wxID_EXIT) closes the window with $browser->quit() described below. In a multi-window program this only closes the PodBrowser window, it doesn't exit the whole program.

See wx-perl-podbrowser for a standalone program running a PodBrowser window. Or see examples/podbrowser.pl in the Wx-Perl-PodBrowser sources for a minimal program.

FUNCTIONS ^

Creation

$browser = Wx::Perl::PodBrowser->new ()
$browser = Wx::Perl::PodBrowser->new ($parent, $id, $title)

Create and return a new browser window widget.

The optional $parent, $id and $title arguments are per Wx::Frame->new().

The default $title is "POD Browser". An application could set something more specific if displaying its own help pages, either when creating the browser or later with the usual Wx::TopLevelWindow method $browser->SetTitle($title).

Methods

$browser->go_back()
$browser->go_forward()

Go back or forward to the next or previous POD module or file. These are the "File/Back" and "File/Forward" menu entries.

$browser->goto_own_pod()

Go to the POD of the PodBrowser module itself. This is the "Help/POD Browser POD" menu entry.

$browser->reload()

Re-read the current POD module or file. This is the "File/Reload" menu entry.

$browser->quit()

Close the PodBrowser window. This is the "File/Quit" menu entry (which is wxID_EXIT). It closes the window with the usual Wx::Frame method $browser->Close().

The EVT_CLOSE() handler does a $browser->Destroy() to destroy the browser. Perhaps there should be an option to only Hide(), so an application could keep a single browser window. Is there a conventional way to choose that?

Printing

$browser->popup_print()

Open a print dialog for the POD document. This is the "File/Print" menu entry (which is wxID_PRINT).

$browser->popup_print_preview()

Open a print-preview dialog for the POD document. This is the "File/Print Preview" menu entry (which is wxID_PREVIEW).

$browser->popup_print_setup()

Open a printer page setup dialog. This is the "File/Page Setup" menu entry (which is wxID_PRINT_SETUP).

About Dialog

$browser->popup_about_dialog()

Open the "about" dialog for $browser. This is the Help/About menu entry (the usual wxID_ABOUT). It displays a Wx::AboutBox() containing the $browser->about_dialog_info() below.

$info = $browser->about_dialog_info()

Return a Wx::AboutDialogInfo object with information about $browser.

SEE ALSO ^

wx-perl-podbrowser, Wx

Other Ways to Do It

Wx::Perl::PodEditor does a similar thing, and in a Wx::RichTextCtrl too, but designed for editing the POD.

Padre::Wx::Frame::POD displays POD in a Wx::HtmlWindow, converted to HTML with a special Pod::Simple::XHTML.

CPANPLUS::Shell::Wx::PODReader also displays POD in a Wx::HtmlWindow, converted to HTML with perldoc -o html, which in recent perldoc means Pod::Simple::Html.

POD browsers in other toolkits include Tk::Pod, Prima::HelpViewer and Gtk2::Ex::PodViewer.

HOME PAGE ^

http://user42.tuxfamily.org/wx-perl-podbrowser/index.html

LICENSE ^

Copyright 2012, 2013 Kevin Ryde

Wx-Perl-PodBrowser is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Wx-Perl-PodBrowser is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Wx-Perl-PodBrowser. If not, see http://www.gnu.org/licenses/.

syntax highlighting: