--- deliantra/Deliantra-Client/DC/MapWidget.pm 2006/06/15 16:44:20 1.62
+++ deliantra/Deliantra-Client/DC/MapWidget.pm 2006/06/18 17:23:35 1.64
@@ -40,7 +40,7 @@
. "Typing the initial letters of words (or just any letters) displays guesses "
. "for commands you might want to use.\n"
. "You can use the cursor-up and cursor-down keys to select between those guesses.\n"
- . "Right-Click opens a menu where you cna select further options, sich as redefining keybindings.",
+ . "Right-Click opens a menu where you cna select further options, sich as redefining key bindings.",
;
$self
@@ -64,12 +64,12 @@
%{$self->{completer}{command}} = ();
}
-sub button_down {
+sub invoke_button_down {
my ($self, $ev, $x, $y) = @_;
return unless $::CONN;
- $self->focus_in;
+ $self->grab_focus;
if ($ev->{button} == 1) {
my $x = CFClient::floor +($ev->{x} - $self->{sx0}) / $self->{tilesize} - $self->{sx};
@@ -100,7 +100,7 @@
1
}
-sub button_up {
+sub invoke_button_up {
my ($self, $ev, $x, $y) = @_;
delete $self->{motion};
@@ -108,7 +108,7 @@
1
}
-sub mouse_motion {
+sub invoke_mouse_motion {
my ($self, $ev, $x, $y) = @_;
if ($self->{motion}) {
@@ -150,7 +150,7 @@
CFClient::SDLK_LEFT, [7, "west"],
);
-sub key_down {
+sub invoke_key_down {
my ($self, $ev) = @_;
return 0 unless $::CONN;
@@ -197,7 +197,7 @@
$::BIND_EDITOR->set_binding (undef, undef, [],
sub {
my ($mod, $sym, $cmds) = @_;
- $::CFG->{bindings}->{$mod}->{$sym} = $cmds;
+ $::CFG->{profile}{default}{bindings}{$mod}{$sym} = $cmds;
});
$::BIND_EDITOR->start;
$::BIND_EDITOR->show;
@@ -205,7 +205,7 @@
$::BIND_EDITOR->stop;
$::BIND_EDITOR->ask_for_bind_and_commit;
$::BIND_EDITOR->hide;
- } elsif (my $bind_cmd = $::CFG->{bindings}->{$mod}->{$sym}) {
+ } elsif (my $bind_cmd = $::CFG->{profile}{default}{bindings}{$mod}{$sym}) {
$::CONN->user_send ($_) for @$bind_cmd;
} elsif ((ord 'a') <= $uni && $uni <= (ord 'z')) {
$self->{completer}->key_down ($ev);
@@ -217,7 +217,7 @@
1
}
-sub key_up {
+sub invoke_key_up {
my ($self, $ev) = @_;
my $res = 0;
@@ -382,11 +382,12 @@
($::HEIGHT * 0.25, $::HEIGHT * 0.25)
}
-sub size_allocate {
+sub invoke_size_allocate {
my ($self, $w, $h) = @_;
- $self->SUPER::size_allocate ($w, $h);
$self->update;
+
+ 1
}
sub update {
@@ -481,6 +482,7 @@
$self->{entry} = new CFClient::UI::Entry
on_changed => sub {
$self->update_labels;
+ 0
},
on_button_down => sub {
my ($entry, $ev, $x, $y) = @_;
@@ -488,7 +490,7 @@
if ($ev->{button} == 3) {
(new CFClient::UI::Menu
items => [
- ["bind to a key" => sub { $::BIND_EDITOR->do_quick_binding ([$self->{select}], sub { $entry->focus_in }) }]
+ ["bind to a key" => sub { $::BIND_EDITOR->do_quick_binding ([$self->{select}], sub { $entry->grab_focus }) }]
],
)->popup ($ev);
return 1;
@@ -563,18 +565,19 @@
$self->show;
}
-sub size_allocate {
+sub invoke_size_allocate {
my ($self, $w, $h) = @_;
- $self->SUPER::size_allocate ($w, $h);
$self->move_abs (($::WIDTH - $w) * 0.5, ($::HEIGHT - $h) * 0.6, 10);
+
+ $self->SUPER::invoke_size_allocate ($w, $h)
}
sub show {
my ($self) = @_;
$self->SUPER::show;
- $self->{entry}->focus_in;
+ $self->{entry}->grab_focus;
}
sub hide {
@@ -584,7 +587,7 @@
$self->{entry}->set_text ("");
}
-sub key_down {
+sub invoke_key_down {
my ($self, $ev) = @_;
$self->{entry}->key_down ($ev)