summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesStringWidget.cxx
diff options
context:
space:
mode:
authorBerk Geveci <berk.geveci@kitware.com>2001-11-06 03:10:52 (GMT)
committerBerk Geveci <berk.geveci@kitware.com>2001-11-06 03:10:52 (GMT)
commit4848c81428b8b8218eb86f23451ff32d78c039cd (patch)
tree33efacbfbe9d519bf62302fffbd06e49d7668c88 /Source/CursesDialog/cmCursesStringWidget.cxx
parent1a8e3ba1e666da622e6f9eb8bcf87ebc707eaaf6 (diff)
downloadCMake-4848c81428b8b8218eb86f23451ff32d78c039cd.zip
CMake-4848c81428b8b8218eb86f23451ff32d78c039cd.tar.gz
CMake-4848c81428b8b8218eb86f23451ff32d78c039cd.tar.bz2
Many improvements.
Diffstat (limited to 'Source/CursesDialog/cmCursesStringWidget.cxx')
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx27
1 files changed, 23 insertions, 4 deletions
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index 90ca05c..9bc8232 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -29,12 +29,13 @@ bool cmCursesStringWidget::HandleInput(int& key, FORM* form, WINDOW* w)
// <Enter> is used to change edit mode (like <Esc> in vi).
while(1)
{
- if (!m_InEdit && ( key != 10 ) )
+ // If resize occured during edit, move out of edit mode
+ if (!m_InEdit && ( key != 10 && key != KEY_ENTER ) )
{
return false;
}
// 10 == enter
- if (key == 10)
+ if (key == 10 || key == KEY_ENTER)
{
if (m_InEdit)
{
@@ -53,6 +54,7 @@ bool cmCursesStringWidget::HandleInput(int& key, FORM* form, WINDOW* w)
strcpy(originalStr, buf);
}
}
+ // esc
else if (key == 27)
{
if (m_InEdit)
@@ -73,7 +75,25 @@ bool cmCursesStringWidget::HandleInput(int& key, FORM* form, WINDOW* w)
{
form_driver(form, REQ_NEXT_CHAR);
}
- else if ( key == ctrl('d') || key == 127 )
+ else if ( key == ctrl('k') )
+ {
+ form_driver(form, REQ_CLR_EOL);
+ }
+ else if ( key == ctrl('a') )
+ {
+ form_driver(form, REQ_BEG_FIELD);
+ }
+ else if ( key == ctrl('e') )
+ {
+ form_driver(form, REQ_END_FIELD);
+ }
+ else if ( key == ctrl('d') || key == 127 ||
+ key == KEY_BACKSPACE )
+ {
+ form_driver(form, REQ_DEL_PREV);
+ }
+ else if ( key == ctrl('d') || key == 127 ||
+ key == KEY_BACKSPACE || key == KEY_DC )
{
form_driver(form, REQ_DEL_PREV);
}
@@ -101,6 +121,5 @@ const char* cmCursesStringWidget::GetString()
const char* cmCursesStringWidget::GetValue()
{
- std::cout << field_buffer(m_Field, 0) << std::endl;
return field_buffer(m_Field, 0);
}