| 1 | package TUI::Dialogs::RadioButtons; | ||
| 2 | # ABSTRACT: Radio button cluster control based on TCluster | ||
| 3 | |||
| 4 | 4 | ▶ | use 5.010; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 4 | our $VERSION = '2.000002'; | |
| 9 | 4 | $VERSION =~ tr/_//d; | |
| 10 | 4 | our $AUTHORITY = 'cpan:BRICKPOOL'; | |
| 11 | |||
| 12 | 4 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 4 | our @EXPORT = qw( | |
| 15 | TRadioButtons | ||
| 16 | new_TRadioButtons | ||
| 17 | ); | ||
| 18 | |||
| 19 | 4 | ▶ | use TUI::toolkit; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | 4 | ▶ | use TUI::toolkit::Types qw( :types ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | |||
| 22 | 4 | ▶ | use TUI::Dialogs::Cluster; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | |||
| 24 | sub TRadioButtons() { __PACKAGE__ } | ||
| 25 | sub name() { 'TRadioButtons' } | ||
| 26 | 0 | ▶ | sub new_TRadioButtons { __PACKAGE__->from( @_ ) } |
|
Subroutine
new_TRadioButtons: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | |||
| 28 | 4 | extends TCluster; | |
| 29 | |||
| 30 | # declare global variables | ||
| 31 | 4 | our $button = " ( ) "; | |
| 32 | |||
| 33 | 0 | ▶ | sub draw { # void () |
|
Subroutine
draw: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 34 | 0 | state $sig = signature( | |
| 35 | method => Object, | ||
| 36 | pos => [], | ||
| 37 | ); | ||
| 38 | 0 | my ( $self ) = $sig->( @_ ); | |
| 39 | 0 | $self->drawMultiBox( $button, " \x7" ); | |
| 40 | 0 | return; | |
| 41 | } | ||
| 42 | |||
| 43 | 0 | ▶ | sub mark { # $bool ($item) |
|
Subroutine
mark: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 44 | 0 | state $sig = signature( | |
| 45 | method => Object, | ||
| 46 | pos => [Int], | ||
| 47 | ); | ||
| 48 | 0 | my ( $self, $item ) = $sig->( @_ ); | |
| 49 | 0 | return $item == $self->{value}; | |
| 50 | } | ||
| 51 | |||
| 52 | 0 | ▶ | sub press { # void ($item) |
|
Subroutine
press: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 53 | 0 | state $sig = signature( | |
| 54 | method => Object, | ||
| 55 | pos => [Int], | ||
| 56 | ); | ||
| 57 | 0 | my ( $self, $item ) = $sig->( @_ ); | |
| 58 | 0 | $self->{value} = $item; | |
| 59 | 0 | return; | |
| 60 | } | ||
| 61 | |||
| 62 | 0 | ▶ | sub movedTo { # void ($item) |
|
Subroutine
movedTo: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 63 | 0 | state $sig = signature( | |
| 64 | method => Object, | ||
| 65 | pos => [Int], | ||
| 66 | ); | ||
| 67 | 0 | my ( $self, $item ) = $sig->( @_ ); | |
| 68 | 0 | $self->{value} = $item; | |
| 69 | 0 | return; | |
| 70 | } | ||
| 71 | |||
| 72 | 0 | ▶ | sub setData { # void (\@rec) |
|
Subroutine
setData: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 73 | 0 | state $sig = signature( | |
| 74 | method => Object, | ||
| 75 | pos => [ArrayLike], | ||
| 76 | ); | ||
| 77 | 0 | my ( $self, $rec ) = $sig->( @_ ); | |
| 78 | 0 | $self->SUPER::setData($rec); | |
| 79 | 0 | $self->{sel} = $self->{value}; | |
| 80 | 0 | return; | |
| 81 | } #/ sub setData | ||
| 82 | |||
| 83 | 4 | 1 | |
| 84 | |||
| 85 | __END__ | ||