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.158 by root, Mon Apr 24 02:41:48 2006 UTC vs.
Revision 1.161 by root, Mon Apr 24 03:43:51 2006 UTC

14our $BUTTON_STATE; 14our $BUTTON_STATE;
15 15
16sub check_tooltip { 16sub check_tooltip {
17 if (!$GRAB) { 17 if (!$GRAB) {
18 for (my $widget = $HOVER; $widget; $widget = $widget->{parent}) { 18 for (my $widget = $HOVER; $widget; $widget = $widget->{parent}) {
19 if (exists $widget->{tooltip}) { 19 if (length $widget->{tooltip}) {
20 20
21 if ($TOOLTIP->{owner} != $widget) { 21 if ($TOOLTIP->{owner} != $widget) {
22 $TOOLTIP->{owner} = $widget; 22 $TOOLTIP->{owner} = $widget;
23 23
24 my $tip = $widget->{tooltip}; 24 my $tip = $widget->{tooltip};
140 $self->connect ($1 => delete $self->{$_}); 140 $self->connect ($1 => delete $self->{$_});
141 } 141 }
142 } 142 }
143 143
144 $self 144 $self
145}
146
147sub destroy {
148 my ($self) = @_;
149
150 $self->hide;
151 %$self = ();
145} 152}
146 153
147sub show { 154sub show {
148 my ($self) = @_; 155 my ($self) = @_;
149 156
1744sub new { 1751sub new {
1745 my ($class, %arg) = @_; 1752 my ($class, %arg) = @_;
1746 1753
1747 my $self = $class->SUPER::new ( 1754 my $self = $class->SUPER::new (
1748 tooltip => $arg{type}, 1755 tooltip => $arg{type},
1756 can_events => 1,
1757 can_hover => 1,
1749 %arg, 1758 %arg,
1750 ); 1759 );
1751 1760
1752 $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999", can_events => 1, can_hover => 1); 1761 $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999");
1753 $self->add ($self->{gauge} = new CFClient::UI::VGauge type => $self->{type}, expand => 1, can_events => 1, can_hover => 1); 1762 $self->add ($self->{gauge} = new CFClient::UI::VGauge type => $self->{type}, expand => 1, can_hover => 1);
1754 $self->add ($self->{max} = new CFClient::UI::Label valign => -1, align => 0, template => "999", can_events => 1, can_hover => 1); 1763 $self->add ($self->{max} = new CFClient::UI::Label valign => -1, align => 0, template => "999");
1755 1764
1756 $self 1765 $self
1757} 1766}
1758 1767
1759sub set_fontsize { 1768sub set_fontsize {
2185} 2194}
2186 2195
2187sub size_request { 2196sub size_request {
2188 my ($self) = @_; 2197 my ($self) = @_;
2189 2198
2190 $self->child->set_max_size ($::WIDTH * 0.2); 2199 $self->child->set_max_size ($::WIDTH * 0.3);
2191 2200
2192 my ($w, $h) = @{$self->child}{qw(req_w req_h)}; 2201 my ($w, $h) = @{$self->child}{qw(req_w req_h)};
2193 2202
2194 ($w + 4, $h + 4) 2203 ($w + 4, $h + 4)
2195} 2204}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines