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.

90 lines
2.7 KiB

  1. //
  2. //
  3. //
  4. #ifndef _CACHE_OPT_H
  5. #define _CACHE_OPT_H
  6. #include "resource.h"
  7. #include "ExchControls.h"
  8. #include "PropSheet.h"
  9. class CCacheOptPage :
  10. public WTL::CPropertyPageImpl<CCacheOptPage>,
  11. public WTL::CWinDataExchange<CCacheOptPage>
  12. {
  13. typedef WTL::CPropertyPageImpl<CCacheOptPage> baseClass;
  14. public:
  15. CCacheOptPage(CAppData * pData)
  16. {
  17. m_pData = pData;
  18. }
  19. ~CCacheOptPage()
  20. {
  21. }
  22. enum {IDD = IDD_CACHE_OPT};
  23. BEGIN_MSG_MAP_EX(CCacheOptPage)
  24. MSG_WM_INITDIALOG(OnInitDialog)
  25. COMMAND_HANDLER_EX(IDC_NO_CACHE, BN_CLICKED, OnCacheSwitch)
  26. COMMAND_HANDLER_EX(IDC_UNLIMITED_CACHE, BN_CLICKED, OnCacheSwitch)
  27. COMMAND_HANDLER_EX(IDC_LIMITED_CACHE, BN_CLICKED, OnCacheSwitch)
  28. COMMAND_HANDLER_EX(IDC_CACHE_SIZE_EDIT, EN_CHANGE, OnChangeCacheSize)
  29. COMMAND_HANDLER_EX(IDC_INMEM_LIM_EDIT, EN_CHANGE, OnChangeInmemCacheSize)
  30. COMMAND_HANDLER_EX(IDC_CACHE_PATH, EN_CHANGE, OnChangeData)
  31. COMMAND_HANDLER_EX(IDC_ENGINES, EN_CHANGE, OnChangeData)
  32. MSG_WM_HSCROLL(OnTrackBarScroll)
  33. CHAIN_MSG_MAP(baseClass)
  34. END_MSG_MAP()
  35. BEGIN_DDX_MAP(CCacheOptPage)
  36. DDX_CHECK(IDC_NO_CACHE, m_pData->m_NoCache)
  37. DDX_CHECK(IDC_UNLIMITED_CACHE, m_pData->m_UnlimCache)
  38. DDX_CHECK(IDC_LIMITED_CACHE, m_pData->m_LimCache)
  39. DDX_INT(IDC_CACHE_SIZE_EDIT, m_pData->m_TotalCacheSize)
  40. DDX_INT(IDC_INMEM_UNLIM_EDIT, m_pData->m_UnlimCacheInMemorySize)
  41. DDX_INT(IDC_INMEM_LIM_EDIT, m_pData->m_LimCacheInMemorySize)
  42. DDX_CONTROL(IDC_NO_CACHE, m_NoCacheBtn)
  43. DDX_CONTROL(IDC_UNLIMITED_CACHE, m_UnlimCacheBtn)
  44. DDX_CONTROL(IDC_LIMITED_CACHE, m_LimCacheBtn)
  45. DDX_CONTROL(IDC_CACHE_DIST, m_cache_dist)
  46. DDX_CONTROL(IDC_INMEM_UNLIM_SPIN, m_inmem_unlim)
  47. DDX_CONTROL(IDC_CACHE_SIZE_SPIN, m_cache_size)
  48. DDX_CONTROL(IDC_INMEM_LIM_SPIN, m_inmem_lim)
  49. DDX_CONTROL(IDC_ENG_CACHED_SPIN, m_eng_cache)
  50. DDX_INT(IDC_ENGINES, m_pData->m_ScriptEngCacheMax)
  51. END_DDX_MAP()
  52. public:
  53. LRESULT OnInitDialog(HWND hDlg, LPARAM lParam);
  54. void OnCacheSwitch(UINT nCode, UINT nID, HWND hWnd);
  55. void OnTrackBarScroll(UINT nSBCode, UINT nPos, HWND hwnd);
  56. void OnChangeCacheSize(UINT nCode, UINT nID, HWND hWnd);
  57. void OnChangeInmemCacheSize(UINT nCode, UINT nID, HWND hWnd);
  58. void OnChangeData(UINT nCode, UINT nID, HWND hWnd)
  59. {
  60. SET_MODIFIED(TRUE);
  61. }
  62. BOOL OnKillActive();
  63. BOOL OnApply()
  64. {
  65. APPLY_DATA();
  66. return TRUE;
  67. }
  68. void AdjustTracker();
  69. protected:
  70. CAppData * m_pData;
  71. CButtonExch m_NoCacheBtn, m_UnlimCacheBtn, m_LimCacheBtn;
  72. CTrackBarCtrlExch m_cache_dist;
  73. CUpDownCtrlExch m_inmem_unlim;
  74. CUpDownCtrlExch m_inmem_lim;
  75. CUpDownCtrlExch m_cache_size;
  76. CUpDownCtrlExch m_eng_cache;
  77. CFileChooser m_FileChooser;
  78. BOOL m_bInitDone;
  79. };
  80. #endif //_CACHE_OPT_H