From 6071fea76d7170f446146d6b1e8151857f8170d9 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 22 Aug 2002 15:38:27 +0000 Subject: [PATCH] * editwidget.c: Use new dialog flags. * editcmd.c: Likewise. (edit_completion_dialog): Set DLG_COMPACT for the dialog. --- edit/ChangeLog | 4 ++++ edit/editcmd.c | 21 +++++++++++++-------- edit/editwidget.c | 4 +--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/edit/ChangeLog b/edit/ChangeLog index ba1ecda01..0890cea9b 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,5 +1,9 @@ 2002-08-22 Pavel Roskin + * editwidget.c: Use new dialog flags. + * editcmd.c: Likewise. + (edit_completion_dialog): Set DLG_COMPACT for the dialog. + * editcmd.c (compl_callback): Use common_dialog_repaint(). * editcmd.c (raw_callback): Use standard common_dialog_repaint() diff --git a/edit/editcmd.c b/edit/editcmd.c index b118d5cca..a0957b610 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -481,25 +481,30 @@ int raw_callback (struct Dlg_head *h, int key, int Msg) /* gets a raw key from the keyboard. Passing cancel = 1 draws a cancel button thus allowing c-c etc.. Alternatively, cancel = 0 will return the next key pressed */ -int edit_raw_key_query (char *heading, char *query, int cancel) +int +edit_raw_key_query (char *heading, char *query, int cancel) { int w = strlen (query) + 7; struct Dlg_head *raw_dlg = create_dlg (0, 0, 7, w, dialog_colors, /* NLS ? */ - raw_callback, "[Raw Key Query]", + raw_callback, "[Raw Key Query]", "raw_key_input", - DLG_CENTER | DLG_TRYUP); + DLG_CENTER | DLG_TRYUP | + DLG_WANT_TAB); x_set_dialog_title (raw_dlg, heading); - raw_dlg->raw = 1; /* to return even a tab key */ if (cancel) - add_widget (raw_dlg, button_new (4, w / 2 - 5, B_CANCEL, NORMAL_BUTTON, _("Cancel"), 0, 0, 0)); + add_widget (raw_dlg, + button_new (4, w / 2 - 5, B_CANCEL, NORMAL_BUTTON, + _("Cancel"), 0, 0, 0)); add_widget (raw_dlg, label_new (3 - cancel, 2, query, 0)); - add_widget (raw_dlg, input_new (3 - cancel, w - 5, INPUT_COLOR, 2, "", 0)); + add_widget (raw_dlg, + input_new (3 - cancel, w - 5, INPUT_COLOR, 2, "", 0)); run_dlg (raw_dlg); w = raw_dlg->ret_value; destroy_dlg (raw_dlg); if (cancel) - if (w == XCTRL ('g') || w == XCTRL ('c') || w == ESC_CHAR || w == B_CANCEL) + if (w == XCTRL ('g') || w == XCTRL ('c') || w == ESC_CHAR + || w == B_CANCEL) return 0; /* hence ctrl-a (=B_CANCEL), ctrl-g, ctrl-c, and Esc are cannot returned */ return w; @@ -2555,7 +2560,7 @@ void edit_completion_dialog (WEdit *edit, int max_len, int word_len, /* create the dialog */ compl_dlg = create_dlg (start_y, start_x, compl_dlg_h, compl_dlg_w, dialog_colors, compl_callback, "[Word Completion]", "complete_word", - DLG_NONE); + DLG_COMPACT); /* create the listbox */ compl_list = listbox_new (1, 1, compl_dlg_w - 2, compl_dlg_h - 2, 0, diff --git a/edit/editwidget.c b/edit/editwidget.c index dc83dfff8..849b7cdfa 100644 --- a/edit/editwidget.c +++ b/edit/editwidget.c @@ -124,9 +124,7 @@ int edit (const char *_file, int line) edit_dlg = create_dlg (0, 0, LINES, COLS, midnight_colors, edit_mode_callback, "[Internal File Editor]", "edit", - DLG_NONE); - - edit_dlg->raw = 1; /*so that tab = '\t' key works */ + DLG_WANT_TAB); init_widget (&(wedit->widget), 0, 0, LINES - 1, COLS, (callback_fn) edit_callback,