line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
# Curses::UI::TextViewer |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (c) 2001-2002 by Maurice Makaay. All rights reserved. |
5
|
|
|
|
|
|
|
# This file is part of Curses::UI. Curses::UI is free software. |
6
|
|
|
|
|
|
|
# You can redistribute it and/or modify it under the same terms |
7
|
|
|
|
|
|
|
# as perl itself. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Currently maintained by Marcus Thiesen |
10
|
|
|
|
|
|
|
# e-mail: marcus@cpan.thiesenweb.de |
11
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# TODO: fix dox |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package Curses::UI::TextViewer; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
18
|
1
|
|
|
1
|
|
5
|
use Curses; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3362
|
|
19
|
1
|
|
|
1
|
|
8
|
use Curses::UI::Common; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
125
|
|
20
|
1
|
|
|
1
|
|
6
|
use Curses::UI::TextEditor; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
164
|
use vars qw( |
23
|
|
|
|
|
|
|
$VERSION |
24
|
|
|
|
|
|
|
@ISA |
25
|
1
|
|
|
1
|
|
5
|
); |
|
1
|
|
|
|
|
3
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$VERSION = '1.10'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
@ISA = qw( |
30
|
|
|
|
|
|
|
Curses::UI::TextEditor |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new () |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my %userargs = @_; |
38
|
0
|
|
|
|
|
|
keys_to_lowercase(\%userargs); |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my %args = ( |
41
|
|
|
|
|
|
|
%userargs, |
42
|
|
|
|
|
|
|
-readonly => 1, |
43
|
|
|
|
|
|
|
); |
44
|
0
|
|
|
|
|
|
return $class->SUPER::new( %args); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Curses::UI::TextViewer - Create and manipulate textviewer widgets |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 CLASS HIERARCHY |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Curses::UI::Widget |
59
|
|
|
|
|
|
|
Curses::UI::Searchable |
60
|
|
|
|
|
|
|
| |
61
|
|
|
|
|
|
|
+----Curses::UI::TextEditor |
62
|
|
|
|
|
|
|
| |
63
|
|
|
|
|
|
|
+----Curses::UI::TextViewer |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SYNOPSIS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
use Curses::UI; |
69
|
|
|
|
|
|
|
my $cui = new Curses::UI; |
70
|
|
|
|
|
|
|
my $win = $cui->add('window_id', 'Window'); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $textviewer = $win->add( |
73
|
|
|
|
|
|
|
'mytextviewer', 'TextViewer', |
74
|
|
|
|
|
|
|
-text => "Hello, world!\n" |
75
|
|
|
|
|
|
|
. "Goodbye, world!" |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$textviewer->focus(); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 DESCRIPTION |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Curses::UI::TextViewer is a widget that can be used |
84
|
|
|
|
|
|
|
to create a textviewer widget. This class is |
85
|
|
|
|
|
|
|
derived from Curses::UI::TextEditor. The |
86
|
|
|
|
|
|
|
only special thing about this class is that the |
87
|
|
|
|
|
|
|
B<-readonly> option is forced to a true value. |
88
|
|
|
|
|
|
|
So for the usage of Curses::UI::TextViewer see |
89
|
|
|
|
|
|
|
L. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 SEE ALSO |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L, |
97
|
|
|
|
|
|
|
L, |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 AUTHOR |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Copyright (c) 2001-2002 Maurice Makaay. All rights reserved. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de) |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This package is free software and is provided "as is" without express |
110
|
|
|
|
|
|
|
or implied warranty. It may be used, redistributed and/or modified |
111
|
|
|
|
|
|
|
under the same terms as perl itself. |
112
|
|
|
|
|
|
|
|