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.

953 lines
22 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // AtlBaseWizPage.h
  7. //
  8. // Implementation File:
  9. // AtlBaseWizPage.cpp
  10. //
  11. // Description:
  12. // Definition of the CWizardPageWindow and CWizardPageImpl classes.
  13. //
  14. // Author:
  15. // David Potter (davidp) December 2, 1997
  16. //
  17. // Revision History:
  18. //
  19. // Notes:
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. #ifndef __ATLBASEWIZPAGE_H_
  23. #define __ATLBASEWIZPAGE_H_
  24. // Required because of class names longer than 16 characters in lists.
  25. #pragma warning( disable : 4786 ) // identifier was truncated to '255' characters in the browser information
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Forward Class Declarations
  28. /////////////////////////////////////////////////////////////////////////////
  29. class CStaticWizardPageList;
  30. class CDynamicWizardPageList;
  31. class CExtensionWizardPageList;
  32. class CExtensionWizard97PageList;
  33. class CWizardPageList;
  34. class CWizardPageWindow;
  35. class CStaticWizardPageWindow;
  36. class CDynamicWizardPageWindow;
  37. class CExtensionWizardPageWindow;
  38. class CExtensionWizard97PageWindow;
  39. template < class T, class TWin > class CWizardPageImpl;
  40. template < class T > class CStaticWizardPageImpl;
  41. template < class T > class CDynamicWizardPageImpl;
  42. template < class T > class CExtensionWizardPageImpl;
  43. template < class T > class CExtensionWizard97PageImpl;
  44. /////////////////////////////////////////////////////////////////////////////
  45. // External Class Declarations
  46. /////////////////////////////////////////////////////////////////////////////
  47. class CWizardWindow;
  48. class CCluAdmExDll;
  49. /////////////////////////////////////////////////////////////////////////////
  50. // Include Files
  51. /////////////////////////////////////////////////////////////////////////////
  52. #ifndef __ATLBASEPAGE_H_
  53. #include "AtlBasePage.h" // for CBasePageWindow, CBasePageImpl
  54. #endif
  55. #ifndef __ATLDBGWIN_H_
  56. #include "AtlDbgWin.h" // for debugging definitions
  57. #endif
  58. #ifndef __ATLBASEWIZ_H_
  59. #include "AtlBaseWiz.h" // for CWizardWindow (Pwiz() usage)
  60. #endif
  61. /////////////////////////////////////////////////////////////////////////////
  62. // Type Definitions
  63. /////////////////////////////////////////////////////////////////////////////
  64. class CStaticWizardPageList : public std::list< CStaticWizardPageWindow * >
  65. {
  66. }; //*** class CStaticWizardPageList
  67. class CDynamicWizardPageList : public std::list< CDynamicWizardPageWindow * >
  68. {
  69. }; //*** class CDynamicWizardPageList
  70. class CExtensionWizardPageList : public std::list< CExtensionWizardPageWindow * >
  71. {
  72. }; //*** class CExtensionWizardPageList
  73. class CExtensionWizard97PageList : public std::list< CExtensionWizard97PageWindow * >
  74. {
  75. }; //*** class CExtensionWizard97PageList
  76. #define WIZARDPAGE_HEADERTITLEID( ids ) \
  77. static UINT GetWizardPageHeaderTitleId(void) \
  78. { \
  79. return ids; \
  80. }
  81. #define WIZARDPAGE_HEADERSUBTITLEID( ids ) \
  82. static UINT GetWizardPageHeaderSubTitleId(void) \
  83. { \
  84. return ids; \
  85. }
  86. /////////////////////////////////////////////////////////////////////////////
  87. //++
  88. //
  89. // class CWizardPageList
  90. //
  91. // Description:
  92. // List of wizard pages.
  93. //
  94. // Inheritance:
  95. // CWizardPageList
  96. // std::list< CWizardPageWindow * >
  97. //
  98. //--
  99. /////////////////////////////////////////////////////////////////////////////
  100. class CWizardPageList : public std::list< CWizardPageWindow * >
  101. {
  102. typedef std::list< CWizardPageWindow * > baseClass;
  103. public:
  104. // Find page by resource ID
  105. CWizardPageWindow * PwpageFromID( IN LPCTSTR psz );
  106. // Find next page by resource ID
  107. CWizardPageWindow * PwpageNextFromID( IN LPCTSTR psz );
  108. }; //*** class CWizardPageList
  109. /////////////////////////////////////////////////////////////////////////////
  110. //++
  111. //
  112. // class CWizardPageWindow
  113. //
  114. // Description:
  115. // Base wizard property sheet page window.
  116. //
  117. // Inheritance:
  118. // CWizardPageWindow
  119. // CBasePageWindow
  120. // CPropertyPageWindow
  121. //
  122. //--
  123. /////////////////////////////////////////////////////////////////////////////
  124. class CWizardPageWindow : public CBasePageWindow
  125. {
  126. typedef CBasePageWindow baseClass;
  127. friend CWizardWindow;
  128. friend CCluAdmExDll;
  129. public:
  130. //
  131. // Construction
  132. //
  133. // Standard constructor
  134. CWizardPageWindow( HWND hWnd = NULL )
  135. : baseClass( hWnd )
  136. , m_fWizardButtons( 0 )
  137. , m_bBackPressed( FALSE )
  138. , m_bIsPageEnabled( FALSE )
  139. , m_bIsNextPageSet( FALSE )
  140. {
  141. } //*** CWizardPageWindow()
  142. // Destructor
  143. virtual ~CWizardPageWindow( void )
  144. {
  145. } //*** ~CWizardPageWindow()
  146. public:
  147. //
  148. // CWizardPageWindow public methods.
  149. //
  150. // Enable or disable the Next button
  151. void EnableNext( IN BOOL bEnable = TRUE )
  152. {
  153. ATLASSERT( Pwiz() != NULL );
  154. //
  155. // Ask the wizard to enable or disable the Next button.
  156. //
  157. Pwiz()->EnableNext( bEnable, FWizardButtons() );
  158. } //*** EnableNext()
  159. // Set the next page to be enabled
  160. void SetNextPage( IN LPCTSTR pszNextPage )
  161. {
  162. Pwiz()->SetNextPage( this, pszNextPage );
  163. m_bIsNextPageSet = TRUE;
  164. } //*** SetNextPage()
  165. // Set the next page to be enabled from a dialog ID
  166. void SetNextPage( IN UINT idNextPage )
  167. {
  168. Pwiz()->SetNextPage( this, idNextPage );
  169. m_bIsNextPageSet = TRUE;
  170. } //*** SetNextPage()
  171. public:
  172. //
  173. // Message handler functions.
  174. //
  175. // Handler for PSN_SETACTIVE
  176. BOOL OnSetActive( void )
  177. {
  178. if ( ! m_bIsPageEnabled )
  179. {
  180. return FALSE;
  181. } // if: page is not enabled to be displayed
  182. SetWizardButtons();
  183. m_bBackPressed = FALSE;
  184. return baseClass::OnSetActive();
  185. } //*** OnSetActive()
  186. // Handler for PSN_WIZBACK
  187. int OnWizardBack( void )
  188. {
  189. m_bBackPressed = TRUE;
  190. int nResult = baseClass::OnWizardBack();
  191. if ( ! UpdateData( TRUE /*bSaveAndValidate*/ ) )
  192. {
  193. nResult = -1;
  194. } // if: error updating data
  195. if ( nResult == -1 ) // if not successful
  196. {
  197. m_bBackPressed = FALSE;
  198. } // if: failure occurred
  199. else if ( nResult == 0 ) // defaulting to go to next page
  200. {
  201. } // else if: no next page specified
  202. return nResult;
  203. } //*** OnWizardBack()
  204. // Handler for PSN_WIZNEXT
  205. int OnWizardNext( void )
  206. {
  207. // Update the data in the class from the page.
  208. if ( ! UpdateData( TRUE /*bSaveAndValidate*/ ) )
  209. {
  210. return -1;
  211. } // if: error updating data
  212. // Save the data in the sheet.
  213. if ( ! BApplyChanges() )
  214. {
  215. return -1;
  216. } // if: error applying changes
  217. int nResult = baseClass::OnWizardNext();
  218. return nResult;
  219. } //*** OnWizardNext()
  220. // Handler for PSN_WIZFINISH
  221. BOOL OnWizardFinish( void )
  222. {
  223. if ( BIsPageEnabled() )
  224. {
  225. // Update the data in the class from the page.
  226. if ( ! UpdateData( TRUE /*bSaveAndValidate*/ ) )
  227. {
  228. return FALSE;
  229. } // if: error updating data
  230. // Save the data in the sheet.
  231. if ( ! BApplyChanges() )
  232. {
  233. return FALSE;
  234. } // if: error applying changes
  235. } // if: page is enabled
  236. return baseClass::OnWizardFinish();
  237. } //*** OnWizardFinish()
  238. // Handler for PSN_RESET
  239. void OnReset( void )
  240. {
  241. Pwiz()->OnReset();
  242. baseClass::OnReset();
  243. } //*** OnReset()
  244. // Implementation
  245. protected:
  246. DWORD m_fWizardButtons;
  247. BOOL m_bBackPressed;
  248. BOOL m_bIsPageEnabled;
  249. BOOL m_bIsNextPageSet;
  250. CString m_strHeaderTitle;
  251. CString m_strHeaderSubTitle;
  252. DWORD FWizardButtons( void ) const { return m_fWizardButtons; }
  253. BOOL BBackPressed( void ) const { return m_bBackPressed; }
  254. BOOL BIsPageEnabled( void ) const { return m_bIsPageEnabled; }
  255. BOOL BIsNextPageSet( void ) const { return m_bIsNextPageSet; }
  256. const CString & StrHeaderTitle( void ) const { return m_strHeaderTitle; }
  257. const CString & StrHeaderSubTitle( void ) const { return m_strHeaderSubTitle; }
  258. CWizardWindow * Pwiz( void ) const { return (CWizardWindow *) Psht(); }
  259. // Set default wizard buttons to be displayed with page
  260. void SetDefaultWizardButtons( IN DWORD fWizardButtons )
  261. {
  262. ATLASSERT( fWizardButtons != 0 );
  263. m_fWizardButtons = fWizardButtons;
  264. } //*** SetDefaultWizardButtons()
  265. public:
  266. // Set wizard buttons on the wizard
  267. void SetWizardButtons( void )
  268. {
  269. ATLASSERT( m_fWizardButtons != 0 );
  270. Pwiz()->SetWizardButtons( m_fWizardButtons );
  271. } //*** SetWizardButtons()
  272. // Enable or disable the page
  273. void EnablePage( IN BOOL bEnable = TRUE )
  274. {
  275. m_bIsPageEnabled = bEnable;
  276. } //*** EnablePage()
  277. }; //*** class CWizardPageWindow
  278. /////////////////////////////////////////////////////////////////////////////
  279. //++
  280. //
  281. // class CStaticWizardPageWindow
  282. //
  283. // Description:
  284. // Base wizard property sheet page window for pages added to a wizard
  285. // property sheet before the call to PropertySheet(). This page cannot
  286. // be removed from the sheet.
  287. //
  288. // Inheritance:
  289. // CStaticWizardPageWindow
  290. // CWizardPageWindow
  291. // CBasePageWindow
  292. // CPropertyPageWindow
  293. //
  294. //--
  295. /////////////////////////////////////////////////////////////////////////////
  296. class CStaticWizardPageWindow : public CWizardPageWindow
  297. {
  298. typedef CWizardPageWindow baseClass;
  299. public:
  300. //
  301. // Construction
  302. //
  303. // Standard constructor
  304. CStaticWizardPageWindow( HWND hWnd = NULL )
  305. : baseClass( hWnd )
  306. {
  307. } //*** CStaticWizardPageWindow()
  308. }; //*** class CStaticWizardPageWindow
  309. /////////////////////////////////////////////////////////////////////////////
  310. //++
  311. //
  312. // class CDynamicWizardPageWindow
  313. //
  314. // Description:
  315. // Base wizard property sheet page window for pages added to a wizard
  316. // property sheet after the call to PropertySheet(). This page may be
  317. // removed from the sheet.
  318. //
  319. // Inheritance:
  320. // CDynamicWizardPageWindow
  321. // CWizardPageWindow
  322. // CBasePageWindow
  323. // CPropertyPageWindow
  324. //
  325. //--
  326. /////////////////////////////////////////////////////////////////////////////
  327. class CDynamicWizardPageWindow : public CWizardPageWindow
  328. {
  329. typedef CWizardPageWindow baseClass;
  330. public:
  331. //
  332. // Construction
  333. //
  334. // Standard constructor
  335. CDynamicWizardPageWindow( HWND hWnd = NULL )
  336. : baseClass( hWnd )
  337. , m_hpage( NULL )
  338. , m_bPageAddedToSheet( FALSE )
  339. {
  340. } //*** CDynamicWizardPageWindow()
  341. // Destructor
  342. ~CDynamicWizardPageWindow( void )
  343. {
  344. //
  345. // Destroy the page if it hasn't been added to the sheet yet.
  346. // If it has been added to the sheet, the sheet will destroy it.
  347. //
  348. if ( (m_hpage != NULL)
  349. && ! m_bPageAddedToSheet )
  350. {
  351. DestroyPropertySheetPage( m_hpage );
  352. m_hpage = NULL;
  353. } // if: page not deleted yet and not added to the sheet
  354. } //*** ~CDynamicWizardPageWindow()
  355. // Create the page
  356. virtual DWORD ScCreatePage( void ) = 0;
  357. protected:
  358. HPROPSHEETPAGE m_hpage;
  359. BOOL m_bPageAddedToSheet;
  360. public:
  361. // Property page handle
  362. HPROPSHEETPAGE Hpage( void ) const { return m_hpage; }
  363. // Returns whether page has been added to the sheet or not
  364. BOOL BPageAddedToSheet( void ) const { return m_bPageAddedToSheet; }
  365. // Set whether the page has been added to the sheet or not
  366. void SetPageAdded( IN BOOL bAdded = TRUE )
  367. {
  368. m_bPageAddedToSheet = bAdded;
  369. if ( ! bAdded )
  370. {
  371. m_hpage = NULL;
  372. } // if: removing page
  373. } //*** SetPageAdded()
  374. }; //*** class CDynamicWizardPageWindow
  375. /////////////////////////////////////////////////////////////////////////////
  376. //++
  377. //
  378. // class CExtensionWizardPageWindow
  379. //
  380. // Description:
  381. // Base wizard property sheet page window for pages added to a wizard
  382. // property sheet after the call to PropertySheet() identified as a
  383. // non-Wizard97 extension to the list of standard pages. This page may
  384. // be removed from the sheet.
  385. //
  386. // Inheritance:
  387. // CExtensionWizardPageWindow
  388. // CDynamicWizardPageWindow
  389. // CWizardPageWindow
  390. // CBasePageWindow
  391. // CPropertyPageWindow
  392. //
  393. //--
  394. /////////////////////////////////////////////////////////////////////////////
  395. class CExtensionWizardPageWindow : public CDynamicWizardPageWindow
  396. {
  397. typedef CDynamicWizardPageWindow baseClass;
  398. public:
  399. //
  400. // Construction
  401. //
  402. // Standard constructor
  403. CExtensionWizardPageWindow( HWND hWnd = NULL )
  404. : baseClass( hWnd )
  405. {
  406. } //*** CExtensionWizardPageWindow()
  407. }; //*** class CExtensionWizardPageWindow
  408. /////////////////////////////////////////////////////////////////////////////
  409. //++
  410. //
  411. // class CExtensionWizard97PageWindow
  412. //
  413. // Description:
  414. // Base wizard property sheet page window for pages added to a wizard
  415. // property sheet after the call to PropertySheet() identified as a
  416. // Wizard97 extension to the list of standard pages. This page may be
  417. // removed from the sheet.
  418. //
  419. // Inheritance:
  420. // CExtensionWizard97PageWindow
  421. // CExtensionWizardPageWindow
  422. // CDynamicWizardPageWindow
  423. // CWizardPageWindow
  424. // CBasePageWindow
  425. // CPropertyPageWindow
  426. //
  427. //--
  428. /////////////////////////////////////////////////////////////////////////////
  429. class CExtensionWizard97PageWindow : public CExtensionWizardPageWindow
  430. {
  431. typedef CExtensionWizardPageWindow baseClass;
  432. public:
  433. //
  434. // Construction
  435. //
  436. // Standard constructor
  437. CExtensionWizard97PageWindow( HWND hWnd = NULL )
  438. : baseClass( hWnd )
  439. {
  440. } //*** CExtensionWizard97PageWindow()
  441. }; //*** class CExtensionWizard97PageWindow
  442. /////////////////////////////////////////////////////////////////////////////
  443. //++
  444. //
  445. // class CWizardPageImpl
  446. //
  447. // Description:
  448. // Base wizard property sheet page implementation.
  449. //
  450. // Inheritance:
  451. // CWizardPageImpl< T, TWin >
  452. // CBasePageImpl< T, TWin >
  453. // CPropertyPageImpl< T, TWin >
  454. // <TWin>
  455. // ...
  456. // CWizardPageWindow
  457. // CBasePageWindow
  458. // CPropertyPageWindow
  459. //
  460. //--
  461. /////////////////////////////////////////////////////////////////////////////
  462. template < class T, class TWin = CWizardPageWindow >
  463. class CWizardPageImpl : public CBasePageImpl< T, TWin >
  464. {
  465. typedef CWizardPageImpl< T, TWin > thisClass;
  466. typedef CBasePageImpl< T, TWin > baseClass;
  467. public:
  468. //
  469. // Construction
  470. //
  471. // Standard constructor
  472. CWizardPageImpl(
  473. IN OUT LPCTSTR lpszTitle = NULL
  474. )
  475. : baseClass( lpszTitle )
  476. {
  477. // Set the pointer in the base window class to our prop page header.
  478. m_ppsp = &m_psp;
  479. } //*** CWizardPageImpl( lpszTitle )
  480. // Constructor taking a resource ID for the title
  481. CWizardPageImpl(
  482. IN UINT nIDTitle
  483. )
  484. : baseClass( nIDTitle )
  485. {
  486. // Set the pointer in the base window class to our prop page header.
  487. m_ppsp = &m_psp;
  488. } //*** CWizardPageImpl( nIDTitle )
  489. // Initialize the page
  490. virtual BOOL BInit( IN CBaseSheetWindow * psht )
  491. {
  492. if ( ! baseClass::BInit( psht ) )
  493. {
  494. return FALSE;
  495. } // if: base class failed
  496. if ( (Pwiz()->Ppsh()->dwFlags & PSH_WIZARD97)
  497. && (Pwiz()->Ppsh()->dwFlags & PSH_HEADER) )
  498. {
  499. //
  500. // Get the header title.
  501. //
  502. UINT idsTitle = T::GetWizardPageHeaderTitleId();
  503. if ( idsTitle != 0 )
  504. {
  505. m_strHeaderTitle.LoadString( idsTitle );
  506. m_psp.pszHeaderTitle = m_strHeaderTitle;
  507. m_psp.dwFlags |= PSP_USEHEADERTITLE;
  508. m_psp.dwFlags &= ~PSP_HIDEHEADER;
  509. //
  510. // Get the header subtitle.
  511. //
  512. UINT idsSubTitle = T::GetWizardPageHeaderSubTitleId();
  513. if ( idsSubTitle != 0 )
  514. {
  515. m_strHeaderSubTitle.LoadString( idsSubTitle );
  516. m_psp.pszHeaderSubTitle = m_strHeaderSubTitle;
  517. m_psp.dwFlags |= PSP_USEHEADERSUBTITLE;
  518. } // if: subtitle specified
  519. } // if: title specified
  520. else
  521. {
  522. m_psp.dwFlags |= PSP_HIDEHEADER;
  523. } // else: no title specified
  524. } // if: Wizard97 with a header
  525. return TRUE;
  526. } //*** BInit()
  527. public:
  528. //
  529. // CWizardPageImpl public methods.
  530. //
  531. // Get the next page we're going to
  532. CWizardPageWindow * PwizpgNext( IN LPCTSTR psz = NULL )
  533. {
  534. ATLASSERT( psz != (LPCTSTR) -1 );
  535. CWizardPageWindow * ppage = NULL;
  536. if ( psz == NULL )
  537. {
  538. //
  539. // There will not be a resource ID for extension pages, so check
  540. // for that before calling PwpageNextFromID. This allows us to
  541. // leave the assert in there for a non-NULL resource.
  542. //
  543. if ( T::IDD != 0 )
  544. {
  545. ppage = Pwiz()->PlwpPages()->PwpageNextFromID( MAKEINTRESOURCE( T::IDD ) );
  546. } // if: there is a resource ID for this page
  547. } // if: no next page specified
  548. else
  549. {
  550. ppage = Pwiz()->PlwpPages()->PwpageFromID( psz );
  551. } // else: next page specified
  552. return ppage;
  553. } //*** PwizpgNext()
  554. // Enable or disable the next page
  555. void EnableNextPage( IN BOOL bEnable = TRUE )
  556. {
  557. CWizardPageWindow * pwp = PwizpgNext();
  558. if ( pwp != NULL )
  559. {
  560. pwp->EnablePage( bEnable );
  561. } // if: next page found
  562. } //*** EnableNextPage()
  563. public:
  564. //
  565. // Message handler functions.
  566. //
  567. //
  568. // Message handler override functions.
  569. //
  570. // Handler for PSN_WIZBACK
  571. int OnWizardBack( void )
  572. {
  573. //
  574. // Make sure back button is marked as last button pressed.
  575. //
  576. Pwiz()->SetLastWizardButton( ID_WIZBACK );
  577. return baseClass::OnWizardBack();
  578. } //*** OnWizardBack()
  579. // Handler for PSN_WIZNEXT
  580. int OnWizardNext( void )
  581. {
  582. //
  583. // Make sure next button is marked as last button pressed.
  584. //
  585. Pwiz()->SetLastWizardButton( ID_WIZNEXT );
  586. int nResult = baseClass::OnWizardNext();
  587. if ( nResult != -1 )
  588. {
  589. if ( ! BIsNextPageSet() )
  590. {
  591. EnableNextPage();
  592. } // if: next page not set yet
  593. m_bIsNextPageSet = FALSE;
  594. } // if: changing pages
  595. return nResult;
  596. } //*** OnWizardNext()
  597. // Implementation
  598. protected:
  599. public:
  600. }; //*** class CWizardPageImpl
  601. /////////////////////////////////////////////////////////////////////////////
  602. //++
  603. //
  604. // class CStaticWizardPageImpl
  605. //
  606. // Description:
  607. // Base wizard property sheet page implementation for pages added to a
  608. // wizard property sheet before the call to PropertySheet(). This page
  609. // cannot be removed from the sheet.
  610. //
  611. // Inheritance:
  612. // CStaticWizardPageImpl< T >
  613. // CWizardPageImpl< T, CStaticWizardPageWindow >
  614. // CBasePageImpl< T, CStaticWizardPageWindow >
  615. // CPropertyPageImpl< T, CStaticWizardPageWindow >
  616. // CStaticWizardPageWindow
  617. // CWizardPageWindow
  618. // CBasePageWindow
  619. // CPropertyPageWindow
  620. //
  621. //--
  622. /////////////////////////////////////////////////////////////////////////////
  623. template < class T >
  624. class CStaticWizardPageImpl : public CWizardPageImpl< T, CStaticWizardPageWindow >
  625. {
  626. typedef CStaticWizardPageImpl< T > thisClass;
  627. typedef CWizardPageImpl< T, CStaticWizardPageWindow > baseClass;
  628. public:
  629. //
  630. // Construction.
  631. //
  632. // Standard constructor
  633. CStaticWizardPageImpl(
  634. IN OUT LPCTSTR lpszTitle = NULL
  635. )
  636. : baseClass( lpszTitle )
  637. {
  638. } //*** CStaticWizardPageImpl( lpszTitle )
  639. // Constructor taking a resource ID for the title
  640. CStaticWizardPageImpl(
  641. IN UINT nIDTitle
  642. )
  643. : baseClass( nIDTitle )
  644. {
  645. } //*** CStaticWizardPageImpl( nIDTitle )
  646. }; //*** class CStaticWizardPageImpl
  647. /////////////////////////////////////////////////////////////////////////////
  648. //++
  649. //
  650. // class CDynamicWizardPageImpl
  651. //
  652. // Description:
  653. // Base wizard property sheet page implementation for pages added to a
  654. // wizard property sheet after the call to PropertySheet(). This page
  655. // may be removed from the sheet.
  656. //
  657. // Inheritance:
  658. // CDynamicWizardPageImpl< T >
  659. // CWizardPageImpl< T, CDynamicWizardPageWindow >
  660. // CBasePageImpl< T, CDynamicWizardPageWindow >
  661. // CPropertyPageImpl< T, CDynamicWizardPageWindow >
  662. // CDynamicWizardPageWindow
  663. // CWizardPageWindow
  664. // CBasePageWindow
  665. // CPropertyPageWindow
  666. //
  667. //--
  668. /////////////////////////////////////////////////////////////////////////////
  669. template < class T >
  670. class CDynamicWizardPageImpl : public CWizardPageImpl< T, CDynamicWizardPageWindow >
  671. {
  672. typedef CDynamicWizardPageImpl< T > thisClass;
  673. typedef CWizardPageImpl< T, CDynamicWizardPageWindow > baseClass;
  674. public:
  675. //
  676. // Construction.
  677. //
  678. // Standard constructor
  679. CDynamicWizardPageImpl(
  680. IN OUT LPCTSTR lpszTitle = NULL
  681. )
  682. : baseClass( lpszTitle )
  683. {
  684. } //*** CDynamicWizardPageImpl( lpszTitle )
  685. // Constructor taking a resource ID for the title
  686. CDynamicWizardPageImpl(
  687. IN UINT nIDTitle
  688. )
  689. : baseClass( nIDTitle )
  690. {
  691. } //*** CDynamicWizardPageImpl( nIDTitle )
  692. // Create the page
  693. DWORD ScCreatePage( void )
  694. {
  695. ATLASSERT( m_hpage == NULL );
  696. m_hpage = CreatePropertySheetPage( &m_psp );
  697. if ( m_hpage == NULL )
  698. {
  699. return GetLastError();
  700. } // if: error creating the page
  701. return ERROR_SUCCESS;
  702. } //*** ScCreatePage()
  703. }; //*** class CDynamicWizardPageImpl
  704. /////////////////////////////////////////////////////////////////////////////
  705. //++
  706. //
  707. // class CExtensionWizardPageImpl
  708. //
  709. // Description:
  710. // Base wizard property sheet page implementation for pages added to a
  711. // wizard property sheet after the call to PropertySheet() identified
  712. // as a non-Wizard97 extension to the list of standard pages. This
  713. // page may be removed from the sheet.
  714. //
  715. // Inheritance:
  716. // CExtensionWizardPageImpl< T >
  717. // CWizardPageImpl< T, CExtensionWizardPageWindow >
  718. // CBasePageImpl< T, CExtensionWizardPageWindow >
  719. // CPropertyPageImpl< T, CExtensionWizardPageWindow >
  720. // CExtensionWizardPageWindow
  721. // CDynamicWizardPageWindow
  722. // CWizardPageWindow
  723. // CBasePageWindow
  724. // CPropertyPageWindow
  725. //
  726. //--
  727. /////////////////////////////////////////////////////////////////////////////
  728. template < class T >
  729. class CExtensionWizardPageImpl : public CWizardPageImpl< T, CExtensionWizardPageWindow >
  730. {
  731. typedef CExtensionWizardPageImpl< T > thisClass;
  732. typedef CWizardPageImpl< T, CExtensionWizardPageWindow > baseClass;
  733. public:
  734. //
  735. // Construction.
  736. //
  737. // Standard constructor
  738. CExtensionWizardPageImpl(
  739. IN OUT LPCTSTR lpszTitle = NULL
  740. )
  741. : baseClass( lpszTitle )
  742. {
  743. } //*** CExtensionWizardPageImpl( lpszTitle )
  744. // Constructor taking a resource ID for the title
  745. CExtensionWizardPageImpl(
  746. IN UINT nIDTitle
  747. )
  748. : baseClass( nIDTitle )
  749. {
  750. } //*** CExtensionWizardPageImpl( nIDTitle )
  751. }; //*** class CExtensionWizardPageImpl
  752. /////////////////////////////////////////////////////////////////////////////
  753. //++
  754. //
  755. // class CExtensionWizard97PageImpl
  756. //
  757. // Description:
  758. // Base wizard property sheet page implementation for pages added to a
  759. // wizard property sheet after the call to PropertySheet() identified
  760. // as a Wizard97 extension to the list of standard pages. This page
  761. // may be removed from the sheet.
  762. //
  763. // Inheritance:
  764. // CExtensionWizard97PageImpl< T >
  765. // CWizardPageImpl< T, CExtensionWizard97PageWindow >
  766. // CBasePageImpl< T, CExtensionWizard97PageWindow >
  767. // CPropertyPageImpl< T, CExtensionWizard97PageWindow >
  768. // CExtensionWizard97PageWindow
  769. // CExtensionWizardPageWindow
  770. // CDynamicWizardPageWindow
  771. // CWizardPageWindow
  772. // CBasePageWindow
  773. // CPropertyPageWindow
  774. //
  775. //--
  776. /////////////////////////////////////////////////////////////////////////////
  777. template < class T >
  778. class CExtensionWizard97PageImpl : public CWizardPageImpl< T, CExtensionWizard97PageWindow >
  779. {
  780. typedef CExtensionWizard97PageImpl< T > thisClass;
  781. typedef CWizardPageImpl< T, CExtensionWizard97PageWindow > baseClass;
  782. public:
  783. //
  784. // Construction.
  785. //
  786. // Standard constructor
  787. CExtensionWizard97PageImpl(
  788. IN OUT LPCTSTR lpszTitle = NULL
  789. )
  790. : baseClass( lpszTitle )
  791. {
  792. } //*** CExtensionWizard97PageImpl( lpszTitle )
  793. // Constructor taking a resource ID for the title
  794. CExtensionWizard97PageImpl(
  795. IN UINT nIDTitle
  796. )
  797. : baseClass( nIDTitle )
  798. {
  799. } //*** CExtensionWizard97PageImpl( nIDTitle )
  800. }; //*** class CExtensionWizard97PageImpl
  801. /////////////////////////////////////////////////////////////////////////////
  802. #endif // __ATLBASEWIZPAGE_H_