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

对话框与窗口

开发平台:

Visual C++

  1. // CustomControls.h
  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. #if !defined(AFX_CUSTOMCONTROLS_H__)
  21. #define AFX_CUSTOMCONTROLS_H__
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif // _MSC_VER > 1000
  25. #include "MainFrm.h"
  26. class CControlButtonLine : public CXTPControlButton
  27. {
  28. DECLARE_XTP_CONTROL(CControlButtonLine)
  29. public:
  30. CControlButtonLine(double dWidth = 0);
  31. protected:
  32. virtual CSize GetSize(CDC* pDC);
  33. virtual void Draw(CDC* pDC);
  34. virtual void Copy(CXTPControl* pControl, BOOL bRecursive = FALSE);
  35. virtual void DoPropExchange(CXTPPropExchange* pPX);
  36. private:
  37. double m_dWidth;
  38. };
  39. class CControlButtonStyle : public CXTPControlButton
  40. {
  41. DECLARE_XTP_CONTROL(CControlButtonStyle)
  42. public:
  43. CControlButtonStyle(int nStyle = 0);
  44. protected:
  45. virtual CSize GetSize(CDC* pDC);
  46. virtual void Draw(CDC* pDC);
  47. virtual void Copy(CXTPControl* pControl, BOOL bRecursive = FALSE);
  48. virtual void DoPropExchange(CXTPPropExchange* pPX);
  49. private:
  50. int m_nStyle;
  51. };
  52. class CControlButtonArrow : public CXTPControlButton
  53. {
  54. DECLARE_XTP_CONTROL(CControlButtonArrow)
  55. public:
  56. CControlButtonArrow(int nStyle = 0);
  57. protected:
  58. virtual CSize GetSize(CDC* pDC);
  59. virtual void Draw(CDC* pDC);
  60. virtual void Copy(CXTPControl* pControl, BOOL bRecursive = FALSE);
  61. virtual void DoPropExchange(CXTPPropExchange* pPX);
  62. private:
  63. int m_nStyle;
  64. };
  65. class CControlComboBoxEditEx : public CXTMaskEditT<CXTPControlComboBoxEditCtrl>
  66. {
  67. public:
  68. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  69. DECLARE_MESSAGE_MAP()
  70. };
  71. class CControlComboBoxEx: public CXTPControlComboBox
  72. {
  73. DECLARE_XTP_CONTROL(CControlComboBoxEx)
  74. public:
  75. CXTPControlComboBoxEditCtrl* CreateEditControl()
  76. {
  77. return new CControlComboBoxEditEx();
  78. }
  79. };
  80. class CControlComboBoxPopup: public CXTPControlComboBox
  81. {
  82. DECLARE_XTP_CONTROL(CControlComboBoxPopup)
  83. public:
  84. CString GetListBoxText() const;
  85. };
  86. class CControlComboBoxCustomDraw: public CXTPControlFontComboBox
  87. {
  88. DECLARE_XTP_CONTROL(CControlComboBoxCustomDraw)
  89. public:
  90. CControlComboBoxCustomDraw(CXTPCommandBars* pCommandBars = NULL)
  91. {
  92. GetCommandBar()->SetCommandBars(pCommandBars); // Require to find Site.
  93. ModifyListBoxStyle(0, LBS_OWNERDRAWFIXED | LBS_HASSTRINGS);
  94. ((CXTPControlFontComboBoxList*)GetCommandBar())->EnumFontFamiliesEx(1);
  95. }
  96. void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  97. };
  98. class CControlComboBoxDatePicker : public CXTPControlComboBox
  99. {
  100. DECLARE_XTP_CONTROL(CControlComboBoxDatePicker);
  101. public:
  102. CControlComboBoxDatePicker();
  103. ~CControlComboBoxDatePicker();
  104. public:
  105. void OnKillFocus();
  106. BOOL OnHookKeyDown(UINT nChar, LPARAM lParam);
  107. void SetDate(COleDateTime& dt);
  108. const COleDateTime& GetDate() const;
  109. protected:
  110. COleDateTime m_dt;
  111. };
  112. #endif //AFX_CUSTOMCONTROLS_H__