| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package UI::Various::PoorTerm::Check; | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | # Author, Copyright and License: see end of file | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | =head1 NAME | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | UI::Various::PoorTerm::Check - concrete implementation of L | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | # This module should never be used directly! | 
| 12 |  |  |  |  |  |  | # It is used indirectly via the following: | 
| 13 |  |  |  |  |  |  | use UI::Various::Check; | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | =head1 ABSTRACT | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | This module is the specific minimal fallback implementation of | 
| 18 |  |  |  |  |  |  | L.  It manages and hides everything specific to the last | 
| 19 |  |  |  |  |  |  | resort UI. | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | The documentation of this module is only intended for developers of the | 
| 24 |  |  |  |  |  |  | package itself. | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | =cut | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | ######################################################################### | 
| 29 |  |  |  |  |  |  |  | 
| 30 | 2 |  |  | 2 |  | 21 | use v5.14; | 
|  | 2 |  |  |  |  | 6 |  | 
| 31 | 2 |  |  | 2 |  | 9 | use strictures; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 23 |  | 
| 32 | 2 |  |  | 2 |  | 290 | no indirect 'fatal'; | 
|  | 2 |  |  |  |  | 6 |  | 
|  | 2 |  |  |  |  | 9 |  | 
| 33 | 2 |  |  | 2 |  | 101 | no multidimensional; | 
|  | 2 |  |  |  |  | 10 |  | 
|  | 2 |  |  |  |  | 11 |  | 
| 34 | 2 |  |  | 2 |  | 70 | use warnings 'once'; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 107 |  | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | our $VERSION = '0.22'; | 
| 37 |  |  |  |  |  |  |  | 
| 38 | 2 |  |  | 2 |  | 12 | use UI::Various::core; | 
|  | 2 |  |  |  |  | 2 |  | 
|  | 2 |  |  |  |  | 10 |  | 
| 39 | 2 |  |  | 2 |  | 12 | use UI::Various::Check; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 55 |  | 
| 40 | 2 |  |  | 2 |  | 400 | use UI::Various::PoorTerm::base; | 
|  | 2 |  |  |  |  | 10 |  | 
|  | 2 |  |  |  |  | 629 |  | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | require Exporter; | 
| 43 |  |  |  |  |  |  | our @ISA = qw(UI::Various::Check UI::Various::PoorTerm::base); | 
| 44 |  |  |  |  |  |  | our @EXPORT_OK = qw(); | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | ######################################################################### | 
| 47 |  |  |  |  |  |  | ######################################################################### | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | =head1 METHODS | 
| 50 |  |  |  |  |  |  |  | 
| 51 |  |  |  |  |  |  | =cut | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | ######################################################################### | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | =head2 B<_show> - print UI element | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | $ui_element->_show($prefix); | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | =head3 example: | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | $_->_show('(1) '); | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | =head3 parameters: | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | $prefix             text in front of first line | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | =head3 description: | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  | Show (print) the UI element.  I | 
| 70 |  |  |  |  |  |  | UI::Various::PoorTerm container elements!> | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | =cut | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | sub _show($$) | 
| 77 |  |  |  |  |  |  | { | 
| 78 | 2 |  |  | 2 |  | 2897 | my ($self, $prefix) = @_; | 
| 79 |  |  |  |  |  |  | # Note that the accessors automatically dereference the SCALARs here: | 
| 80 | 2 | 100 |  |  |  | 18 | local $_ = $prefix . '[' . ($self->var ? 'X' : ' ') . '] '; | 
| 81 | 2 |  |  |  |  | 24 | print $self->_wrap($_, $self->text), "\n"; | 
| 82 |  |  |  |  |  |  | } | 
| 83 |  |  |  |  |  |  |  | 
| 84 |  |  |  |  |  |  | ######################################################################### | 
| 85 |  |  |  |  |  |  |  | 
| 86 |  |  |  |  |  |  | =head2 B<_process> - handle action of UI element | 
| 87 |  |  |  |  |  |  |  | 
| 88 |  |  |  |  |  |  | $ui_element->_process; | 
| 89 |  |  |  |  |  |  |  | 
| 90 |  |  |  |  |  |  | =head3 description: | 
| 91 |  |  |  |  |  |  |  | 
| 92 |  |  |  |  |  |  | Handle the action of the UI element (invert the checkbox). | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | =cut | 
| 95 |  |  |  |  |  |  |  | 
| 96 |  |  |  |  |  |  | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | 
| 97 |  |  |  |  |  |  |  | 
| 98 |  |  |  |  |  |  | sub _process($) | 
| 99 |  |  |  |  |  |  | { | 
| 100 | 2 |  |  | 2 |  | 953 | my ($self) = @_; | 
| 101 |  |  |  |  |  |  |  | 
| 102 |  |  |  |  |  |  | # only dereference reading the SCALAR: | 
| 103 | 2 | 100 |  |  |  | 7 | ${$self->{var}} = $self->var ? 0 : 1;	# invert value | 
|  | 2 |  |  |  |  | 5 |  | 
| 104 |  |  |  |  |  |  | } | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  | 1; | 
| 107 |  |  |  |  |  |  |  | 
| 108 |  |  |  |  |  |  | ######################################################################### | 
| 109 |  |  |  |  |  |  | ######################################################################### | 
| 110 |  |  |  |  |  |  |  | 
| 111 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 112 |  |  |  |  |  |  |  | 
| 113 |  |  |  |  |  |  | L, L | 
| 114 |  |  |  |  |  |  |  | 
| 115 |  |  |  |  |  |  | =head1 LICENSE | 
| 116 |  |  |  |  |  |  |  | 
| 117 |  |  |  |  |  |  | Copyright (C) Thomas Dorner. | 
| 118 |  |  |  |  |  |  |  | 
| 119 |  |  |  |  |  |  | This library is free software; you can redistribute it and/or modify it | 
| 120 |  |  |  |  |  |  | under the same terms as Perl itself.  See LICENSE file for more details. | 
| 121 |  |  |  |  |  |  |  | 
| 122 |  |  |  |  |  |  | =head1 AUTHOR | 
| 123 |  |  |  |  |  |  |  | 
| 124 |  |  |  |  |  |  | Thomas Dorner Edorner (at) cpan (dot) orgE | 
| 125 |  |  |  |  |  |  |  | 
| 126 |  |  |  |  |  |  | =cut |