--- deliantra/Deliantra-Client/DC/UI.pm 2006/08/17 01:27:28 1.348 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/11/18 23:31:23 1.354 @@ -516,8 +516,8 @@ sub emit { my ($self, $signal, @args) = @_; - # I do not really like this solution, but I dislike duplication - # and needlessly verbose code, too. + # I do not really like this solution, but I do not like duplication + # and needlessly verbose code, either. my @append = $has_coords{$signal} ? $args[0]->xy ($self) @@ -525,10 +525,23 @@ #warn +(caller(1))[3] . "emit $signal on $self (parent $self->{parent})\n";#d# + if ($self->{tooltip} =~ /Apply.*audio/) { + warn "2 ", join ":", @{ $self->{signal_cb}{$signal} || []}, "\n";#d# + warn "3 $self->{parent}\n";#d# + } + #d##TODO# stop propagating at first true, do not use sum + my $res = (List::Util::sum map $_->($self, @args, @append), @{$self->{signal_cb}{$signal} || []}) # before || ($self->can ("invoke_$signal") || sub { 1 })->($self, @args, @append) # closure || ($self->{parent} && $self->{parent}->emit ($signal, @args)) # parent + ; + if ($self->{tooltip} =~ /Apply.*audio/) { + warn "4 ", join ":", @{ $self->{signal_cb}{$signal} || []}, "\n";#d# + warn "5 $self->{parent}\n";#d# + } + + $res } sub find_widget { @@ -900,11 +913,11 @@ { package CFPlus::UI::Base; - ($draw_x, $draw_y, $draw_w, $draw_h) = + local ($draw_x, $draw_y, $draw_w, $draw_h) = (0, 0, $self->{w}, $self->{h}); - } - $self->_render; + $self->_render; + } }; } @@ -1970,6 +1983,7 @@ $self->{cursor} = length $text; } elsif ($uni == 21) { # ctrl-u $text = ""; + $self->{cursor} = 0; } elsif ($uni == 27) { $self->emit ('escape'); } elsif ($uni) { @@ -2960,6 +2974,10 @@ glClearColor 0, 0, 0, 0; glClear GL_COLOR_BUFFER_BIT; + package CFPlus::UI::Base; + local ($draw_x, $draw_y, $draw_w, $draw_h) = + (0, 0, $self->{w}, $self->{h}); + my $top = int $self->{children}[1]{range}[0]; my $paridx = 0; @@ -3285,7 +3303,7 @@ our @ISA = CFPlus::UI::HBox::; -# TODO: should actualyl wrap buttons and other goodies. +# TODO: should actually wrap buttons and other goodies. ############################################################################# @@ -3837,7 +3855,7 @@ 1 }; - my $tooltip = "$spell->{message}$TOOLTIP_ALL"; + my $tooltip = (CFPlus::asxml $spell->{message}) . $TOOLTIP_ALL; #TODO: add path info to tooltip #$self->add (6, $row, new CFPlus::UI::Label text => $spell->{path}); @@ -4125,11 +4143,11 @@ { package CFPlus::UI::Base; - ($draw_x, $draw_y, $draw_w, $draw_h) = + local ($draw_x, $draw_y, $draw_w, $draw_h) = (0, 0, $self->{w}, $self->{h}); - } - $self->_draw; + $self->_draw; + } } #############################################################################