Source code of Windows XP (NT5)
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.

290 lines
8.4 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. CONTEXT_HELP_HANDLER()
  40. CHAIN_MSG_MAP(BaseClass)
  41. END_MSG_MAP()
  42. IMPLEMENT_CONTEXT_HELP(GetHelpIDs());
  43. void OnPropertySheetExit(HWND hWndOwner, int nFlag);
  44. protected:
  45. void SetHelpIDs(const DWORD* pHelpIDs)
  46. {
  47. m_pHelpIDs = pHelpIDs;
  48. }
  49. const DWORD* GetHelpIDs(void) const
  50. {
  51. return m_pHelpIDs;
  52. }
  53. private:
  54. const DWORD* m_pHelpIDs;
  55. protected:
  56. CSnapinComponentDataImpl *GetComponentDataImpl()
  57. {
  58. CSnapinComponentDataImpl *pRet = dynamic_cast<CSnapinComponentDataImpl *>(m_pComponentData);
  59. ASSERT(pRet);
  60. return pRet;
  61. }
  62. IComponentData* m_pComponentData;
  63. };
  64. /////////////////////////////////////////////////////////////////////////////
  65. // CHTMLPage1 dialog
  66. class CHTMLPage1 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage1> >
  67. {
  68. typedef CHTMLPage1 ThisClass;
  69. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage1> > BaseClass;
  70. // Construction
  71. public:
  72. CHTMLPage1();
  73. ~CHTMLPage1();
  74. // Dialog Data
  75. enum { IDD = IDD_HTML_WIZPAGE1 };
  76. WTL::CEdit m_strTarget;
  77. // Overrides
  78. public:
  79. BOOL OnSetActive();
  80. BOOL OnKillActive();
  81. // Implementation
  82. protected:
  83. BEGIN_MSG_MAP(ThisClass)
  84. COMMAND_ID_HANDLER( IDC_BROWSEBT, OnBrowseBT )
  85. COMMAND_HANDLER( IDC_TARGETTX, EN_UPDATE, OnUpdateTargetTX )
  86. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  87. CHAIN_MSG_MAP(BaseClass)
  88. END_MSG_MAP()
  89. // Generated message map functions
  90. LRESULT OnBrowseBT( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  91. LRESULT OnUpdateTargetTX( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  92. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  93. //Operators
  94. protected:
  95. void _ValidatePage(void);
  96. };
  97. /////////////////////////////////////////////////////////////////////////////
  98. // CHTMLPage2 dialog
  99. class CHTMLPage2 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage2> >
  100. {
  101. typedef CHTMLPage2 ThisClass;
  102. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CHTMLPage2> > BaseClass;
  103. // Construction
  104. public:
  105. CHTMLPage2();
  106. ~CHTMLPage2();
  107. //Operators
  108. public:
  109. // Dialog Data
  110. enum { IDD = IDD_HTML_WIZPAGE2 };
  111. WTL::CEdit m_strDisplay;
  112. BOOL OnSetActive();
  113. BOOL OnKillActive();
  114. BOOL OnWizardFinish();
  115. // Implementation
  116. protected:
  117. BEGIN_MSG_MAP( CShortcutPage2 );
  118. COMMAND_HANDLER( IDC_DISPLAYTX, EN_UPDATE, OnUpdateDisplayTX )
  119. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  120. CHAIN_MSG_MAP(BaseClass)
  121. END_MSG_MAP();
  122. LRESULT OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  123. LRESULT OnUpdateDisplayTX( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  124. void _ValidatePage(void);
  125. };
  126. /////////////////////////////////////////////////////////////////////////////
  127. /////////////////////////////////////////////////////////////////////////////
  128. /////////////////////////////////////////////////////////////////////////////
  129. // CActiveXPage0 dialog
  130. class CActiveXPage0 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage0> >
  131. {
  132. typedef CActiveXPage0 ThisClass;
  133. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage0> > BaseClass;
  134. // Construction
  135. public:
  136. CActiveXPage0();
  137. ~CActiveXPage0();
  138. // Dialog Data
  139. enum { IDD = IDD_ACTIVEX_WIZPAGE0 };
  140. protected: // implementation
  141. BEGIN_MSG_MAP(ThisClass)
  142. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  143. CHAIN_MSG_MAP(BaseClass)
  144. END_MSG_MAP()
  145. LRESULT OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  146. // Overrides
  147. public:
  148. BOOL OnSetActive();
  149. BOOL OnKillActive();
  150. };
  151. /////////////////////////////////////////////////////////////////////////////
  152. // CActiveXPage1 dialog
  153. class CActiveXPage1 : public CBasePropertyPage<CWizard97InteriorPage<CActiveXPage1> >
  154. {
  155. typedef CActiveXPage1 ThisClass;
  156. typedef CBasePropertyPage<CWizard97InteriorPage<CActiveXPage1> > BaseClass;
  157. // Construction
  158. public:
  159. CActiveXPage1();
  160. ~CActiveXPage1();
  161. // Dialog Data
  162. enum
  163. {
  164. IDD = IDD_ACTIVEX_WIZPAGE1,
  165. IDS_Title = IDS_OCXWiz_ControlPageTitle,
  166. IDS_Subtitle = IDS_OCXWiz_ControlPageSubTitle,
  167. };
  168. WTL::CButton m_InfoBT;
  169. int m_nConsoleView;
  170. BOOL OnSetActive();
  171. BOOL OnKillActive();
  172. // Implementation
  173. protected:
  174. BEGIN_MSG_MAP(ThisClass)
  175. COMMAND_HANDLER(IDC_CATEGORY_COMBOEX, CBN_SELENDOK, OnCategorySelect)
  176. NOTIFY_HANDLER( IDC_CONTROLXLS, NM_CLICK, OnComponentSelect )
  177. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  178. MESSAGE_HANDLER( WM_DESTROY, OnDestroy )
  179. CHAIN_MSG_MAP(BaseClass)
  180. END_MSG_MAP()
  181. LRESULT OnComponentSelect( int idCtrl, LPNMHDR pnmh, BOOL& bHandled );
  182. LRESULT OnCategorySelect( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  183. LRESULT OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  184. LRESULT OnDestroy( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
  185. LRESULT BuildCategoryList(CArray <CATEGORYINFO*, CATEGORYINFO*>& arpCategories);
  186. LRESULT BuildComponentList(CArray <CComponentCategory::COMPONENTINFO*,
  187. CComponentCategory::COMPONENTINFO*>& arpComponents);
  188. void _ValidatePage(void);
  189. WTL::CListViewCtrl* m_pListCtrl;
  190. CComboBoxEx2* m_pComboBox;
  191. CComponentCategory* m_pComponentCategory;
  192. };
  193. /////////////////////////////////////////////////////////////////////////////
  194. // CActiveXPage2 dialog
  195. class CActiveXPage2 : public CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage2> >
  196. {
  197. typedef CActiveXPage2 ThisClass;
  198. typedef CBasePropertyPage<CWizard97WelcomeFinishPage<CActiveXPage2> > BaseClass;
  199. // Construction
  200. public:
  201. CActiveXPage2();
  202. ~CActiveXPage2();
  203. // Dialog Data
  204. enum { IDD = IDD_ACTIVEX_WIZPAGE2 };
  205. WTL::CEdit m_strDisplay;
  206. BOOL OnSetActive();
  207. BOOL OnKillActive();
  208. BOOL OnWizardFinish();
  209. // Implementation
  210. protected:
  211. BEGIN_MSG_MAP(ThisClass)
  212. COMMAND_HANDLER( IDC_DISPLAYTX, EN_UPDATE, OnUpdateTargetTX )
  213. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  214. CHAIN_MSG_MAP(BaseClass)
  215. END_MSG_MAP()
  216. // Generated message map functions
  217. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  218. LRESULT OnUpdateTargetTX( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );
  219. void _ValidatePage(void);
  220. };
  221. #endif // __NEWNODE_H__