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
|
|
18
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
106
|
|
8
|
4
|
|
|
4
|
|
17
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
115
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
14
|
use base qw( Circle::Widget ); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
261
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
17
|
use Carp; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
949
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new |
15
|
|
|
|
|
|
|
{ |
16
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
17
|
0
|
|
|
|
|
|
my %args = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new( @_ ); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
$self->set_prop_orientation( $args{orientation} ); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub add |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
29
|
0
|
|
|
|
|
|
my ( $child, %opts ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$opts{child} = $child; |
32
|
0
|
|
|
|
|
|
$self->push_prop_children( \%opts ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub add_spacer |
36
|
|
|
|
|
|
|
{ |
37
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
38
|
0
|
|
|
|
|
|
my ( %opts ) = @_; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# TODO: For now, only allow one spacer, and it must be in expand mode |
41
|
0
|
0
|
|
|
|
|
croak "Already have one spacer, can't add another" if grep { !$_->{child} } @{ $self->get_prop_children }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
croak "Spacer must be in expand mode" if !$opts{expand}; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$self->push_prop_children( \%opts ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
0x55AA; |