* dialog.c (dlg_key_event): Simplify logic, return void.

This commit is contained in:
Pavel Roskin 2003-10-25 00:22:13 +00:00
parent db8db1268c
commit 26328c7af6
2 changed files with 33 additions and 32 deletions

View File

@ -1,5 +1,7 @@
2003-10-24 Pavel Roskin <proski@gnu.org> 2003-10-24 Pavel Roskin <proski@gnu.org>
* dialog.c (dlg_key_event): Simplify logic, return void.
* dialog.c: Remove duplication between two chains of dialogs. * dialog.c: Remove duplication between two chains of dialogs.
* dialog.h (struct Dlg_head): Add "fullscreen" field, remove * dialog.h (struct Dlg_head): Add "fullscreen" field, remove
"refresh_pushed", rename "previous_dialog" to "parent". "refresh_pushed", rename "previous_dialog" to "parent".

View File

@ -624,22 +624,24 @@ dlg_try_hotkey (Dlg_head *h, int d_key)
return handled; return handled;
} }
static int static void
dlg_key_event (Dlg_head *h, int d_key) dlg_key_event (Dlg_head *h, int d_key)
{ {
int handled; int handled;
if (!h->current) if (!h->current)
return 0; return;
/* TAB used to cycle */ /* TAB used to cycle */
if (!(h->flags & DLG_WANT_TAB) if (!(h->flags & DLG_WANT_TAB)) {
&& (d_key == '\t' || d_key == KEY_BTAB)) { if (d_key == '\t') {
if (d_key == '\t')
dlg_one_down (h); dlg_one_down (h);
else return;
} else if (d_key == KEY_BTAB) {
dlg_one_up (h); dlg_one_up (h);
} else { return;
}
}
/* first can dlg_callback handle the key */ /* first can dlg_callback handle the key */
handled = (*h->callback) (h, DLG_KEY, d_key); handled = (*h->callback) (h, DLG_KEY, d_key);
@ -661,11 +663,8 @@ dlg_key_event (Dlg_head *h, int d_key)
if (!handled) if (!handled)
dialog_handle_key (h, d_key); dialog_handle_key (h, d_key);
(*h->callback) (h, DLG_POST_KEY, d_key);
return handled; (*h->callback) (h, DLG_POST_KEY, d_key);
}
return 1;
} }
static inline int static inline int