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.151 by root, Sun Apr 23 00:57:39 2006 UTC vs.
Revision 1.153 by root, Sun Apr 23 02:14:33 2006 UTC

1179 1179
1180sub set_fontsize { 1180sub set_fontsize {
1181 my ($self, $fontsize) = @_; 1181 my ($self, $fontsize) = @_;
1182 1182
1183 $self->{fontsize} = $fontsize; 1183 $self->{fontsize} = $fontsize;
1184 delete $self->{texture};
1184 $self->check_size; 1185 $self->check_size;
1186 $self->update;
1185} 1187}
1186 1188
1187sub _draw { 1189sub _draw {
1188 my ($self) = @_; 1190 my ($self) = @_;
1189 1191
2129 $self->emit (changed => $self->{state}); 2131 $self->emit (changed => $self->{state});
2130} 2132}
2131 2133
2132############################################################################# 2134#############################################################################
2133 2135
2136package CFClient::UI::Tooltip;
2137
2138our @ISA = CFClient::UI::Bin::;
2139
2140use CFClient::OpenGL;
2141
2142sub new {
2143 my $class = shift;
2144
2145 $class->SUPER::new (
2146 @_,
2147 can_events => 0,
2148 )
2149}
2150
2151sub set_text {
2152 my ($self, $text) = @_;
2153
2154 $self->{label} ||= new CFClient::UI::Label fontsize => 0.8;
2155 $self->{label}->set_text ($text);
2156 $self->add ($self->{label});
2157}
2158
2159sub size_request {
2160 my ($self) = @_;
2161
2162 my ($w, $h) = @{$self->child}{qw(req_w req_h)};
2163
2164 $w = List::Util::min $::WIDTH * 0.2, $w;
2165
2166 ($w, $h)
2167}
2168
2169#############################################################################
2170
2134package CFClient::UI::Root; 2171package CFClient::UI::Root;
2135 2172
2136our @ISA = CFClient::UI::Container::; 2173our @ISA = CFClient::UI::Container::;
2137 2174
2138use CFClient::OpenGL; 2175use CFClient::OpenGL;
2213############################################################################# 2250#############################################################################
2214 2251
2215package CFClient::UI; 2252package CFClient::UI;
2216 2253
2217$ROOT = new CFClient::UI::Root; 2254$ROOT = new CFClient::UI::Root;
2218$TOOLTIP = new CFClient::UI::Label fontsize => 0.8, can_events => 0; 2255$TOOLTIP = new CFClient::UI::Tooltip;
2219 2256
22201 22571
2221 2258

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines