--- deliantra/Deliantra-Client/DC/UI.pm 2006/08/14 03:41:28 1.347 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/12/06 00:15:12 1.356 @@ -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) @@ -900,11 +900,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; + } }; } @@ -1968,6 +1968,9 @@ $self->{cursor} = 0; } elsif ($sym == CFPlus::SDLK_END) { $self->{cursor} = length $text; + } elsif ($uni == 21) { # ctrl-u + $text = ""; + $self->{cursor} = 0; } elsif ($uni == 27) { $self->emit ('escape'); } elsif ($uni) { @@ -2958,6 +2961,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; @@ -3283,7 +3290,7 @@ our @ISA = CFPlus::UI::HBox::; -# TODO: should actualyl wrap buttons and other goodies. +# TODO: should actually wrap buttons and other goodies. ############################################################################# @@ -3822,10 +3829,11 @@ } elsif ($ev->{button} == 2) { $::CONN->user_send ("invoke $spell->{name}"); } elsif ($ev->{button} == 3) { + my $shortname = CFPlus::shorten $spell->{name}, 14; (new CFPlus::UI::Menu items => [ - ["bind cast $spell->{name} to a key" => sub { $::BIND_EDITOR->do_quick_binding (["cast $spell->{name}"]) }], - ["bind invoke $spell->{name} to a key" => sub { $::BIND_EDITOR->do_quick_binding (["invoke $spell->{name}"]) }], + ["bind cast $shortname to a key" => sub { $::BIND_EDITOR->do_quick_binding (["cast $spell->{name}"]) }], + ["bind invoke $shortname to a key" => sub { $::BIND_EDITOR->do_quick_binding (["invoke $spell->{name}"]) }], ], )->popup ($ev); } else { @@ -3835,7 +3843,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}); @@ -4123,11 +4131,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; + } } #############################################################################