ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.382 by root, Thu Jul 19 19:58:56 2007 UTC vs.
Revision 1.383 by root, Fri Jul 20 16:32:04 2007 UTC

1093 1093
1094 0 1094 0
1095 }, 1095 },
1096 ; 1096 ;
1097 1097
1098 $self->SUPER::add (0, 0, $self->{vp}); 1098 $self->SUPER::add_at (0, 0, $self->{vp});
1099 1099
1100 $self->add ($child) if $child; 1100 $self->add ($child) if $child;
1101 1101
1102 $self 1102 $self
1103} 1103}
1118 my ($w1, $w2) = ($child->{w}, $self->{vp}{w}); 1118 my ($w1, $w2) = ($child->{w}, $self->{vp}{w});
1119 $self->{hslider}->set_range ([$self->{hslider}{range}[0], 0, $w1, $w2, 1]); 1119 $self->{hslider}->set_range ([$self->{hslider}{range}[0], 0, $w1, $w2, 1]);
1120 1120
1121 my $visible = $w1 > $w2; 1121 my $visible = $w1 > $w2;
1122 if ($visible != $self->{hslider}{visible}) { 1122 if ($visible != $self->{hslider}{visible}) {
1123 $visible ? $self->SUPER::add (0, 1, $self->{hslider}) 1123 $visible ? $self->SUPER::add_at (0, 1, $self->{hslider})
1124 : $self->{hslider}->hide; 1124 : $self->{hslider}->hide;
1125 } 1125 }
1126 1126
1127 my ($h1, $h2) = ($child->{h}, $self->{vp}{h}); 1127 my ($h1, $h2) = ($child->{h}, $self->{vp}{h});
1128 $self->{vslider}->set_range ([$self->{vslider}{range}[0], 0, $h1, $h2, 1]); 1128 $self->{vslider}->set_range ([$self->{vslider}{range}[0], 0, $h1, $h2, 1]);
1129 1129
1130 my $visible = $h1 > $h2; 1130 my $visible = $h1 > $h2;
1131 if ($visible != $self->{vslider}{visible}) { 1131 if ($visible != $self->{vslider}{visible}) {
1132 $visible ? $self->SUPER::add (1, 0, $self->{vslider}) 1132 $visible ? $self->SUPER::add_at (1, 0, $self->{vslider})
1133 : $self->{vslider}->hide; 1133 : $self->{vslider}->hide;
1134 } 1134 }
1135} 1135}
1136 1136
1137sub update { 1137sub update {
1607 grep $_, map @$_, grep $_, @{ $_[0]{children} } 1607 grep $_, map @$_, grep $_, @{ $_[0]{children} }
1608} 1608}
1609 1609
1610# TODO: store row/col info in child widget and use standard add/del 1610# TODO: store row/col info in child widget and use standard add/del
1611sub add { 1611sub add {
1612 my ($self) = shift; 1612 my $self = shift;
1613
1614 Carp::cluck "please use the add_at method instead of calling add, thank you.\n";#d#
1615 $self->add_at (@_);
1616}
1617
1618sub add_at {
1619 my $self = shift;
1613 1620
1614 while (@_) { 1621 while (@_) {
1615 my ($x, $y, $child) = splice @_, 0, 3, (); 1622 my ($col, $row, $child) = splice @_, 0, 3, ();
1623
1616 $child->set_parent ($self); 1624 $child->set_parent ($self);
1617 $self->{children}[$y][$x] = $child; 1625 $self->{children}[$row][$col] = $child;
1618 } 1626 }
1619 1627
1620 $self->{force_realloc} = 1; 1628 $self->{force_realloc} = 1;
1621 $self->{force_size_alloc} = 1; 1629 $self->{force_size_alloc} = 1;
1622 $self->realloc; 1630 $self->realloc;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines