1
0

OptionsSheet.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // OptionsSheet.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CP_Main.h"
  5. #include "OptionsSheet.h"
  6. #include "OptionsKeyBoard.h"
  7. #include "OptionsGeneral.h"
  8. #include "OptionsQuickPaste.h"
  9. #include "OptionsStats.h"
  10. #include "OptionsTypes.h"
  11. #include "About.h"
  12. #include "OptionFriends.h"
  13. #include "OptionsCopyBuffers.h"
  14. #include "Misc.h"
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. /////////////////////////////////////////////////////////////////////////////
  21. // COptionsSheet
  22. IMPLEMENT_DYNAMIC(COptionsSheet, CPropertySheet)
  23. COptionsSheet::COptionsSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
  24. :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
  25. {
  26. m_pKeyBoardOptions = NULL;
  27. m_pGeneralOptions = NULL;
  28. m_pQuickPasteOptions = NULL;
  29. m_pUtilites = NULL;
  30. m_pStats = NULL;
  31. m_pTypes = NULL;
  32. m_pAbout = NULL;
  33. m_pFriends = NULL;
  34. m_pCopyBuffers = NULL;
  35. m_hWndParent = NULL;
  36. EnableStackedTabs(TRUE);
  37. m_pGeneralOptions = new COptionsGeneral;
  38. m_pKeyBoardOptions = new COptionsKeyBoard;
  39. m_pQuickPasteOptions = new COptionsQuickPaste;
  40. m_pCopyBuffers = new COptionsCopyBuffers;
  41. m_pStats = new COptionsStats;
  42. m_pTypes = new COptionsTypes;
  43. m_pAbout = new CAbout;
  44. AddPage(m_pGeneralOptions);
  45. AddPage(m_pTypes);
  46. AddPage(m_pKeyBoardOptions);
  47. AddPage(m_pCopyBuffers);
  48. AddPage(m_pQuickPasteOptions);
  49. if(g_Opt.GetAllowFriends())
  50. {
  51. m_pFriends = new COptionFriends;
  52. AddPage(m_pFriends);
  53. }
  54. AddPage(m_pStats);
  55. AddPage(m_pAbout);
  56. }
  57. COptionsSheet::~COptionsSheet()
  58. {
  59. delete m_pKeyBoardOptions;
  60. delete m_pGeneralOptions;
  61. delete m_pQuickPasteOptions;
  62. delete m_pUtilites;
  63. delete m_pStats;
  64. delete m_pTypes;
  65. delete m_pAbout;
  66. delete m_pFriends;
  67. delete m_pCopyBuffers;
  68. }
  69. BEGIN_MESSAGE_MAP(COptionsSheet, CPropertySheet)
  70. //{{AFX_MSG_MAP(COptionsSheet)
  71. // NOTE - the ClassWizard will add and remove mapping macros here.
  72. ON_WM_DESTROY()
  73. //ON_WM_CLOSE()
  74. //}}AFX_MSG_MAP
  75. END_MESSAGE_MAP()
  76. /////////////////////////////////////////////////////////////////////////////
  77. // COptionsSheet message handlers
  78. void COptionsSheet::OnDestroy()
  79. {
  80. ::SendMessage(m_hWndParent, WM_OPTIONS_CLOSED, 0, 0);
  81. CPropertySheet::OnDestroy();
  82. }
  83. void COptionsSheet::SetNotifyWnd(HWND hWnd)
  84. {
  85. m_hWndParent = hWnd;
  86. }
  87. BOOL COptionsSheet::OnInitDialog()
  88. {
  89. m_bModeless = FALSE;
  90. m_nFlags |= WF_CONTINUEMODAL;
  91. BOOL bResult = CPropertySheet::OnInitDialog();
  92. SetWindowText(_T("Ditto"));
  93. theApp.m_Language.UpdateOptionsSheet(this);
  94. ::ShowWindow(::GetDlgItem(m_hWnd, ID_APPLY_NOW), SW_HIDE);
  95. m_bModeless = TRUE;
  96. m_nFlags &= ~WF_CONTINUEMODAL;
  97. return bResult;
  98. }