diff options
author | Berk Geveci <berk.geveci@kitware.com> | 2001-11-30 19:16:28 (GMT) |
---|---|---|
committer | Berk Geveci <berk.geveci@kitware.com> | 2001-11-30 19:16:28 (GMT) |
commit | ca518a593e81c3c0195c7668ffa53eec2acc60a5 (patch) | |
tree | ec479ff212068b15bdf87003c657106a5671335a /Source/CursesDialog | |
parent | e9d40967136a10f69d5e516a77b2ef4d9a8667a5 (diff) | |
download | CMake-ca518a593e81c3c0195c7668ffa53eec2acc60a5.zip CMake-ca518a593e81c3c0195c7668ffa53eec2acc60a5.tar.gz CMake-ca518a593e81c3c0195c7668ffa53eec2acc60a5.tar.bz2 |
Better documentation.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index fc9c0ef..5b9327c 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -26,6 +26,8 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args) : m_AdvancedMode = false; m_NumberOfVisibleEntries = 0; m_OkToGenerate = false; + m_HelpMessage.push_back("Welcome to ccmake, curses based user interface for CMake."); + m_HelpMessage.push_back(""); m_HelpMessage.push_back(s_ConstHelpMessage); } @@ -619,6 +621,32 @@ void cmCursesMainForm::HandleInput() { int x,y; getmaxyx(stdscr, y, x); + + FIELD* cur = current_field(m_Form); + int index = field_index(cur); + cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr( + m_Fields[index-2])); + const char* curField = lbl->GetValue(); + const char* helpString=0; + cmCacheManager::CacheEntry *entry = + cmCacheManager::GetInstance()->GetCacheEntry(curField); + if (entry) + { + helpString = entry->m_HelpString.c_str(); + } + if (helpString) + { + char* message = new char[strlen(curField)+strlen(helpString) + +strlen("Current option is: \n Help string for this option is: \n")+10]; + sprintf(message,"Current option is: %s\nHelp string for this option is: %s\n", curField, helpString); + m_HelpMessage[1] = message; + delete[] message; + } + else + { + m_HelpMessage[1] = ""; + } + cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_HelpMessage, "Help."); CurrentForm = msgs; @@ -736,7 +764,7 @@ void cmCursesMainForm::HandleInput() } } -const char* cmCursesMainForm::s_ConstHelpMessage = "Welcome to ccmake, curses based user interface for CMake.\n" +const char* cmCursesMainForm::s_ConstHelpMessage = "CMake is used to configure and generate build files for software projects. " "The basic steps for configuring a project with ccmake are as follows:\n\n" "1. Run ccmake in the directory where you want the object and executable files to be placed (build directory). If the source directory is not the same as this build directory, you have to specify it as an argument on the command line.\n\n" |