line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UI::Various::Text; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Author, Copyright and License: see end of file |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
UI::Various::Text - general text widget of L |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use UI::Various; |
12
|
|
|
|
|
|
|
my $main = UI::Various::main(); |
13
|
|
|
|
|
|
|
$main->window(UI::Various::Text->new(text => 'Hello World!'), |
14
|
|
|
|
|
|
|
...); |
15
|
|
|
|
|
|
|
$main->mainloop(); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 ABSTRACT |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
This module defines the general text widget of an application using |
20
|
|
|
|
|
|
|
L. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Besides the common attributes inherited from C the |
25
|
|
|
|
|
|
|
C widget knows only one additional attribute: |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 Attributes |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=over |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
######################################################################### |
34
|
|
|
|
|
|
|
|
35
|
11
|
|
|
11
|
|
110
|
use v5.14; |
|
11
|
|
|
|
|
30
|
|
36
|
11
|
|
|
11
|
|
46
|
use strictures; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
55
|
|
37
|
11
|
|
|
11
|
|
1630
|
no indirect 'fatal'; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
47
|
|
38
|
11
|
|
|
11
|
|
578
|
no multidimensional; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
53
|
|
39
|
11
|
|
|
11
|
|
362
|
use warnings 'once'; |
|
11
|
|
|
|
|
26
|
|
|
11
|
|
|
|
|
534
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
our $VERSION = '0.23'; |
42
|
|
|
|
|
|
|
|
43
|
11
|
|
|
11
|
|
59
|
use UI::Various::core; |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
59
|
|
44
|
11
|
|
|
11
|
|
55
|
use UI::Various::widget; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
532
|
|
45
|
11
|
|
|
11
|
|
43
|
BEGIN { require 'UI/Various/' . UI::Various::core::using() . '/Text.pm'; } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
require Exporter; |
48
|
|
|
|
|
|
|
our @ISA = qw(UI::Various::widget); |
49
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
######################################################################### |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item text [rw, recommended] |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
the text as string or variable reference |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub text($;$) |
60
|
|
|
|
|
|
|
{ |
61
|
87
|
|
|
87
|
1
|
1587
|
return access('text', undef, @_); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
######################################################################### |
65
|
|
|
|
|
|
|
# |
66
|
|
|
|
|
|
|
# internal constants and data: |
67
|
|
|
|
|
|
|
|
68
|
11
|
|
|
|
|
633
|
use constant ALLOWED_PARAMETERS => |
69
|
11
|
|
|
11
|
|
54
|
(UI::Various::widget::COMMON_PARAMETERS, qw(text)); |
|
11
|
|
|
|
|
17
|
|
70
|
11
|
|
|
11
|
|
48
|
use constant DEFAULT_ATTRIBUTES => (text => ''); |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
1179
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
######################################################################### |
73
|
|
|
|
|
|
|
######################################################################### |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=back |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 METHODS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Besides the accessors (attributes) described above and by |
80
|
|
|
|
|
|
|
L and the methods |
81
|
|
|
|
|
|
|
inherited from L only the |
82
|
|
|
|
|
|
|
constructor is provided by the C class itself: |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
######################################################################### |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 B - constructor |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
see L
|
91
|
|
|
|
|
|
|
constructor for UI elements> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub new($;\[@$]) |
98
|
|
|
|
|
|
|
{ |
99
|
17
|
|
|
17
|
1
|
4868
|
debug(3, __PACKAGE__, '::new'); |
100
|
17
|
|
|
|
|
252
|
return construct({ DEFAULT_ATTRIBUTES }, |
101
|
|
|
|
|
|
|
'^(?:' . join('|', ALLOWED_PARAMETERS) . ')$', |
102
|
|
|
|
|
|
|
@_); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
######################################################################### |
108
|
|
|
|
|
|
|
######################################################################### |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 SEE ALSO |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
L |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 LICENSE |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Copyright (C) Thomas Dorner. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it |
119
|
|
|
|
|
|
|
under the same terms as Perl itself. See LICENSE file for more details. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head1 AUTHOR |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Thomas Dorner Edorner (at) cpan (dot) orgE |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |