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.

171 lines
3.6 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. // EditQualDlg.cpp : implementation file
  8. //
  9. #include "stdafx.h"
  10. #include "wmitest.h"
  11. #include "EditQualDlg.h"
  12. #ifdef _DEBUG
  13. #define new DEBUG_NEW
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CEditQualDlg dialog
  19. CEditQualDlg::CEditQualDlg(CWnd* pParent /*=NULL*/) :
  20. CDialog(CEditQualDlg::IDD, pParent),
  21. m_bIsInstance(FALSE)
  22. {
  23. //{{AFX_DATA_INIT(CEditQualDlg)
  24. // NOTE: the ClassWizard will add member initialization here
  25. //}}AFX_DATA_INIT
  26. }
  27. void CEditQualDlg::DoDataExchange(CDataExchange* pDX)
  28. {
  29. CDialog::DoDataExchange(pDX);
  30. //{{AFX_DATA_MAP(CEditQualDlg)
  31. // NOTE: the ClassWizard will add DDX and DDV calls here
  32. //}}AFX_DATA_MAP
  33. if (!pDX->m_bSaveAndValidate)
  34. {
  35. m_propUtil.Init(this);
  36. CheckDlgButton(IDC_ALLOW_OVERRIDE,
  37. (m_lFlavor & WBEM_FLAVOR_NOT_OVERRIDABLE) == 0);
  38. CheckDlgButton(IDC_TO_INST,
  39. (m_lFlavor & WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE) != 0);
  40. CheckDlgButton(IDC_TO_CLASS,
  41. (m_lFlavor & WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS) != 0);
  42. CheckDlgButton(IDC_AMENDED,
  43. (m_lFlavor & WBEM_FLAVOR_AMENDED) != 0);
  44. CheckDlgButton(IDC_PROPPED,
  45. (m_lFlavor & WBEM_FLAVOR_ORIGIN_PROPAGATED) != 0);
  46. }
  47. else
  48. {
  49. m_lFlavor = 0;
  50. if (!IsDlgButtonChecked(IDC_ALLOW_OVERRIDE))
  51. m_lFlavor |= WBEM_FLAVOR_NOT_OVERRIDABLE;
  52. if (IsDlgButtonChecked(IDC_TO_INST))
  53. m_lFlavor |= WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE;
  54. if (IsDlgButtonChecked(IDC_TO_CLASS))
  55. m_lFlavor |= WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS;
  56. if (IsDlgButtonChecked(IDC_AMENDED))
  57. m_lFlavor |= WBEM_FLAVOR_AMENDED;
  58. }
  59. m_propUtil.DoDataExchange(pDX);
  60. }
  61. BEGIN_MESSAGE_MAP(CEditQualDlg, CDialog)
  62. //{{AFX_MSG_MAP(CEditQualDlg)
  63. ON_BN_CLICKED(IDC_ADD, OnAdd)
  64. ON_BN_CLICKED(IDC_EDIT, OnEdit)
  65. ON_BN_CLICKED(IDC_ARRAY, OnArray)
  66. ON_BN_CLICKED(IDC_DELETE, OnDelete)
  67. ON_BN_CLICKED(IDC_UP, OnUp)
  68. ON_BN_CLICKED(IDC_DOWN, OnDown)
  69. ON_LBN_SELCHANGE(IDC_ARRAY_VALUES, OnSelchangeArrayValues)
  70. ON_LBN_DBLCLK(IDC_ARRAY_VALUES, OnDblclkArrayValues)
  71. ON_CBN_SELCHANGE(IDC_TYPE, OnSelchangeType)
  72. //}}AFX_MSG_MAP
  73. END_MESSAGE_MAP()
  74. /////////////////////////////////////////////////////////////////////////////
  75. // CEditQualDlg message handlers
  76. void CEditQualDlg::OnAdd()
  77. {
  78. m_propUtil.OnAdd();
  79. }
  80. void CEditQualDlg::OnEdit()
  81. {
  82. m_propUtil.OnEdit();
  83. }
  84. void CEditQualDlg::OnArray()
  85. {
  86. m_propUtil.OnArray();
  87. }
  88. void CEditQualDlg::OnDelete()
  89. {
  90. m_propUtil.OnDelete();
  91. }
  92. void CEditQualDlg::OnUp()
  93. {
  94. m_propUtil.OnUp();
  95. }
  96. void CEditQualDlg::OnDown()
  97. {
  98. m_propUtil.OnDown();
  99. }
  100. BOOL CEditQualDlg::OnInitDialog()
  101. {
  102. CDialog::OnInitDialog();
  103. if (m_bIsInstance)
  104. {
  105. const DWORD dwIDs[] =
  106. {
  107. IDC_ALLOW_OVERRIDE,
  108. IDC_TO_INST,
  109. IDC_TO_CLASS,
  110. IDC_AMENDED,
  111. };
  112. for (int i = 0; i < sizeof(dwIDs) / sizeof(dwIDs[0]); i++)
  113. GetDlgItem(dwIDs[i])->EnableWindow(FALSE);
  114. }
  115. return m_propUtil.OnInitDialog();
  116. //return TRUE; // return TRUE unless you set the focus to a control
  117. // EXCEPTION: OCX Property Pages should return FALSE
  118. }
  119. void CEditQualDlg::OnSelchangeArrayValues()
  120. {
  121. m_propUtil.OnSelchangeValueArray();
  122. }
  123. void CEditQualDlg::OnDblclkArrayValues()
  124. {
  125. m_propUtil.OnDblclkArrayValues();
  126. }
  127. void CEditQualDlg::OnSelchangeType()
  128. {
  129. m_propUtil.OnSelchangeType();
  130. }