/[papo]/papo/neb/neb/Tree/VBox.pm
ViewVC logotype

Diff of /papo/neb/neb/Tree/VBox.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by fheinz, Tue Apr 15 14:36:05 2003 UTC revision 1.4 by fheinz, Tue Apr 15 21:21:32 2003 UTC
# Line 20  sub align Line 20  sub align
20      foreach my $object (@alignees)      foreach my $object (@alignees)
21      {      {
22          # If object's width not set, make it as wide as the box          # If object's width not set, make it as wide as the box
23          my $width = $object->width || $object->width($self->width);          my $width = $object->width || $object->width($self->contents_width);
24    
25          # Place object in the vertical according to alignment          # Place object in the vertical according to alignment
26          $object->x($self->x + $self->width - $object->width), next if $alignment =~ /^right$/i;          $object->x($self->contents_origin_x + $self->contents_width - $object->width), next if $alignment =~ /^right$/i;
27          $object->x(int(($self->x + $self->width - $object->width)/2)), next if $alignment =~ /^center$/i;          $object->x(int(($self->contents_origin_x + $self->contents_width - $object->width)/2)), next if $alignment =~ /^center$/i;
28          $object->x($self->x);   # Default case: left alignment          $object->x($self->contents_origin_x);   # Default case: left alignment
29      }      }
30  }  }
31    
# Line 33  sub layout Line 33  sub layout
33  {  {
34      my $self = shift;      my $self = shift;
35      my @alignees = @_;      my @alignees = @_;
36      my $free_space = $self->height;      my $free_space = $self->contents_height;
37      my @stretchable = ();      my @stretchable = ();
38    
39      foreach my $object (@alignees)      foreach my $object (@alignees)
# Line 54  sub layout Line 54  sub layout
54    
55      # Now lay out the elements      # Now lay out the elements
56      my $alignment = $self->valign;      my $alignment = $self->valign;
57      my $cursor = $self->y;      # Default alignment is top      my $cursor = $self->contents_origin_y;      # Default alignment is top
58      $cursor += int($free_space/2) if $alignment =~ /^center$/;      $cursor += int($free_space/2) if $alignment =~ /^center$/;
59      $cursor += $free_space if $alignment =~ /^bottom$/;      $cursor += $free_space if $alignment =~ /^bottom$/;
60      map {$_->y($cursor); $cursor += $_->height} @alignees;      map {$_->y($cursor); $cursor += $_->height} @alignees;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26