line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of the GNU General Public License |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# (C) Paul Evans, 2008-2010 -- leonerd@leonerd.org.uk |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Circle::Widget::Box; |
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
23
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1342
|
|
8
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
92
|
|
9
|
4
|
|
|
4
|
|
15
|
use base qw( Circle::Widget ); |
|
4
|
|
|
|
|
1030
|
|
|
4
|
|
|
|
|
502
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.173320'; |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
23
|
use Carp; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
838
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new |
16
|
|
|
|
|
|
|
{ |
17
|
3
|
|
|
3
|
0
|
105
|
my $class = shift; |
18
|
3
|
|
|
|
|
11
|
my %args = @_; |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
|
|
17
|
my $self = $class->SUPER::new( @_ ); |
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
|
|
14
|
$self->set_prop_orientation( $args{orientation} ); |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
54
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub add |
28
|
|
|
|
|
|
|
{ |
29
|
6
|
|
|
6
|
0
|
11
|
my $self = shift; |
30
|
6
|
|
|
|
|
13
|
my ( $child, %opts ) = @_; |
31
|
|
|
|
|
|
|
|
32
|
6
|
|
|
|
|
11
|
$opts{child} = $child; |
33
|
6
|
|
|
|
|
16
|
$self->push_prop_children( \%opts ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub add_spacer |
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
39
|
0
|
|
|
|
|
|
my ( %opts ) = @_; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# TODO: For now, only allow one spacer, and it must be in expand mode |
42
|
0
|
0
|
|
|
|
|
croak "Already have one spacer, can't add another" if grep { !$_->{child} } @{ $self->get_prop_children }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
croak "Spacer must be in expand mode" if !$opts{expand}; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$self->push_prop_children( \%opts ); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
0x55AA; |