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.

91 lines
2.6 KiB

  1. //
  2. //
  3. //
  4. #ifndef _ASP_MAIN_H
  5. #define _ASP_MAIN_H
  6. #include "resource.h"
  7. #include "ExchControls.h"
  8. #include "PropSheet.h"
  9. #define SESSION_TIMEOUT_MIN 1
  10. #define SESSION_TIMEOUT_MAX 2000000000
  11. #define SCRIPT_TIMEOUT_MIN 1
  12. #define SCRIPT_TIMEOUT_MAX 2000000000
  13. class CAspMainPage :
  14. public WTL::CPropertyPageImpl<CAspMainPage>,
  15. public WTL::CWinDataExchange<CAspMainPage>
  16. {
  17. typedef CPropertyPageImpl<CAspMainPage> baseClass;
  18. public:
  19. CAspMainPage(CAppData * pData)
  20. {
  21. m_pData = pData;
  22. }
  23. ~CAspMainPage()
  24. {
  25. }
  26. enum {IDD = IDD_ASPMAIN};
  27. BEGIN_MSG_MAP_EX(CAspMainPage)
  28. MSG_WM_INITDIALOG(OnInitDialog)
  29. COMMAND_HANDLER_EX(IDC_ENABLE_SESSION, BN_CLICKED, OnEnableSession)
  30. COMMAND_HANDLER_EX(IDC_ENABLE_BUFFERING, BN_CLICKED, OnChangeControl)
  31. COMMAND_HANDLER_EX(IDC_ENABLE_PARENTS, BN_CLICKED, OnChangeControl)
  32. COMMAND_HANDLER_EX(IDC_SESSION_TIMEOUT, EN_CHANGE, OnChangeControl)
  33. COMMAND_HANDLER_EX(IDC_SCRIPT_TIMEOUT, EN_CHANGE, OnChangeControl)
  34. COMMAND_HANDLER_EX(IDC_LANGUAGES, EN_CHANGE, OnChangeControl)
  35. CHAIN_MSG_MAP(baseClass)
  36. END_MSG_MAP()
  37. BEGIN_DDX_MAP(CAspMainPage)
  38. DDX_CHECK(IDC_ENABLE_SESSION, m_pData->m_EnableSession)
  39. DDX_CHECK(IDC_ENABLE_BUFFERING, m_pData->m_EnableBuffering)
  40. DDX_CHECK(IDC_ENABLE_PARENTS, m_pData->m_EnableParents)
  41. if (m_pData->m_EnableSession)
  42. {
  43. DDX_INT_RANGE(IDC_SESSION_TIMEOUT,
  44. m_pData->m_SessionTimeout, SESSION_TIMEOUT_MIN, SESSION_TIMEOUT_MAX)
  45. }
  46. DDX_TEXT(IDC_LANGUAGES, m_pData->m_Languages)
  47. DDX_INT_RANGE(IDC_SCRIPT_TIMEOUT, m_pData->m_ScriptTimeout, SCRIPT_TIMEOUT_MIN, SCRIPT_TIMEOUT_MAX)
  48. DDX_CONTROL(IDC_LANGUAGES, m_LanguagesCtrl)
  49. DDX_CONTROL(IDC_TIMEOUT_SPIN, m_TimeoutSpin)
  50. DDX_CONTROL(IDC_ASPTIMEOUT_SPIN, m_AspTimeoutSpin)
  51. END_DDX_MAP()
  52. LRESULT OnInitDialog(HWND hDlg, LPARAM lParam);
  53. void OnEnableSession(UINT nCode, UINT nID, HWND hWnd);
  54. void OnChangeControl(UINT nCode, UINT nID, HWND hWnd)
  55. {
  56. if (nCode == EN_CHANGE)
  57. {
  58. TCHAR buf[MAX_PATH];
  59. UINT len = GetDlgItemText(nID, buf, MAX_PATH);
  60. BOOL bEnable = (len != 0);
  61. // Disable OK and Apply buttons
  62. ::EnableWindow(::GetDlgItem(GetParent(), IDOK), bEnable);
  63. if (!bEnable)
  64. {
  65. SET_MODIFIED(FALSE);
  66. return;
  67. }
  68. }
  69. SET_MODIFIED(TRUE);
  70. }
  71. BOOL OnKillActive();
  72. void OnDataValidateError(UINT nCtrlID, BOOL bSave, _XData& data);
  73. void OnDataExchangeError(UINT nCtrlID, BOOL bSave);
  74. void OnHelp();
  75. protected:
  76. CAppData * m_pData;
  77. CEditExch m_LanguagesCtrl;
  78. CUpDownCtrlExch m_TimeoutSpin;
  79. CUpDownCtrlExch m_AspTimeoutSpin;
  80. };
  81. #endif //_ASP_MAIN_H