From 5b6e7bcf702dbed1e523e29880efa6d917b1f087 Mon Sep 17 00:00:00 2001 From: Berk Geveci Date: Fri, 30 Nov 2001 15:04:25 -0500 Subject: [PATCH] Improving interface. --- Source/CursesDialog/cmCursesMainForm.cxx | 2 +- Source/CursesDialog/cmCursesStringWidget.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 73b14e619..33d70ba83 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -438,7 +438,6 @@ void cmCursesMainForm::RunCMake(bool generateMakefiles) curses_clear(); curses_move(1,1); - printw("Running CMake, please wait."); touchwin(stdscr); refresh(); endwin(); @@ -795,6 +794,7 @@ const char* cmCursesMainForm::s_ConstHelpMessage = " C-d : delete previous character\n" " C-k : kill the rest of the field\n" " Esc : Restore field (discard last changes)\n" +" Enter : Leave edit mode\n" "You can also delete an option by pressing 'd'\n\n" "Commands:\n" " q : quit ccmake without generating build files\n" diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index 3504b3a59..2bc39d84c 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -54,6 +54,18 @@ bool cmCursesStringWidget::HandleInput(int& key, FORM* form, WINDOW* w) strcpy(originalStr, buf); } } + else if ( key == KEY_DOWN || key == ctrl('n') || + key == KEY_UP || key == ctrl('p') || + key == KEY_NPAGE || key == ctrl('d') || + key == KEY_PPAGE || key == ctrl('u')) + { + m_InEdit = false; + delete[] originalStr; + // trick to force forms to update the field buffer + form_driver(form, REQ_NEXT_FIELD); + form_driver(form, REQ_PREV_FIELD); + return false; + } // esc else if (key == 27) {