PaneSearch.cpp
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:3k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // PaneSearch.cpp : implementation file
  2. //
  3. // This file is a part of the XTREME TOOLKIT PRO MFC class library.
  4. // (c)1998-2008 Codejock Software, All Rights Reserved.
  5. //
  6. // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
  7. // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
  8. // CONSENT OF CODEJOCK SOFTWARE.
  9. //
  10. // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
  11. // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
  12. // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
  13. // SINGLE COMPUTER.
  14. //
  15. // CONTACT INFORMATION:
  16. // support@codejock.com
  17. // http://www.codejock.com
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. #include "stdafx.h"
  21. #include "GUI_OneNote.h"
  22. #include "PaneSearch.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CPaneSearch
  30. CPaneSearch::CPaneSearch()
  31. {
  32. }
  33. CPaneSearch::~CPaneSearch()
  34. {
  35. }
  36. BEGIN_MESSAGE_MAP(CPaneSearch, CWnd)
  37. //{{AFX_MSG_MAP(CPaneSearch)
  38. ON_WM_CREATE()
  39. ON_WM_SYSCOLORCHANGE()
  40. ON_WM_PAINT()
  41. ON_WM_ERASEBKGND()
  42. ON_WM_SIZE()
  43. //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45. void CPaneSearch::RefreshColors()
  46. {
  47. XTPCurrentSystemTheme systemTheme = XTPColorManager()->GetCurrentSystemTheme();
  48. switch (systemTheme)
  49. {
  50. case xtpSystemThemeBlue:
  51. m_clrOffice3DFace = RGB(221, 236, 254);
  52. m_clrOffice3DFaceDark = RGB(74, 122, 201);
  53. break;
  54. case xtpSystemThemeOlive:
  55. m_clrOffice3DFace = RGB(243, 242, 231);
  56. m_clrOffice3DFaceDark = RGB(190, 198, 152);
  57. break;
  58. case xtpSystemThemeSilver:
  59. m_clrOffice3DFace = RGB(238, 238, 244);
  60. m_clrOffice3DFaceDark = RGB(177, 176, 195);
  61. break;
  62. default:
  63. m_clrOffice3DFaceLight = XTPColorManager()->LightColor(GetSysColor(COLOR_3DFACE), GetSysColor(COLOR_WINDOW), 0xCD);
  64. m_clrOffice3DFaceDark = GetSysColor(COLOR_3DFACE);
  65. m_clrOffice3DFace = XTPColorManager()->LightColor(GetSysColor(COLOR_3DFACE), GetSysColor(COLOR_WINDOW), 50);
  66. }
  67. }
  68. /////////////////////////////////////////////////////////////////////////////
  69. // CPaneSearch message handlers
  70. int CPaneSearch::OnCreate(LPCREATESTRUCT lpCreateStruct)
  71. {
  72. if (CWnd::OnCreate(lpCreateStruct) == -1)
  73. return -1;
  74. RefreshColors();
  75. return 0;
  76. }
  77. void CPaneSearch::OnSysColorChange()
  78. {
  79. CWnd::OnSysColorChange();
  80. RefreshColors();
  81. }
  82. void CPaneSearch::OnPaint()
  83. {
  84. CPaintDC dcPaint(this); // device context for painting
  85. CXTPClientRect rc(this);
  86. CXTPBufferDC dc(dcPaint, rc);
  87. XTPDrawHelpers()->GradientFill(&dc, rc, m_clrOffice3DFace, m_clrOffice3DFaceDark, FALSE);
  88. }
  89. BOOL CPaneSearch::OnEraseBkgnd(CDC* /*pDC*/)
  90. {
  91. return TRUE;
  92. }
  93. void CPaneSearch::OnSize(UINT nType, int cx, int cy)
  94. {
  95. CWnd::OnSize(nType, cx, cy);
  96. Invalidate(FALSE);
  97. }