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.

176 lines
4.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1998 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // FSAdv.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the CFileShareAdvancedDlg classes.
  10. //
  11. // Author:
  12. // David Potter (davidp) June 28, 1996
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "CluAdmX.h"
  21. #include "FSAdv.h"
  22. #include "HelpData.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CFileShareAdvancedDlg dialog
  30. /////////////////////////////////////////////////////////////////////////////
  31. /////////////////////////////////////////////////////////////////////////////
  32. // Message Maps
  33. BEGIN_MESSAGE_MAP(CFileShareAdvancedDlg, CBaseDialog)
  34. //{{AFX_MSG_MAP(CFileShareAdvancedDlg)
  35. ON_BN_CLICKED(IDC_FILESHR_ADV_NORMAL_SHARE, OnChangedChoice)
  36. ON_BN_CLICKED(IDC_FILESHR_ADV_DFS_ROOT, OnChangedChoice)
  37. ON_BN_CLICKED(IDC_FILESHR_ADV_SHARE_SUBDIRS, OnChangedChoice)
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. /////////////////////////////////////////////////////////////////////////////
  41. //++
  42. //
  43. // CFileShareAdvancedDlg::CFileShareAdvancedDlg
  44. //
  45. // Routine Description:
  46. // Constructor.
  47. //
  48. // Arguments:
  49. // bShareSubDirs [IN] Default value for the Share subdirectories radio button.
  50. // bHideSubDirShare [IN] Default value for the Hide subdirectory shares checkbox.
  51. // bIsDfsRoot [IN] Default value for the DFS Root radio button
  52. //
  53. // Return Value:
  54. // None.
  55. //
  56. //--
  57. /////////////////////////////////////////////////////////////////////////////
  58. CFileShareAdvancedDlg::CFileShareAdvancedDlg(
  59. BOOL bShareSubDirs,
  60. BOOL bHideSubDirShares,
  61. BOOL bIsDfsRoot,
  62. CWnd * pParent /*=NULL*/
  63. )
  64. : CBaseDialog(IDD, g_aHelpIDs_IDD_FILESHR_ADVANCED, pParent)
  65. {
  66. //{{AFX_DATA_INIT(CFileShareAdvancedDlg)
  67. m_bShareSubDirs = bShareSubDirs;
  68. m_bHideSubDirShares = bHideSubDirShares;
  69. m_bIsDfsRoot = bIsDfsRoot;
  70. //}}AFX_DATA_INIT
  71. // Can't both share subdirs and be a DFS root.
  72. ASSERT(!(bShareSubDirs && bIsDfsRoot));
  73. if (m_bIsDfsRoot)
  74. {
  75. m_nChoice = 1;
  76. m_bHideSubDirShares = FALSE;
  77. } // if: DFS root
  78. else if (m_bShareSubDirs)
  79. m_nChoice = 2;
  80. else
  81. {
  82. m_nChoice = 0;
  83. m_bHideSubDirShares = FALSE;
  84. } // else: normal share
  85. } //*** CFileShareAdvancedDlg::CFileShareAdvancedDlg()
  86. /////////////////////////////////////////////////////////////////////////////
  87. //++
  88. //
  89. // CFileShareAdvancedDlg::DoDataExchange
  90. //
  91. // Routine Description:
  92. // Do data exchange between the dialog and the class.
  93. //
  94. // Arguments:
  95. // pDX [IN OUT] Data exchange object
  96. //
  97. // Return Value:
  98. // None.
  99. //
  100. //--
  101. /////////////////////////////////////////////////////////////////////////////
  102. void CFileShareAdvancedDlg::DoDataExchange(CDataExchange * pDX)
  103. {
  104. CBaseDialog::DoDataExchange(pDX);
  105. //{{AFX_DATA_MAP(CFileShareAdvancedDlg)
  106. DDX_Control(pDX, IDC_FILESHR_ADV_HIDE_SUBDIR_SHARES, m_chkHideSubDirShares);
  107. DDX_Control(pDX, IDC_FILESHR_ADV_SHARE_SUBDIRS, m_rbShareSubDirs);
  108. DDX_Radio(pDX, IDC_FILESHR_ADV_NORMAL_SHARE, m_nChoice);
  109. DDX_Check(pDX, IDC_FILESHR_ADV_HIDE_SUBDIR_SHARES, m_bHideSubDirShares);
  110. //}}AFX_DATA_MAP
  111. if (pDX->m_bSaveAndValidate)
  112. {
  113. if (m_nChoice == 1)
  114. {
  115. m_bIsDfsRoot = TRUE;
  116. m_bShareSubDirs = FALSE;
  117. m_bHideSubDirShares = FALSE;
  118. } // if: DFS root radio button selected
  119. else if (m_nChoice == 2)
  120. {
  121. m_bIsDfsRoot = FALSE;
  122. m_bShareSubDirs = TRUE;
  123. } // else if: share subdirs radio button selected
  124. else
  125. {
  126. m_bIsDfsRoot = FALSE;
  127. m_bShareSubDirs = FALSE;
  128. m_bHideSubDirShares = FALSE;
  129. } // else: normal radio button selected
  130. } // if: saving data from dialog
  131. else
  132. {
  133. if (m_nChoice == 2)
  134. m_chkHideSubDirShares.EnableWindow (TRUE);
  135. else
  136. m_chkHideSubDirShares.EnableWindow (FALSE);
  137. } // else: setting data to dialog
  138. } //*** CFileShareAdvancedDlg::DoDataExchange()
  139. /////////////////////////////////////////////////////////////////////////////
  140. //++
  141. //
  142. // CFileShareAdvancedDlg::OnChangedChoice
  143. //
  144. // Routine Description:
  145. // Handler for the BN_CLICKED message on the DFS root or Share
  146. // subdirectories radio button.
  147. //
  148. // Arguments:
  149. // None.
  150. //
  151. // Return Value:
  152. // None.
  153. //
  154. //--
  155. /////////////////////////////////////////////////////////////////////////////
  156. void CFileShareAdvancedDlg::OnChangedChoice(void)
  157. {
  158. if (m_rbShareSubDirs.GetCheck() == BST_CHECKED)
  159. m_chkHideSubDirShares.EnableWindow (TRUE);
  160. else
  161. m_chkHideSubDirShares.EnableWindow (FALSE);
  162. } //*** CFileShareAdvancedDlg::OnChangedChoice()