1 package Excel::Template::Container;
7 @ISA = qw(Excel::Template::Base);
9 use Excel::Template::Base;
12 # Containers are objects that can contain arbitrary elements, such as
18 my $self = $class->SUPER::new(@_);
20 $self->{ELEMENTS} = []
21 unless exists $self->{ELEMENTS} &&
22 ref $self->{ELEMENTS} eq 'ARRAY';
27 # Removed as unused code
31 # my ($method, $context) = @_;
33 # for my $e (@{$self->{ELEMENTS}})
35 # $e->enter_scope($context);
36 # $e->$method($context);
37 # $e->exit_scope($context, 1);
43 #sub begin_page { _do_page 'begin_page', @_ }
44 #sub end_page { _do_page 'end_page', @_ }
46 sub iterate_over_children
56 $e->enter_scope($context);
58 my $rc = $e->render($context);
59 $continue = $rc if $continue;
61 $e->exit_scope($context);
67 sub render { $_[0]->iterate_over_children($_[1]) }
72 # return $self->iterate_over_children($context);
75 # Removed as unused code
79 # my ($context, $attr) = @_;
81 # my $max = $context->get($self, $attr);
84 # foreach my $e (@{$self->{ELEMENTS}})
86 # $e->enter_scope($context);
88 # my $v = $e->isa('CONTAINER')
89 # ? $e->max_of($context, $attr)
90 # : $e->calculate($context, $attr);
92 # $max = $v if $max < $v;
94 # $e->exit_scope($context, 1);
103 # my ($context, $attr) = @_;
108 # foreach my $e (@{$self->{ELEMENTS}})
110 # $e->enter_scope($context);
112 # $total += $e->isa('CONTAINER')
113 # ? $e->total_of($context, $attr)
114 # : $e->calculate($context, $attr);
116 # $e->exit_scope($context, 1);
127 Excel::Template::Container
147 Rob Kinyon (rob.kinyon@gmail.com)