diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2013-09-20 21:47:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-07 18:17:54 (GMT) |
commit | fadffab53879fa67144db9f4899eca1dca506907 (patch) | |
tree | 0cbaebb0d5968e04e6dcca3aec51ade2e67e8f34 /Source/CursesDialog/cmCursesCacheEntryComposite.cxx | |
parent | 5e2b499485d9a418b2ccb191f3d33b5ee34dbb1f (diff) | |
download | CMake-fadffab53879fa67144db9f4899eca1dca506907.zip CMake-fadffab53879fa67144db9f4899eca1dca506907.tar.gz CMake-fadffab53879fa67144db9f4899eca1dca506907.tar.bz2 |
ccmake: Teach dialog to support cache STRINGS property
This commit adds the ability to ccmake of cycling through cache options.
This uses the STRINGS property of the cache entry. The enter key will cycle
forward, and the right and left arrows will go up and down in the list.
Diffstat (limited to 'Source/CursesDialog/cmCursesCacheEntryComposite.cxx')
-rw-r--r-- | Source/CursesDialog/cmCursesCacheEntryComposite.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index c58d037..249137f 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -10,6 +10,7 @@ See the License for more information. ============================================================================*/ #include "cmCursesCacheEntryComposite.h" +#include "cmCursesOptionsWidget.h" #include "cmCursesStringWidget.h" #include "cmCursesLabelWidget.h" #include "cmCursesBoolWidget.h" @@ -69,9 +70,27 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( it.GetValue()); break; case cmCacheManager::STRING: - this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); - static_cast<cmCursesStringWidget*>(this->Entry)->SetString( - it.GetValue()); + if(it.PropertyExists("STRINGS")) + { + cmCursesOptionsWidget* ow = + new cmCursesOptionsWidget(this->EntryWidth, 1, 1, 1); + this->Entry = ow; + std::vector<std::string> options; + cmSystemTools::ExpandListArgument( + std::string(it.GetProperty("STRINGS")), options); + for(std::vector<std::string>::iterator + si = options.begin(); si != options.end(); ++si) + { + ow->AddOption(*si); + } + ow->SetOption(it.GetValue()); + } + else + { + this->Entry = new cmCursesStringWidget(this->EntryWidth, 1, 1, 1); + static_cast<cmCursesStringWidget*>(this->Entry)->SetString( + it.GetValue()); + } break; case cmCacheManager::UNINITIALIZED: cmSystemTools::Error("Found an undefined variable: ", it.GetName()); |