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.

287 lines
8.6 KiB

  1. // NewNode.h : structures for console created nodes
  2. //
  3. //+-------------------------------------------------------------------------
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 1999
  7. //
  8. // File: NewNode.h
  9. //
  10. // Contents: Definitions for internal data types that can be created by the
  11. // user.
  12. //
  13. // History: 12-Aug-96 WayneSc Created
  14. //
  15. //--------------------------------------------------------------------------
  16. #ifndef __NEWNODE_H__
  17. #define __NEWNODE_H__
  18. #include "dlgs.h"
  19. #include "ccomboex.h"
  20. #define NODE_NOCHANGE 0
  21. #define NODE_NAME_CHANGE 1
  22. #define NODE_TARGET_CHANGE 2
  23. class CSnapinComponentDataImpl;
  24. template<class T>
  25. class CBasePropertyPage : public T
  26. {
  27. typedef CBasePropertyPage<T> ThisClass;
  28. typedef T BaseClass;
  29. public:
  30. CBasePropertyPage() : m_pHelpIDs(NULL) {}
  31. void Initialize(IComponentData *pComponentData)
  32. {
  33. // do not use a smart pointer - causes a circular reference
  34. // the lifetime is managed because the CBasePropertyObject is owned by the IComponentData
  35. m_pComponentData = pComponentData;
  36. }
  37. public:
  38. BEGIN_MSG_MAP(ThisClass)
  39. CHAIN_MSG_MAP(BaseClass)
  40. END_MSG_MAP()
  41. void OnPropertySheetExit(HWND hWndOwner, int nFlag);
  42. protected:
  43. void SetHelpIDs(const DWORD* pHelpIDs)
  44. {
  45. m_pHelpIDs = pHelpIDs;
  46. }
  47. const DWORD* GetHelpIDs(void) const
  48. {
  49. return m_pHelpIDs;
  50. }
  51. private:
  52. const DWORD* m_pHelpIDs;
  53. protected:
  54. CSnapinComponentDataImpl *GetComponentDataImpl()
  55. {
  56. CSnapinComponentDataImpl *pRet = dynamic_cast<CSnapinComponentDataImpl *>(m_pComponentData);
  57. ASSERT(pRet);
  58. return pRet;
  59. }
  60. IComponentData* m_pComponentData;
  61. };
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CHTMLPage1 dialog
  64. class CHTMLPage1 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage1> >
  65. {
  66. typedef CHTMLPage1 ThisClass;
  67. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage1> > BaseClass;
  68. // Construction
  69. public:
  70. CHTMLPage1();
  71. ~CHTMLPage1();
  72. // Dialog Data
  73. enum { IDD = IDD_HTML_WIZPAGE1 };
  74. WTL::CEdit m_strTarget;
  75. // Overrides
  76. public:
  77. BOOL OnSetActive();
  78. BOOL OnKillActive();
  79. // Implementation
  80. protected:
  81. BEGIN_MSG_MAP(ThisClass)
  82. COMMAND_ID_HANDLER( IDC_BROWSEBT, OnBrowseBT )
  83. COMMAND_HANDLER( IDC_TARGETTX, EN_UPDATE, OnUpdateTargetTX )
  84. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  85. CHAIN_MSG_MAP(BaseClass)
  86. END_MSG_MAP()
  87. // Generated message map functions
  88. LRESULT OnBrowseBT( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  89. LRESULT OnUpdateTargetTX( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  90. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  91. //Operators
  92. protected:
  93. void _ValidatePage(void);
  94. };
  95. /////////////////////////////////////////////////////////////////////////////
  96. // CHTMLPage2 dialog
  97. class CHTMLPage2 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage2> >
  98. {
  99. typedef CHTMLPage2 ThisClass;
  100. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage2> > BaseClass;
  101. // Construction
  102. public:
  103. CHTMLPage2();
  104. ~CHTMLPage2();
  105. //Operators
  106. public:
  107. // Dialog Data
  108. enum { IDD = IDD_HTML_WIZPAGE2 };
  109. WTL::CEdit m_strDisplay;
  110. BOOL OnSetActive();
  111. BOOL OnKillActive();
  112. BOOL OnWizardFinish();
  113. // Implementation
  114. protected:
  115. BEGIN_MSG_MAP( CShortcutPage2 );
  116. COMMAND_HANDLER( IDC_DISPLAYTX, EN_UPDATE, OnUpdateDisplayTX )
  117. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  118. CHAIN_MSG_MAP(BaseClass)
  119. END_MSG_MAP();
  120. LRESULT OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  121. LRESULT OnUpdateDisplayTX( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  122. void _ValidatePage(void);
  123. };
  124. /////////////////////////////////////////////////////////////////////////////
  125. /////////////////////////////////////////////////////////////////////////////
  126. /////////////////////////////////////////////////////////////////////////////
  127. // CActiveXPage0 dialog
  128. class CActiveXPage0 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage0> >
  129. {
  130. typedef CActiveXPage0 ThisClass;
  131. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage0> > BaseClass;
  132. // Construction
  133. public:
  134. CActiveXPage0();
  135. ~CActiveXPage0();
  136. // Dialog Data
  137. enum { IDD = IDD_ACTIVEX_WIZPAGE0 };
  138. protected: // implementation
  139. BEGIN_MSG_MAP(ThisClass)
  140. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  141. CHAIN_MSG_MAP(BaseClass)
  142. END_MSG_MAP()
  143. LRESULT OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  144. // Overrides
  145. public:
  146. BOOL OnSetActive();
  147. BOOL OnKillActive();
  148. };
  149. /////////////////////////////////////////////////////////////////////////////
  150. // CActiveXPage1 dialog
  151. class CActiveXPage1 : public CBasePropertyPage<CWizard97InteriorPage<CActiveXPage1> >
  152. {
  153. typedef CActiveXPage1 ThisClass;
  154. typedef CBasePropertyPage<CWizard97InteriorPage<CActiveXPage1> > BaseClass;
  155. // Construction
  156. public:
  157. CActiveXPage1();
  158. ~CActiveXPage1();
  159. // Dialog Data
  160. enum
  161. {
  162. IDD = IDD_ACTIVEX_WIZPAGE1,
  163. IDS_Title = IDS_OCXWiz_ControlPageTitle,
  164. IDS_Subtitle = IDS_OCXWiz_ControlPageSubTitle,
  165. };
  166. WTL::CButton m_InfoBT;
  167. int m_nConsoleView;
  168. BOOL OnSetActive();
  169. BOOL OnKillActive();
  170. // Implementation
  171. protected:
  172. BEGIN_MSG_MAP(ThisClass)
  173. COMMAND_HANDLER(IDC_CATEGORY_COMBOEX, CBN_SELENDOK, OnCategorySelect)
  174. NOTIFY_HANDLER( IDC_CONTROLXLS, NM_CLICK, OnComponentSelect )
  175. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  176. MESSAGE_HANDLER( WM_DESTROY, OnDestroy )
  177. CHAIN_MSG_MAP(BaseClass)
  178. END_MSG_MAP()
  179. LRESULT OnComponentSelect( int idCtrl, LPNMHDR pnmh, BOOL& bHandled );
  180. LRESULT OnCategorySelect( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  181. LRESULT OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  182. LRESULT OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  183. LRESULT BuildCategoryList(CArray <CATEGORYINFO*, CATEGORYINFO*>& arpCategories);
  184. LRESULT BuildComponentList(CArray <CComponentCategory::COMPONENTINFO*,
  185. CComponentCategory::COMPONENTINFO*>& arpComponents);
  186. void _ValidatePage(void);
  187. WTL::CListViewCtrl* m_pListCtrl;
  188. CComboBoxEx2* m_pComboBox;
  189. CComponentCategory* m_pComponentCategory;
  190. };
  191. /////////////////////////////////////////////////////////////////////////////
  192. // CActiveXPage2 dialog
  193. class CActiveXPage2 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage2> >
  194. {
  195. typedef CActiveXPage2 ThisClass;
  196. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage2> > BaseClass;
  197. // Construction
  198. public:
  199. CActiveXPage2();
  200. ~CActiveXPage2();
  201. // Dialog Data
  202. enum { IDD = IDD_ACTIVEX_WIZPAGE2 };
  203. WTL::CEdit m_strDisplay;
  204. BOOL OnSetActive();
  205. BOOL OnKillActive();
  206. BOOL OnWizardFinish();
  207. // Implementation
  208. protected:
  209. BEGIN_MSG_MAP(ThisClass)
  210. COMMAND_HANDLER( IDC_DISPLAYTX, EN_UPDATE, OnUpdateTargetTX )
  211. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  212. CHAIN_MSG_MAP(BaseClass)
  213. END_MSG_MAP()
  214. // Generated message map functions
  215. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  216. LRESULT OnUpdateTargetTX( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  217. void _ValidatePage(void);
  218. };
  219. #endif // __NEWNODE_H__