… | |
… | |
246 | } |
246 | } |
247 | |
247 | |
248 | # return top left coordinates |
248 | # return top left coordinates |
249 | sub _topleft { |
249 | sub _topleft { |
250 | my ($self, $x, $y) = @_; |
250 | my ($self, $x, $y) = @_; |
|
|
251 | |
|
|
252 | $self->{parent} |
|
|
253 | or Carp::confess "no parent widget in _topleft\n";#d# |
251 | |
254 | |
252 | $self->{parent}->_topleft ($x + $self->{x}, $y + $self->{y}); |
255 | $self->{parent}->_topleft ($x + $self->{x}, $y + $self->{y}); |
253 | } |
256 | } |
254 | |
257 | |
255 | # translate global coordinates to local coordinate system |
258 | # translate global coordinates to local coordinate system |
… | |
… | |
1824 | |
1827 | |
1825 | sub new { |
1828 | sub new { |
1826 | my ($class, %arg) = @_; |
1829 | my ($class, %arg) = @_; |
1827 | |
1830 | |
1828 | my $self = $class->SUPER::new ( |
1831 | my $self = $class->SUPER::new ( |
1829 | tooltip => $arg{type}, |
1832 | tooltip => $arg{type}, |
1830 | can_hover => 1, |
1833 | can_hover => 1, |
|
|
1834 | can_events => 1, |
1831 | %arg, |
1835 | %arg, |
1832 | ); |
1836 | ); |
1833 | |
1837 | |
1834 | $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999"); |
1838 | $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999"); |
1835 | $self->add ($self->{gauge} = new CFClient::UI::VGauge type => $self->{type}, expand => 1, can_hover => 1); |
1839 | $self->add ($self->{gauge} = new CFClient::UI::VGauge type => $self->{type}, expand => 1, can_hover => 1); |