1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
package Padre::Wx::PodFrame;
=pod
=head1 NAME
Padre::Wx::PodFrame - Simple Single-Document Pod2HTML Viewer
=head1 SYNOPSIS
# Create the Pod viewing window
my $frame = Padre::Wx::PodFrame->new;
# Load a Pod file or document
$frame->load_file( 'file.pod' );
$frame->load_pod( "=head1 THIS IS POD!" );
=head1 DESCRIPTION
C<Padre::Wx::PodFrame> provides a simple standalone window containing a
Pod2HTML rendering widget, for displaying a single POD document as
HTML.
=head1 METHODS
=cut
use 5.008;
use strict;
use warnings;
use Padre::Wx ();
our $VERSION = '0.60';
our @ISA = 'Wx::Frame';
=pod
=head2 new
The C<new> constructor creates a new, empty, frame for displaying Pod.
=cut
sub new {
my $class = shift;
my $self = $class->SUPER::new(
undef,
-1,
'POD Viewer',
Wx::wxDefaultPosition,
[ 500, 500 ],
);
# Create the panel within the frame
$self->{panel} = Wx::Panel->new( $self, -1 );
# Create the HTML widget within the panel
require Padre::Wx::HtmlWindow;
$self->{html} = Padre::Wx::HtmlWindow->new( $self->{panel}, -1 );
return $self;
}
=pod
=head2 load_file
$frame->load_file( 'filename.pod' );
The C<load_file> method loads a named file into the POD viewer.
=cut
sub load_file {
my $self = shift;
$self->{html}->load_file(@_);
}
=pod
=head2 load_pod
$frame->load_pod( $pod_string );
The C<load_pod> method loads a document into the POD viewer by providing
the entire document as a string.
=cut
sub load_pod {
my $self = shift;
$self->{html}->load_pod(@_);
}
1;
=pod
=head1 SUPPORT
See the main L<Padre> documentation.
=head1 AUTHOR
Adam Kennedy E<lt>adamk@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright 2008-2010 The Padre development team as listed in Padre.pm.
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.
=cut
|