--- deliantra/Deliantra-Client/DC/UI.pm 2006/06/18 17:13:12 1.305 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/06/21 12:59:23 1.309 @@ -472,9 +472,10 @@ sub emit { my ($self, $signal, @args) = @_; - (List::Util::sum +(map $_->($self, @args), @{$self->{signal_cb}{$signal} || []}), # before - ($self->can ("invoke_$signal") || sub { 1 })->($self, @args)) # closure - || ($self->{parent} && $self->{parent}->emit ($signal, @args)) # parent + #d##TODO# stop propagating at first true, do not use sum + (List::Util::sum map $_->($self, @args), @{$self->{signal_cb}{$signal} || []}) # before + || ($self->can ("invoke_$signal") || sub { 1 })->($self, @args) # closure + || ($self->{parent} && $self->{parent}->emit ($signal, @args)) # parent } sub find_widget { @@ -1893,6 +1894,7 @@ if ($sym == 13) { unshift @{$self->{history}}, my $txt = $self->get_text; + $self->{history_pointer} = -1; $self->{history_saveback} = ''; $self->emit (activate => $txt); @@ -2411,7 +2413,7 @@ $self->{click} = [$self->{range}[0], $self->{vertical} ? $y : $x]; - $self->mouse_motion ($ev, $x, $y) + $self->invoke_mouse_motion ($ev, $x, $y) } sub invoke_mouse_motion { @@ -3472,6 +3474,18 @@ $self } +sub cfg_bind { + my ($self, $mod, $sym, $cmds) = @_; + $::CFG->{profile}{default}{bindings}{$mod}{$sym} = $cmds; + ::update_bindings (); +} + +sub cfg_unbind { + my ($self, $mod, $sym, $cmds) = @_; + delete $::CFG->{profile}{default}{bindings}{$mod}{$sym}; + ::update_bindings (); +} + sub commit { my ($self) = @_; my ($mod, $sym, $cmds) = $self->get_binding; @@ -3551,9 +3565,7 @@ # and then just binds it. sub do_quick_binding { my ($self, $cmds, $end_cb) = @_; - $self->set_binding (undef, undef, $cmds, sub { - $::CFG->{bindings}->{$_[0]}->{$_[1]} = $_[2]; - }); + $self->set_binding (undef, undef, $cmds, sub { $self->cfg_bind (@_) }); $self->ask_for_bind (1, $end_cb); }