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
|
|
28
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
154
|
|
8
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
131
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
22
|
use base qw( Circle::Widget ); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
363
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
24
|
use Carp; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1106
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new |
15
|
|
|
|
|
|
|
{ |
16
|
3
|
|
|
3
|
0
|
94
|
my $class = shift; |
17
|
3
|
|
|
|
|
13
|
my %args = @_; |
18
|
|
|
|
|
|
|
|
19
|
3
|
|
|
|
|
23
|
my $self = $class->SUPER::new( @_ ); |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
16
|
$self->set_prop_orientation( $args{orientation} ); |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
33
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub add |
27
|
|
|
|
|
|
|
{ |
28
|
6
|
|
|
6
|
0
|
15
|
my $self = shift; |
29
|
6
|
|
|
|
|
21
|
my ( $child, %opts ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
6
|
|
|
|
|
17
|
$opts{child} = $child; |
32
|
6
|
|
|
|
|
28
|
$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; |