diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-11-26 23:28:27 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-11-26 23:28:27 (GMT) |
commit | eecf4b9cbf86e64d48f0fa3eb3eb622cb5d366b0 (patch) | |
tree | b363ca85f505b2cd720700bcb71fa47f45459346 /Source/MFCDialog | |
parent | 3e24edcd04234c20a5c3045a7af9ff482fd61a45 (diff) | |
download | CMake-eecf4b9cbf86e64d48f0fa3eb3eb622cb5d366b0.zip CMake-eecf4b9cbf86e64d48f0fa3eb3eb622cb5d366b0.tar.gz CMake-eecf4b9cbf86e64d48f0fa3eb3eb622cb5d366b0.tar.bz2 |
ENH: add advanced variable types and command line wizard gui
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r-- | Source/MFCDialog/CMakeSetup.rc | 14 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 117 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.h | 5 | ||||
-rw-r--r-- | Source/MFCDialog/resource.h | 3 |
4 files changed, 131 insertions, 8 deletions
diff --git a/Source/MFCDialog/CMakeSetup.rc b/Source/MFCDialog/CMakeSetup.rc index 0d799e8..8d0eeb4 100644 --- a/Source/MFCDialog/CMakeSetup.rc +++ b/Source/MFCDialog/CMakeSetup.rc @@ -85,7 +85,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP END -IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 389, 241 +IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 423, 241 STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_APPWINDOW @@ -100,20 +100,22 @@ BEGIN PUSHBUTTON "Browse...",IDC_BUTTON3,230,25,34,13 DEFPUSHBUTTON "Configure",IDC_BuildProjects,70,223,67,15 PUSHBUTTON "Cancel",IDCANCEL,202,223,67,15 - LISTBOX IDC_LIST2,15,55,356,122,LBS_OWNERDRAWVARIABLE | + LISTBOX IDC_LIST2,15,53,393,126,LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL RTEXT "Where is the source code:",IDC_STATIC,6,7,86,9 RTEXT "Where to build the binaries:",IDC_STATIC,5,27,90,9 - GROUPBOX "Cache Values",IDC_FRAME,9,43,369,141 + GROUPBOX "Cache Values",IDC_FRAME,9,44,406,140 LTEXT "Right click on a cache value for additional options and help.\nPress Configure to update and display new values in red.\nPress OK to generate selected build files and exit.", IDC_MouseHelpCaption,103,190,197,27 LTEXT "Static",IDC_CMAKE_VERSION,3,227,52,13,SS_CENTERIMAGE PUSHBUTTON "OK",IDC_OK,142,223,56,14 - COMBOBOX IDC_Generator,275,25,103,50,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_Generator,311,7,103,50,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Build For:",IDC_GeneratorLabel,279,10,103,12 + LTEXT "Build For:",IDC_GeneratorLabel,277,9,31,9 PUSHBUTTON "Help",IDC_HELP_BUTTON,274,223,57,15 + CONTROL "Show Advanced Values",IDC_AdvancedValues,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,277,28,98,9 END IDD_CMAKE_HELP_DIALOG DIALOG DISCARDABLE 0, 0, 365, 183 @@ -188,7 +190,7 @@ BEGIN IDD_CMakeSetupDialog_DIALOG, DIALOG BEGIN - RIGHTMARGIN, 388 + RIGHTMARGIN, 418 BOTTOMMARGIN, 238 END diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index 705d830..fab7aef 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -87,6 +87,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo, m_WhereSource = cmdInfo.m_WhereSource; m_WhereBuild = cmdInfo.m_WhereBuild; m_GeneratorChoiceString = _T(""); + m_AdvancedValues = FALSE; //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); @@ -121,6 +122,7 @@ void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_CMAKE_VERSION, m_VersionDisplay); DDX_Control(pDX, IDC_BuildProjects, m_Configure); DDX_CBStringExact(pDX, IDC_Generator, m_GeneratorChoiceString); + DDX_Check(pDX, IDC_AdvancedValues, m_AdvancedValues); //}}AFX_DATA_MAP } @@ -140,8 +142,10 @@ BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog) ON_WM_GETMINMAXINFO() ON_BN_CLICKED(IDC_OK, OnOk) ON_CBN_EDITCHANGE(IDC_Generator, OnEditchangeGenerator) - ON_BN_CLICKED(IDCANCEL, OnCancel) ON_BN_CLICKED(IDC_HELP_BUTTON, OnHelpButton) + ON_BN_CLICKED(IDCANCEL, OnCancel) + ON_BN_CLICKED(IDC_AdvancedValues, OnAdvancedValues) + ON_BN_DOUBLECLICKED(IDC_AdvancedValues, OnDoubleclickedAdvancedValues) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -617,6 +621,15 @@ void CMakeSetupDialog::FillCacheGUIFromCacheManager() { const char* key = i->first.c_str(); const cmCacheManager::CacheEntry& value = i->second; + if(!m_AdvancedValues) + { + std::string advancedVar = key; + advancedVar += "-ADVANCED"; + if(cmCacheManager::GetInstance()->GetCacheEntry(advancedVar.c_str())) + { + continue; + } + } switch(value.m_Type ) { case cmCacheManager::BOOL: @@ -1006,3 +1019,105 @@ void CMakeSetupDialog::OnHelpButton() CMakeHelp dialog; dialog.DoModal(); } + +void CMakeSetupDialog::ShowAdvancedValues() +{ + const cmCacheManager::CacheEntryMap &cache = + cmCacheManager::GetInstance()->GetCacheMap(); + + for(cmCacheManager::CacheEntryMap::const_iterator i = cache.begin(); + i != cache.end(); ++i) + { + const char* key = i->first.c_str(); + const cmCacheManager::CacheEntry& value = i->second; + if(!cmCacheManager::GetInstance()->IsAdvanced(key)) + { + continue; + } + switch(value.m_Type ) + { + case cmCacheManager::BOOL: + if(cmSystemTools::IsOn(value.m_Value.c_str())) + { + m_CacheEntriesList.AddProperty(key, + "ON", + value.m_HelpString.c_str(), + CPropertyList::COMBO,"ON|OFF", + true + ); + } + else + { + m_CacheEntriesList.AddProperty(key, + "OFF", + value.m_HelpString.c_str(), + CPropertyList::COMBO,"ON|OFF", + true + ); + } + break; + case cmCacheManager::PATH: + m_CacheEntriesList.AddProperty(key, + value.m_Value.c_str(), + value.m_HelpString.c_str(), + CPropertyList::PATH,"", + true + ); + break; + case cmCacheManager::FILEPATH: + m_CacheEntriesList.AddProperty(key, + value.m_Value.c_str(), + value.m_HelpString.c_str(), + CPropertyList::FILE,"", + true + ); + break; + case cmCacheManager::STRING: + m_CacheEntriesList.AddProperty(key, + value.m_Value.c_str(), + value.m_HelpString.c_str(), + CPropertyList::EDIT,"", + true + ); + break; + case cmCacheManager::INTERNAL: + m_CacheEntriesList.RemoveProperty(key); + break; + } + } +} + +void CMakeSetupDialog::RemoveAdvancedValues() +{ + const cmCacheManager::CacheEntryMap &cache = + cmCacheManager::GetInstance()->GetCacheMap(); + + for(cmCacheManager::CacheEntryMap::const_iterator i = cache.begin(); + i != cache.end(); ++i) + { + const char* key = i->first.c_str(); + const cmCacheManager::CacheEntry& value = i->second; + if(cmCacheManager::GetInstance()->IsAdvanced(key)) + { + m_CacheEntriesList.RemoveProperty(key); + } + } +} + +void CMakeSetupDialog::OnAdvancedValues() +{ + this->UpdateData(); + if(m_AdvancedValues) + { + this->ShowAdvancedValues(); + } + else + { + this->RemoveAdvancedValues(); + } +} + +void CMakeSetupDialog::OnDoubleclickedAdvancedValues() +{ + this->OnAdvancedValues(); +} diff --git a/Source/MFCDialog/CMakeSetupDialog.h b/Source/MFCDialog/CMakeSetupDialog.h index 8c6c210..cf03a31 100644 --- a/Source/MFCDialog/CMakeSetupDialog.h +++ b/Source/MFCDialog/CMakeSetupDialog.h @@ -33,6 +33,8 @@ protected: CString *val, const char *key, const char *aadefault); + void ShowAdvancedValues(); + void RemoveAdvancedValues(); // Dialog Data //{{AFX_DATA(CMakeSetupDialog) enum { IDD = IDD_CMakeSetupDialog_DIALOG }; @@ -51,6 +53,7 @@ protected: CStatic m_VersionDisplay; CButton m_Configure; CString m_GeneratorChoiceString; + BOOL m_AdvancedValues; //}}AFX_DATA // ClassWizard generated virtual function overrides @@ -91,6 +94,8 @@ protected: afx_msg void OnOk(); afx_msg void OnEditchangeGenerator(); afx_msg void OnHelpButton(); + afx_msg void OnAdvancedValues(); + afx_msg void OnDoubleclickedAdvancedValues(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/Source/MFCDialog/resource.h b/Source/MFCDialog/resource.h index be740c4..d581f29 100644 --- a/Source/MFCDialog/resource.h +++ b/Source/MFCDialog/resource.h @@ -25,6 +25,7 @@ #define IDC_GeneratorLabel 1020 #define IDC_HELP_BUTTON 1021 #define IDC_EDIT1 1025 +#define IDC_AdvancedValues 1027 // Next default values for new objects // @@ -32,7 +33,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 134 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1026 +#define _APS_NEXT_CONTROL_VALUE 1028 #define _APS_NEXT_SYMED_VALUE 102 #endif #endif |