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.

195 lines
4.5 KiB

  1. // prmsdlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "viewex.h"
  5. #include "resource.h"
  6. #include "prmsdlg.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CParamsDialog dialog
  14. /***********************************************************
  15. Function:
  16. Arguments:
  17. Return:
  18. Purpose:
  19. Author(s):
  20. Revision:
  21. Date:
  22. ***********************************************************/
  23. CParamsDialog::CParamsDialog(CWnd* pParent /*=NULL*/)
  24. : CDialog(CParamsDialog::IDD, pParent)
  25. {
  26. //{{AFX_DATA_INIT(CParamsDialog)
  27. // NOTE: the ClassWizard will add member initialization here
  28. //}}AFX_DATA_INIT
  29. m_nArgs = 0;
  30. m_pValues[ 0 ] = &m_eParamValue1;
  31. m_pValues[ 1 ] = &m_eParamValue2;
  32. m_pValues[ 2 ] = &m_eParamValue3;
  33. m_pValues[ 3 ] = &m_eParamValue4;
  34. m_pValues[ 4 ] = &m_eParamValue5;
  35. m_pValues[ 5 ] = &m_eParamValue6;
  36. m_pNames[ 0 ] = &m_strParamName1;
  37. m_pNames[ 1 ] = &m_strParamName2;
  38. m_pNames[ 2 ] = &m_strParamName3;
  39. m_pNames[ 3 ] = &m_strParamName4;
  40. m_pNames[ 4 ] = &m_strParamName5;
  41. m_pNames[ 5 ] = &m_strParamName6;
  42. m_pArgNames = NULL;
  43. m_pArgValues = NULL;
  44. }
  45. /***********************************************************
  46. Function:
  47. Arguments:
  48. Return:
  49. Purpose:
  50. Author(s):
  51. Revision:
  52. Date:
  53. ***********************************************************/
  54. void CParamsDialog::DoDataExchange(CDataExchange* pDX)
  55. {
  56. CDialog::DoDataExchange(pDX);
  57. //{{AFX_DATA_MAP(CParamsDialog)
  58. DDX_Control(pDX, IDC_METHOD, m_strMethodName);
  59. DDX_Control(pDX, IDE_PARAM6, m_eParamValue6);
  60. DDX_Control(pDX, IDE_PARAM5, m_eParamValue5);
  61. DDX_Control(pDX, IDE_PARAM4, m_eParamValue4);
  62. DDX_Control(pDX, IDE_PARAM3, m_eParamValue3);
  63. DDX_Control(pDX, IDE_PARAM2, m_eParamValue2);
  64. DDX_Control(pDX, IDE_PARAM1, m_eParamValue1);
  65. DDX_Control(pDX, IDC_PARAM6, m_strParamName6);
  66. DDX_Control(pDX, IDC_PARAM5, m_strParamName5);
  67. DDX_Control(pDX, IDC_PARAM4, m_strParamName4);
  68. DDX_Control(pDX, IDC_PARAM3, m_strParamName3);
  69. DDX_Control(pDX, IDC_PARAM2, m_strParamName2);
  70. DDX_Control(pDX, IDC_PARAM1, m_strParamName1);
  71. //}}AFX_DATA_MAP
  72. }
  73. BEGIN_MESSAGE_MAP(CParamsDialog, CDialog)
  74. //{{AFX_MSG_MAP(CParamsDialog)
  75. //}}AFX_MSG_MAP
  76. END_MESSAGE_MAP()
  77. /////////////////////////////////////////////////////////////////////////////
  78. // CParamsDialog message handlers
  79. /***********************************************************
  80. Function:
  81. Arguments:
  82. Return:
  83. Purpose:
  84. Author(s):
  85. Revision:
  86. Date:
  87. ***********************************************************/
  88. void CParamsDialog::SetMethodName ( CString& strMethodName )
  89. {
  90. m_strMethName = strMethodName;
  91. }
  92. /***********************************************************
  93. Function:
  94. Arguments:
  95. Return:
  96. Purpose:
  97. Author(s):
  98. Revision:
  99. Date:
  100. ***********************************************************/
  101. void CParamsDialog::SetArgNames( CStringArray* pArgNames )
  102. {
  103. m_pArgNames = pArgNames;
  104. m_nArgs = (int)pArgNames->GetSize( );
  105. }
  106. /***********************************************************
  107. Function:
  108. Arguments:
  109. Return:
  110. Purpose:
  111. Author(s):
  112. Revision:
  113. Date:
  114. ***********************************************************/
  115. void CParamsDialog::SetArgValues( CStringArray* pArgValues )
  116. {
  117. m_pArgValues = pArgValues;
  118. }
  119. /***********************************************************
  120. Function:
  121. Arguments:
  122. Return:
  123. Purpose:
  124. Author(s):
  125. Revision:
  126. Date:
  127. ***********************************************************/
  128. BOOL CParamsDialog::OnInitDialog()
  129. {
  130. CDialog::OnInitDialog();
  131. // TODO: Add extra initialization here
  132. int nIdx;
  133. for( nIdx = 0; nIdx < m_nArgs && nIdx < 6 ; nIdx++ )
  134. {
  135. m_pNames[ nIdx ]->SetWindowText( m_pArgNames->GetAt( nIdx ) );
  136. m_pValues[ nIdx ]->SetWindowText( _T("") );
  137. }
  138. for( ; nIdx < 6 ; nIdx++ )
  139. {
  140. m_pNames[ nIdx ]->ShowWindow( SW_HIDE );
  141. m_pValues[ nIdx ]->ShowWindow( SW_HIDE );
  142. }
  143. return TRUE; // return TRUE unless you set the focus to a control
  144. // EXCEPTION: OCX Property Pages should return FALSE
  145. }
  146. /***********************************************************
  147. Function:
  148. Arguments:
  149. Return:
  150. Purpose:
  151. Author(s):
  152. Revision:
  153. Date:
  154. ***********************************************************/
  155. void CParamsDialog::OnOK()
  156. {
  157. // TODO: Add extra validation here
  158. for( int nIdx = 0; nIdx < m_nArgs && m_nArgs < 6; nIdx++ )
  159. {
  160. CString strValue;
  161. m_pValues[ nIdx ]->GetWindowText( strValue );
  162. m_pArgValues->Add( strValue );
  163. }
  164. CDialog::OnOK();
  165. }
  166.