Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

335 lines
8.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ResWiz.h
  7. //
  8. // Abstract:
  9. // Definition of the CCreateResourceWizard class and all pages specific
  10. // to a new resource wizard.
  11. //
  12. // Implementation File:
  13. // ResWiz.cpp
  14. //
  15. // Author:
  16. // David Potter (davidp) September 2, 1996
  17. //
  18. // Revision History:
  19. //
  20. // Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. #ifndef _RESWIZ_H_
  24. #define _RESWIZ_H_
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. /////////////////////////////////////////////////////////////////////////////
  28. #ifndef _BASEWIZ_H_
  29. #include "BaseWiz.h" // for CBaseWizard
  30. #endif
  31. #ifndef _BASEWPAG_H_
  32. #include "BaseWPag.h" // for CBaseWizardPage
  33. #endif
  34. #ifndef _LCPRPAGE_H_
  35. #include "LCPrWPag.h" // for CListCtrlPairWizPage
  36. #endif
  37. #ifndef _RES_H_
  38. #include "Res.h" // for CResourceList
  39. #endif
  40. /////////////////////////////////////////////////////////////////////////////
  41. // Forward Class Declarations
  42. /////////////////////////////////////////////////////////////////////////////
  43. class CNewResNamePage;
  44. class CCreateResourceWizard;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // External Class Declarations
  47. /////////////////////////////////////////////////////////////////////////////
  48. class CGroup;
  49. class CResource;
  50. class CResourceType;
  51. class CClusterDoc;
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CNewResNamePage property page
  54. /////////////////////////////////////////////////////////////////////////////
  55. class CNewResNamePage : public CBaseWizardPage
  56. {
  57. DECLARE_DYNCREATE(CNewResNamePage)
  58. // Construction
  59. public:
  60. CNewResNamePage(void);
  61. // Dialog Data
  62. //{{AFX_DATA(CNewResNamePage)
  63. enum { IDD = IDD_WIZ_RESOURCE_NAME };
  64. CComboBox m_cboxGroups;
  65. CComboBox m_cboxResTypes;
  66. CEdit m_editDesc;
  67. CEdit m_editName;
  68. CString m_strName;
  69. CString m_strDesc;
  70. CString m_strGroup;
  71. CString m_strResType;
  72. BOOL m_bSeparateMonitor;
  73. //}}AFX_DATA
  74. CResourceType * m_pciResType;
  75. CGroup * m_pciGroup;
  76. // Overrides
  77. // ClassWizard generate virtual function overrides
  78. //{{AFX_VIRTUAL(CNewResNamePage)
  79. public:
  80. virtual BOOL OnSetActive();
  81. protected:
  82. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  83. //}}AFX_VIRTUAL
  84. virtual BOOL BApplyChanges(void);
  85. // Implementation
  86. protected:
  87. CCreateResourceWizard * PwizRes(void) const { return (CCreateResourceWizard *) Pwiz(); }
  88. // Generated message map functions
  89. //{{AFX_MSG(CNewResNamePage)
  90. virtual BOOL OnInitDialog();
  91. afx_msg void OnChangeResName();
  92. afx_msg void OnKillFocusResName();
  93. afx_msg void OnDestroy();
  94. //}}AFX_MSG
  95. DECLARE_MESSAGE_MAP()
  96. }; //*** class CNewResNamePage
  97. /////////////////////////////////////////////////////////////////////////////
  98. // CNewResOwnersPage dialog
  99. /////////////////////////////////////////////////////////////////////////////
  100. class CNewResOwnersPage : public CListCtrlPairWizPage
  101. {
  102. DECLARE_DYNCREATE(CNewResOwnersPage)
  103. // Construction
  104. public:
  105. CNewResOwnersPage(void);
  106. // Dialog Data
  107. //{{AFX_DATA(CNewResOwnersPage)
  108. enum { IDD = IDD_WIZ_POSSIBLE_OWNERS };
  109. CStatic m_staticNote;
  110. //}}AFX_DATA
  111. // Callback functions
  112. static void CALLBACK GetColumn(
  113. IN OUT CObject * pobj,
  114. IN int iItem,
  115. IN int icol,
  116. IN OUT CDialog * pdlg,
  117. OUT CString & rstr,
  118. OUT int * piimg
  119. );
  120. static BOOL CALLBACK BDisplayProperties(IN OUT CObject * pobj);
  121. // Overrides
  122. // ClassWizard generate virtual function overrides
  123. //{{AFX_VIRTUAL(CNewResOwnersPage)
  124. public:
  125. virtual BOOL OnSetActive();
  126. protected:
  127. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  128. //}}AFX_VIRTUAL
  129. virtual BOOL BApplyChanges(void);
  130. // Implementation
  131. protected:
  132. CCreateResourceWizard * PwizRes(void) const { return (CCreateResourceWizard *) Pwiz(); }
  133. CResource * PciRes(void) const;
  134. BOOL BInitLists(void);
  135. BOOL BOwnedByPossibleOwner(void) const;
  136. // Generated message map functions
  137. //{{AFX_MSG(CNewResOwnersPage)
  138. virtual BOOL OnInitDialog();
  139. //}}AFX_MSG
  140. DECLARE_MESSAGE_MAP()
  141. }; //*** class CNewResOwnersPage
  142. /////////////////////////////////////////////////////////////////////////////
  143. // CNewResDependsPage dialog
  144. /////////////////////////////////////////////////////////////////////////////
  145. class CNewResDependsPage : public CListCtrlPairWizPage
  146. {
  147. DECLARE_DYNCREATE(CNewResDependsPage)
  148. // Construction
  149. public:
  150. CNewResDependsPage(void);
  151. // Dialog Data
  152. //{{AFX_DATA(CNewResDependsPage)
  153. enum { IDD = IDD_WIZ_DEPENDENCIES };
  154. //}}AFX_DATA
  155. CResourceList m_lpciresAvailable;
  156. CResourceList & LpciresAvailable(void) { return m_lpciresAvailable; }
  157. // Callback functions
  158. static void CALLBACK GetColumn(
  159. IN OUT CObject * pobj,
  160. IN int iItem,
  161. IN int icol,
  162. IN OUT CDialog * pdlg,
  163. OUT CString & rstr,
  164. OUT int * piimg
  165. );
  166. static BOOL CALLBACK BDisplayProperties(IN OUT CObject * pobj);
  167. // Overrides
  168. // ClassWizard generate virtual function overrides
  169. //{{AFX_VIRTUAL(CNewResDependsPage)
  170. protected:
  171. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  172. //}}AFX_VIRTUAL
  173. virtual BOOL BApplyChanges(void);
  174. // Implementation
  175. protected:
  176. CCreateResourceWizard * PwizRes(void) const { return (CCreateResourceWizard *) Pwiz(); }
  177. CResource * PciRes(void) const;
  178. CGroup * PciGroup(void) const;
  179. BOOL BInitLists(void);
  180. // Generated message map functions
  181. //{{AFX_MSG(CNewResDependsPage)
  182. virtual BOOL OnInitDialog();
  183. //}}AFX_MSG
  184. DECLARE_MESSAGE_MAP()
  185. }; //*** class CNewResDependsPage
  186. /////////////////////////////////////////////////////////////////////////////
  187. // CCreateResourceWizard
  188. /////////////////////////////////////////////////////////////////////////////
  189. class CCreateResourceWizard : public CBaseWizard
  190. {
  191. friend class CNewResNamePage;
  192. friend class CNewResOwnersPage;
  193. friend class CNewResDependsPage;
  194. DECLARE_DYNAMIC(CCreateResourceWizard)
  195. // Construction
  196. public:
  197. CCreateResourceWizard(IN OUT CClusterDoc * pdoc, IN OUT CWnd * pParentWnd);
  198. virtual ~CCreateResourceWizard(void);
  199. BOOL BInit(void);
  200. // Attributes
  201. protected:
  202. enum { NumStdPages = 3 };
  203. CWizPage m_rgpages[NumStdPages];
  204. CClusterDoc * m_pdoc;
  205. CString m_strName;
  206. CString m_strDescription;
  207. CStringList m_lstrPossibleOwners;
  208. CResourceType * m_pciResType;
  209. CGroup * m_pciGroup;
  210. public:
  211. CClusterDoc * Pdoc(void) const { return m_pdoc; }
  212. const CString & StrName(void) const { return m_strName; }
  213. const CString & StrDescription(void) const { return m_strDescription; }
  214. const CStringList & LstrPossibleOwners(void) const { return m_lstrPossibleOwners; }
  215. CGroup * PciGroup(void) const { return m_pciGroup; }
  216. CResourceType * PciResType(void) const { return m_pciResType; }
  217. // Operations
  218. public:
  219. BOOL BSetRequiredFields(
  220. IN const CString & rstrName,
  221. IN CResourceType * pciResType,
  222. IN CGroup * pciGroup,
  223. IN BOOL bSeparateMonitor,
  224. IN const CString & rstrDesc
  225. );
  226. // Overrides
  227. protected:
  228. virtual void OnWizardFinish(void);
  229. virtual void OnCancel(void);
  230. virtual CWizPage * Ppages(void);
  231. virtual int Cpages(void);
  232. // ClassWizard generated virtual function overrides
  233. //{{AFX_VIRTUAL(CCreateResourceWizard)
  234. //}}AFX_VIRTUAL
  235. // Implementation
  236. public:
  237. protected:
  238. CNewResNamePage m_pageName;
  239. CNewResOwnersPage m_pageOwners;
  240. CNewResDependsPage m_pageDependencies;
  241. CResource * m_pciRes;
  242. BOOL m_bCreated;
  243. CResource * PciRes(void) const { return m_pciRes; }
  244. BOOL BCreated(void) const { return m_bCreated; }
  245. // Generated message map functions
  246. protected:
  247. //{{AFX_MSG(CCreateResourceWizard)
  248. //}}AFX_MSG
  249. DECLARE_MESSAGE_MAP()
  250. }; //*** class CCreateResourceWizard
  251. /////////////////////////////////////////////////////////////////////////////
  252. // Inline Function Definitions
  253. /////////////////////////////////////////////////////////////////////////////
  254. inline CResource * CNewResOwnersPage::PciRes(void) const
  255. {
  256. ASSERT_VALID(PwizRes());
  257. return PwizRes()->PciRes();
  258. }
  259. inline CResource * CNewResDependsPage::PciRes(void) const
  260. {
  261. ASSERT_VALID(PwizRes());
  262. return PwizRes()->PciRes();
  263. }
  264. inline CGroup * CNewResDependsPage::PciGroup(void) const
  265. {
  266. ASSERT_VALID(PwizRes());
  267. return PwizRes()->PciGroup();
  268. }
  269. /////////////////////////////////////////////////////////////////////////////
  270. #endif // _RESWIZ_H_