CMakeSetupDialog.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. // CMakeSetupDialogDlg.h : header file
  14. //
  15. #if !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
  16. #define AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif // _MSC_VER > 1000
  20. #include "PropertyList.h"
  21. #include "CMakeGenDialog.h"
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CMakeSetupDialog dialog
  24. class CMakeCommandLineInfo;
  25. class cmake;
  26. class CMakeSetupDialog : public CDialog
  27. {
  28. // Construction
  29. public:
  30. CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
  31. CWnd* pParent = NULL);
  32. ~CMakeSetupDialog();
  33. // return the cmake that is currently being used
  34. cmake *GetCMakeInstance() {
  35. return m_CMakeInstance; }
  36. protected:
  37. //! Load cache file from m_WhereBuild and display in GUI editor
  38. void LoadCacheFromDiskToGUI();
  39. //! Save GUI values to cmCacheManager and then save to disk.
  40. void SaveCacheFromGUI();
  41. void SaveToRegistry();
  42. void LoadFromRegistry();
  43. bool Browse(CString&, const char* title);
  44. void ReadRegistryValue(HKEY hKey,
  45. CString *val,
  46. const char *key,
  47. const char *aadefault);
  48. void ShowAdvancedValues();
  49. void RemoveAdvancedValues();
  50. // Dialog Data
  51. //{{AFX_DATA(CMakeSetupDialog)
  52. enum { IDD = IDD_CMakeSetupDialog_DIALOG };
  53. CButton m_AdvancedValuesControl;
  54. CButton m_BrowseSource;
  55. CButton m_BrowseBuild;
  56. CButton m_HelpButton;
  57. CButton m_DeleteButton;
  58. CButton m_OKButton;
  59. CButton m_CancelButton;
  60. CString m_WhereSource;
  61. CString m_WhereBuild;
  62. CButton m_ListFrame;
  63. bool m_BuildPathChanged;
  64. CComboBox m_WhereSourceControl;
  65. CComboBox m_WhereBuildControl;
  66. CPropertyList m_CacheEntriesList;
  67. CStatic m_MouseHelp;
  68. CStatic m_StatusDisplay;
  69. CButton m_Configure;
  70. BOOL m_AdvancedValues;
  71. //}}AFX_DATA
  72. // ClassWizard generated virtual function overrides
  73. //{{AFX_VIRTUAL(CMakeSetupDialog)
  74. protected:
  75. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  76. //}}AFX_VIRTUAL
  77. // Implementation
  78. protected:
  79. void RunCMake(bool generateProjectFiles);
  80. // copy from the cache manager to the cache edit list box
  81. void FillCacheGUIFromCacheManager();
  82. // copy from the list box to the cache manager
  83. void FillCacheManagerFromCacheGUI();
  84. // Create a shortcut on the desktop with the current Source/Build dir.
  85. int CreateShortcut();
  86. // Set initial directories from a file path.
  87. void ChangeDirectoriesFromFile(const char* arg);
  88. HICON m_hIcon;
  89. CString m_RegistryKey;
  90. CString m_PathToExecutable;
  91. // Generated message map functions
  92. //{{AFX_MSG(CMakeSetupDialog)
  93. virtual BOOL OnInitDialog();
  94. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  95. afx_msg void OnCancel();
  96. afx_msg void OnPaint();
  97. afx_msg HCURSOR OnQueryDragIcon();
  98. afx_msg void OnBrowseWhereSource();
  99. virtual void OnConfigure();
  100. afx_msg void OnBrowseWhereBuild();
  101. afx_msg void OnChangeWhereBuild();
  102. afx_msg void OnSelendokWhereBuild();
  103. afx_msg void OnChangeWhereSource();
  104. afx_msg void OnSelendokWhereSource();
  105. afx_msg void OnSize(UINT nType, int cx, int cy);
  106. afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI );
  107. afx_msg void OnOk();
  108. afx_msg void OnHelpButton();
  109. afx_msg void OnDeleteButton();
  110. afx_msg void OnAdvancedValues();
  111. afx_msg void OnDoubleclickedAdvancedValues();
  112. afx_msg void OnDropFiles(HDROP);
  113. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  114. //}}AFX_MSG
  115. DECLARE_MESSAGE_MAP()
  116. int m_oldCX;
  117. int m_oldCY;
  118. float m_deltaXRemainder;
  119. cmake *m_CMakeInstance;
  120. HCURSOR m_Cursor;
  121. bool m_RunningConfigure;
  122. bool m_GeneratorPicked;
  123. CCMakeGenDialog m_GeneratorDialog;
  124. };
  125. //{{AFX_INSERT_LOCATION}}
  126. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  127. #endif // !defined(AFX_CMakeSetupDialogDLG_H__AC17A6F6_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)