File Coverage

blib/lib/UI/Various/Text.pm
Criterion Covered Total %
statement 30 30 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod 2 2 100.0
total 44 44 100.0


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   138 use v5.14;
  11         34  
36 11     11   50 use strictures;
  11         16  
  11         51  
37 11     11   1578 no indirect 'fatal';
  11         18  
  11         54  
38 11     11   596 no multidimensional;
  11         19  
  11         66  
39 11     11   356 use warnings 'once';
  11         52  
  11         582  
40              
41             our $VERSION = '0.24';
42              
43 11     11   69 use UI::Various::core;
  11         16  
  11         64  
44 11     11   59 use UI::Various::widget;
  11         20  
  11         606  
45 11     11   71 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 1438 return access('text', undef, @_);
62             }
63              
64             #########################################################################
65             #
66             # internal constants and data:
67              
68 11         677 use constant ALLOWED_PARAMETERS =>
69 11     11   70 (UI::Various::widget::COMMON_PARAMETERS, qw(text));
  11         15  
70 11     11   55 use constant DEFAULT_ATTRIBUTES => (text => '');
  11         19  
  11         1381  
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 4260 debug(3, __PACKAGE__, '::new');
100 17         214 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