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.

130 lines
2.8 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1998.
  5. //
  6. // File: DplApp.cpp
  7. //
  8. // Contents: Application deployment dialog
  9. //
  10. // Classes: CDeployApp
  11. //
  12. // History: 03-14-1998 stevebl Commented
  13. //
  14. //---------------------------------------------------------------------------
  15. #include "precomp.hxx"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CDeployApp dialog
  23. CDeployApp::CDeployApp(CWnd* pParent /*=NULL*/)
  24. : CDialog(CDeployApp::IDD, pParent)
  25. {
  26. //{{AFX_DATA_INIT(CDeployApp)
  27. m_iDeployment = 0;
  28. //}}AFX_DATA_INIT
  29. }
  30. void CDeployApp::DoDataExchange(CDataExchange* pDX)
  31. {
  32. CDialog::DoDataExchange(pDX);
  33. //{{AFX_DATA_MAP(CDeployApp)
  34. DDX_Radio(pDX, IDC_RADIO2, m_iDeployment);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CDeployApp, CDialog)
  38. //{{AFX_MSG_MAP(CDeployApp)
  39. ON_WM_CONTEXTMENU()
  40. ON_BN_CLICKED(IDC_RADIO2, OnPublished)
  41. ON_BN_CLICKED(IDC_RADIO3, OnAssigned)
  42. ON_BN_CLICKED(IDC_RADIO1, OnCustom)
  43. //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45. void CDeployApp::OnPublished()
  46. {
  47. CString sz;
  48. sz.LoadString(IDS_DEPLOYTEXTPUB);
  49. SetDlgItemText(IDC_STATIC1, sz);
  50. }
  51. void CDeployApp::OnAssigned()
  52. {
  53. CString sz;
  54. sz.LoadString(IDS_DEPLOYTEXTASSIGNED);
  55. SetDlgItemText(IDC_STATIC1, sz);
  56. }
  57. void CDeployApp::OnCustom()
  58. {
  59. CString sz;
  60. sz.LoadString(IDS_DEPLOYTEXTCUSTOM);
  61. SetDlgItemText(IDC_STATIC1, sz);
  62. }
  63. BOOL CDeployApp::OnInitDialog()
  64. {
  65. if (m_fCrappyZaw)
  66. {
  67. GetDlgItem(IDC_RADIO3)->EnableWindow(FALSE);
  68. }
  69. if (m_fMachine)
  70. {
  71. GetDlgItem(IDC_RADIO2)->EnableWindow(FALSE);
  72. if (0 == m_iDeployment)
  73. {
  74. m_iDeployment++;
  75. }
  76. }
  77. CString sz;
  78. switch (m_iDeployment)
  79. {
  80. case 0:
  81. // Published
  82. sz.LoadString(IDS_DEPLOYTEXTPUB);
  83. break;
  84. case 1:
  85. // Assigned
  86. sz.LoadString(IDS_DEPLOYTEXTASSIGNED);
  87. break;
  88. case 2:
  89. // Custom
  90. sz.LoadString(IDS_DEPLOYTEXTCUSTOM);
  91. break;
  92. }
  93. SetDlgItemText(IDC_STATIC1, sz);
  94. CDialog::OnInitDialog();
  95. return TRUE; // return TRUE unless you set the focus to a control
  96. // EXCEPTION: OCX Property Pages should return FALSE
  97. }
  98. LRESULT CDeployApp::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
  99. {
  100. switch (message)
  101. {
  102. case WM_HELP:
  103. StandardHelp((HWND)((LPHELPINFO) lParam)->hItemHandle, IDD);
  104. return 0;
  105. default:
  106. return CDialog::WindowProc(message, wParam, lParam);
  107. }
  108. }
  109. void CDeployApp::OnContextMenu(CWnd* pWnd, CPoint point)
  110. {
  111. StandardContextMenu(pWnd->m_hWnd, IDD_DEPLOY_APP_DIALOG);
  112. }