19 |
sub auto_align |
sub auto_align |
20 |
{ |
{ |
21 |
my $self = shift; |
my $self = shift; |
22 |
my @alignees = map $_->screen_children, grep $_->screen_children, $self->content; # Find the next level of screen objects |
my @alignees = grep {ref} map {$_->screen_children} $self->content; # Find the next level of screen objects |
23 |
$self->align(@alignees); |
$self->align(@alignees); |
24 |
$self->layout(@alignees); |
$self->layout(@alignees); |
25 |
map {$_->auto_align} @alignees; |
map {$_->auto_align} @alignees; |
29 |
sub align {} |
sub align {} |
30 |
sub layout {} |
sub layout {} |
31 |
|
|
32 |
|
sub lam_x |
33 |
|
{ |
34 |
|
my $self = shift; |
35 |
|
my $x = shift; |
36 |
|
|
37 |
|
$self->attribute("lam:x", $x) if defined ($x); |
38 |
|
return $self->attribute("lam:x"); |
39 |
|
} |
40 |
|
|
41 |
|
sub lam_y |
42 |
|
{ |
43 |
|
my $self = shift; |
44 |
|
my $y = shift; |
45 |
|
|
46 |
|
$self->attribute("lam:y", $y) if defined ($y); |
47 |
|
return $self->attribute("lam:y"); |
48 |
|
} |
49 |
|
|
50 |
sub x |
sub x |
51 |
{ |
{ |
52 |
my $self = shift; |
my $self = shift; |
53 |
my $x = shift; |
my $x = shift; |
54 |
|
|
55 |
$self->attribute("x", $x) if defined ($x); |
$self->attribute("x", $x) if defined ($x); |
56 |
return $self->attribute("x"); |
return defined($self->attribute("x")) ? $self->attribute("x") : $self->lam_x; |
57 |
} |
} |
58 |
|
|
59 |
sub y |
sub y |
62 |
my $y = shift; |
my $y = shift; |
63 |
|
|
64 |
$self->attribute("y", $y) if defined ($y); |
$self->attribute("y", $y) if defined ($y); |
65 |
return $self->attribute("y"); |
return defined($self->attribute("y")) ? $self->attribute("y") : $self->lam_y; |
66 |
} |
} |
67 |
|
|
68 |
sub width |
sub width |
83 |
return $self->attribute("height"); |
return $self->attribute("height"); |
84 |
} |
} |
85 |
|
|
86 |
|
sub cleanup |
87 |
|
{ |
88 |
|
my $self = shift; |
89 |
|
|
90 |
|
map {$self->delete($_)} grep {/^lam:/} $self->attribute_names; |
91 |
|
return $self->SUPER::cleanup; |
92 |
|
} |
93 |
|
|
94 |
1; |
1; |