… | |
… | |
292 | $cb->($last_enter_count); |
292 | $cb->($last_enter_count); |
293 | $w->hide; |
293 | $w->hide; |
294 | $w = undef; |
294 | $w = undef; |
295 | } |
295 | } |
296 | ); |
296 | ); |
297 | $entry->focus_in; |
297 | $entry->grab_focus; |
298 | $w->show; |
298 | $w->show; |
299 | |
299 | |
300 | } |
300 | } |
301 | |
301 | |
302 | sub update_widgets { |
302 | sub update_widgets { |
… | |
… | |
456 | sub open_binding_dialog { |
456 | sub open_binding_dialog { |
457 | my ($cb) = @_; |
457 | my ($cb) = @_; |
458 | |
458 | |
459 | my $w = new CFClient::UI::FancyFrame |
459 | my $w = new CFClient::UI::FancyFrame |
460 | title => "Bind Action", |
460 | title => "Bind Action", |
461 | x => "center", |
461 | x => "center", |
462 | y => "center"; |
462 | y => "center", |
|
|
463 | z => 1000, |
|
|
464 | has_close_button => 1; |
463 | |
465 | |
464 | $w->add (my $vb = new CFClient::UI::VBox); |
466 | $w->add (my $vb = new CFClient::UI::VBox); |
465 | $vb->add (new CFClient::UI::Label |
467 | $vb->add (new CFClient::UI::Label |
466 | text => "Press a modifier (CTRL, ALT and/or SHIFT) and a key." |
468 | text => "Press a modifier (CTRL, ALT and/or SHIFT) and a key." |
467 | ."You can only bind 0-9 and F1-F15 without modifiers." |
469 | . "You can only bind 0-9 and F1-F15 without modifiers." |
468 | ); |
470 | ); |
469 | $vb->add (my $entry = new CFClient::UI::Entry |
471 | $vb->add (my $entry = new CFClient::UI::Entry |
470 | text => "", |
472 | text => "", |
471 | on_key_down => sub { |
473 | on_key_down => sub { |
472 | my ($entry, $ev) = @_; |
474 | my ($entry, $ev) = @_; |
… | |
… | |
488 | ." directly without modifier! It would damage the completer handling." |
490 | ." directly without modifier! It would damage the completer handling." |
489 | ); |
491 | ); |
490 | return; |
492 | return; |
491 | } |
493 | } |
492 | |
494 | |
493 | $entry->focus_out; |
495 | $entry->grab_focus; |
494 | |
496 | |
495 | $cb->($mod, $sym); |
497 | $cb->($mod, $sym); |
496 | |
498 | |
497 | $w->destroy |
499 | $w->destroy |
498 | }); |
500 | }); |
499 | |
501 | |
500 | $entry->focus_in; |
502 | $entry->grab_focus; |
501 | $w->show; |
503 | $w->show; |
502 | } |
504 | } |
503 | |
505 | |
504 | sub keycombo_to_name { |
506 | sub keycombo_to_name { |
505 | my ($mod, $sym) = @_; |
507 | my ($mod, $sym) = @_; |