RTFrameWnd.h
上传用户:qhonly
上传日期:2013-06-10
资源大小:487k
文件大小:4k
源码类别:

界面编程

开发平台:

Visual C++

  1. // RTFrameWnd.h : CRTFrameWnd 类的接口
  2. //
  3. #pragma once
  4. #include "RTMenu.h"
  5. class CRTFrameWnd : public CFrameWnd
  6. {
  7. public: // 仅从序列化创建
  8. CRTFrameWnd();
  9. DECLARE_DYNCREATE(CRTFrameWnd)
  10. // 属性
  11. public:
  12. typedef enum _tagDrawState
  13. {
  14. StateNormal = 0,
  15. StateDown = 1,
  16. StateFocus = 2,
  17. StateDisable = 3
  18. }DrawState;
  19. typedef enum _tagMouseState
  20. {
  21. MouseStateNormal = 0,
  22. MouseStateDown =1,
  23. MouseStateUp = 2
  24. }MouseState;
  25. typedef enum _tagTitleButtons
  26. {
  27. ExitButton = 0,
  28. MaximizeButton = 1,
  29. MinimizeButton = 2,
  30. NoneButton = -1
  31. }TitleButtons;
  32. // 操作
  33. public:
  34. // 重写
  35. public:
  36. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  37. // 实现
  38. public:
  39. virtual ~CRTFrameWnd();
  40. #ifdef _DEBUG
  41. virtual void AssertValid() const;
  42. virtual void Dump(CDumpContext& dc) const;
  43. #endif
  44. protected:  
  45. static COLORREF    m_BorderColor[4];
  46. static CBitmap*    m_TitleBarBitmap[5];
  47. static CBitmap*    m_MenuBarBitmap[5];
  48. static CBitmap*    m_MaximizeButtonBitmap[5];
  49. static CBitmap*    m_MinimizeButtonBitmap[5];
  50. static CBitmap*    m_RestoreButtonBitmap[5];
  51. static CBitmap*    m_ExitButtonBitmap[5];
  52. static UINT        m_TitleBarBitmapDrawMode[5];
  53. static UINT        m_MenuBarBitmapDrawMode[5];
  54. static UINT        m_MaximizeButtonBitmapDrawMode[5];
  55. static UINT        m_MinimizeButtonBitmapDrawMode[5];
  56. static UINT        m_RestoreButtonBitmapDrawMode[5];
  57. static UINT        m_ExitButtonBitmapDrawMode[5];
  58. static BOOL        m_bEnableSkin;
  59. static BOOL        m_bEnableBackAndBorder;
  60. static BOOL        m_bEnableTitleBar;
  61. BOOL        m_bActive;
  62. int         m_ExitButtonState;
  63. int         m_MaximizeButtonState;
  64. int         m_MinimizeButtonState;
  65. MouseState  m_NcMouseState;
  66. TitleButtons m_SelTitleButton;
  67. // 生成的消息映射函数
  68. protected:
  69. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  70. DECLARE_MESSAGE_MAP()
  71. DECLARE_MENUXP()
  72. public:
  73. virtual BOOL LoadFrame(UINT nIDResource,
  74. DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,
  75. CWnd* pParentWnd = NULL,
  76. CCreateContext* pContext = NULL);
  77. static BOOL EnableSkin(BOOL bEnable = TRUE,BOOL bEnablBackAndBorder = TRUE,BOOL bEnbleTitleBar = TRUE);
  78. BOOL RTDrawFrameBorder(CDC *pDC,HRGN hRgn = NULL);
  79. BOOL RTDrawMenuBar(CDC *pDC,LPARAM lParam,HRGN hrgn = NULL);
  80. BOOL RTDrawTitleBar(CDC* pDC,BOOL bActive,HRGN hrgn = NULL);
  81. BOOL RTDrawTitleBarButtons(CDC* pDC);
  82. static BOOL SetBorderColor(COLORREF ColorArray[]);
  83. static BOOL SetMaximizeButtonBitmap(CBitmap *MaximizeButtonBitmap[],UINT DrawMode[]);
  84. static BOOL SetMinimizeButtonBitmap(CBitmap *MinimizeButtonBitmap[],UINT DrawMode[]);
  85. static BOOL SetExitButtonBitmap(CBitmap *ExitButtonBitmap[],UINT DrawMode[]);
  86. static BOOL SetRestoreButtonBitmap(CBitmap* RestoreButtonBitmap[],UINT DrawMode[]);
  87. static BOOL SetTitleBarBitmap(CBitmap* TitleBarBitmap[],UINT DrawMode[]);
  88. static BOOL SetMenuBarBitmap(CBitmap* MenuBarBitmap[],UINT DrawMode[]);
  89. LRESULT OnRTNcPaint(WPARAM wParam, LPARAM lParam);
  90. LRESULT OnRTNcActive(WPARAM wParam, LPARAM lParam);
  91. LRESULT OnRTActive(WPARAM wParam,LPARAM lParam);
  92. LRESULT OnRTNodify(WPARAM wParam, LPARAM lParam);
  93. LRESULT OnRTActiveApp(WPARAM wParam,LPARAM lParam);
  94. LRESULT OnRTSetIcon(WPARAM wParam, LPARAM lParam);
  95. LRESULT OnRTNcMouseMove(WPARAM wParam,LPARAM lParam);
  96. LRESULT OnRTNcLMouseDown(WPARAM wParam,LPARAM lParam);
  97. LRESULT OnRTNcLMouseUp(WPARAM wParam,LPARAM lParam);
  98. LRESULT OnRTMouseMove(WPARAM wParam, LPARAM lParam);
  99. LRESULT OnRTLButtonUp(WPARAM wParam, LPARAM lParam);
  100. LRESULT OnRTNcHitTest(WPARAM wParam, LPARAM lParam);
  101. LRESULT OnRTSetText(WPARAM wParam, LPARAM lParam);
  102. LRESULT OnRTSysCommand(WPARAM wParam,LPARAM lParam);
  103. LRESULT OnRTSetCursor(WPARAM wParam,LPARAM lParam);
  104. protected:
  105. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  106. };