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.

190 lines
4.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ARCreate.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the CWizPageARCreate class.
  10. //
  11. // Author:
  12. // David Potter (davidp) December 8, 1997
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "ARCreate.h"
  21. #include "ClusAppWiz.h"
  22. #ifdef _DEBUG
  23. #define new DEBUG_NEW
  24. #undef THIS_FILE
  25. static char THIS_FILE[] = __FILE__;
  26. #endif
  27. /////////////////////////////////////////////////////////////////////////////
  28. // class CWizPageARCreate
  29. /////////////////////////////////////////////////////////////////////////////
  30. /////////////////////////////////////////////////////////////////////////////
  31. // Control name map
  32. BEGIN_CTRL_NAME_MAP( CWizPageARCreate )
  33. DEFINE_CTRL_NAME_MAP_ENTRY( IDC_WIZARD_PAGE_DESCRIPTION )
  34. DEFINE_CTRL_NAME_MAP_ENTRY( IDC_ARC_CREATE_RES )
  35. DEFINE_CTRL_NAME_MAP_ENTRY( IDC_ARC_DONT_CREATE_RES )
  36. END_CTRL_NAME_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. //++
  39. //
  40. // CWizPageARCreate::OnInitDialog
  41. //
  42. // Routine Description:
  43. // Handler for the WM_INITDIALOG message.
  44. //
  45. // Arguments:
  46. // None.
  47. //
  48. // Return Value:
  49. // TRUE Focus still needs to be set.
  50. // FALSE Focus does not need to be set.
  51. //
  52. //--
  53. /////////////////////////////////////////////////////////////////////////////
  54. BOOL CWizPageARCreate::OnInitDialog( void )
  55. {
  56. //
  57. // Attach the controls to control member variables.
  58. //
  59. AttachControl( m_rbCreateAppRes, IDC_ARC_CREATE_RES );
  60. AttachControl( m_rbDontCreateAppRes, IDC_ARC_DONT_CREATE_RES );
  61. return TRUE;
  62. } //*** CWizPageARCreate::OnInitDialog()
  63. /////////////////////////////////////////////////////////////////////////////
  64. //++
  65. //
  66. // CWizPageARCreate::OnSetActive
  67. //
  68. // Routine Description:
  69. // Handler for PSN_SETACTIVE.
  70. //
  71. // Arguments:
  72. // None.
  73. //
  74. // Return Value:
  75. // TRUE Page activated successfully.
  76. // FALSE Error activating page.
  77. //
  78. //--
  79. /////////////////////////////////////////////////////////////////////////////
  80. BOOL CWizPageARCreate::OnSetActive( void )
  81. {
  82. //
  83. // Get info from the sheet.
  84. //
  85. m_bCreatingAppResource = PwizThis()->BCreatingAppResource();
  86. //
  87. // Call the base class and return.
  88. //
  89. return baseClass::OnSetActive();
  90. } //*** CWizPageARCreate::OnSetActive()
  91. /////////////////////////////////////////////////////////////////////////////
  92. //++
  93. //
  94. // CWizPageARCreate::UpdateData
  95. //
  96. // Routine Description:
  97. // Update data on or from the page.
  98. //
  99. // Arguments:
  100. // bSaveAndValidate [IN] TRUE if need to read data from the page.
  101. // FALSE if need to set data to the page.
  102. //
  103. // Return Value:
  104. // TRUE The data was updated successfully.
  105. // FALSE An error occurred updating the data.
  106. //
  107. //--
  108. /////////////////////////////////////////////////////////////////////////////
  109. BOOL CWizPageARCreate::UpdateData( BOOL bSaveAndValidate )
  110. {
  111. BOOL bSuccess = TRUE;
  112. if ( bSaveAndValidate )
  113. {
  114. BOOL bChecked = (m_rbCreateAppRes.GetCheck() == BST_CHECKED);
  115. m_bCreatingAppResource = bChecked;
  116. } // if: saving data from the page
  117. else
  118. {
  119. if ( m_bCreatingAppResource )
  120. {
  121. //
  122. // Default the radio button selection.
  123. //
  124. m_rbCreateAppRes.SetCheck( BST_CHECKED );
  125. m_rbDontCreateAppRes.SetCheck( BST_UNCHECKED );
  126. } // if: creating application resource
  127. else
  128. {
  129. //
  130. // Default the radio button selection.
  131. //
  132. m_rbCreateAppRes.SetCheck( BST_UNCHECKED );
  133. m_rbDontCreateAppRes.SetCheck( BST_CHECKED );
  134. } // else: not creating application resource
  135. } // else: setting data to the page
  136. return bSuccess;
  137. } //*** CWizPageARCreate::UpdateData()
  138. /////////////////////////////////////////////////////////////////////////////
  139. //++
  140. //
  141. // CWizPageARCreate::BApplyChanges
  142. //
  143. // Routine Description:
  144. // Apply changes made on this page to the sheet.
  145. //
  146. // Arguments:
  147. // None.
  148. //
  149. // Return Value:
  150. // TRUE The data was applied successfully.
  151. // FALSE An error occurred applying the data.
  152. //
  153. //--
  154. /////////////////////////////////////////////////////////////////////////////
  155. BOOL CWizPageARCreate::BApplyChanges( void )
  156. {
  157. if ( ! PwizThis()->BSetCreatingAppResource( m_bCreatingAppResource ) )
  158. {
  159. return FALSE;
  160. } // if: error applying the change to the wizard
  161. if ( ! m_bCreatingAppResource )
  162. {
  163. SetNextPage( IDD_COMPLETION );
  164. PwizThis()->RemoveExtensionPages();
  165. } // if: not creating applicaton resource
  166. return TRUE;
  167. } //*** CWizPageARCreate::BApplyChanges()