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

界面编程

开发平台:

Visual C++

  1. #pragma once
  2. // CRTDialog 对话框
  3. #include "RTMenu.h"
  4. class CRTDialog : public CDialog
  5. {
  6. DECLARE_DYNAMIC(CRTDialog)
  7. public:
  8. CRTDialog();   // 标准构造函数
  9. CRTDialog(UINT uTemplate,CWnd* pParent = NULL);   // 标准构造函数
  10. CRTDialog(LPCTSTR lpszTemplateName,CWnd *pParent = NULL);   // 标准构造函数
  11. virtual ~CRTDialog();
  12. public:
  13. typedef enum _tagDrawState
  14. {
  15. StateNormal = 0,
  16. StateDown = 1,
  17. StateFocus = 2,
  18. StateDisable = 3
  19. }DrawState;
  20. typedef enum _tagMouseState
  21. {
  22. MouseStateNormal = 0,
  23. MouseStateDown =1,
  24. MouseStateUp = 2
  25. }MouseState;
  26. typedef enum _tagTitleButtons
  27. {
  28. ExitButton = 0,
  29. MaximizeButton = 1,
  30. MinimizeButton = 2,
  31. NoneButton = -1
  32. }TitleButtons;
  33. protected:  
  34. static COLORREF    m_BorderColor[4];
  35. static CBitmap*    m_TitleBarBitmap[5];
  36. static CBitmap*    m_MenuBarBitmap[5];
  37. static CBitmap*    m_MaximizeButtonBitmap[5];
  38. static CBitmap*    m_MinimizeButtonBitmap[5];
  39. static CBitmap*    m_RestoreButtonBitmap[5];
  40. static CBitmap*    m_ExitButtonBitmap[5];
  41. static UINT        m_TitleBarBitmapDrawMode[5];
  42. static UINT        m_MenuBarBitmapDrawMode[5];
  43. static UINT        m_MaximizeButtonBitmapDrawMode[5];
  44. static UINT        m_MinimizeButtonBitmapDrawMode[5];
  45. static UINT        m_RestoreButtonBitmapDrawMode[5];
  46. static UINT        m_ExitButtonBitmapDrawMode[5];
  47. static BOOL        m_bEnableSkin;
  48. static BOOL        m_bEnableBorder;
  49. static BOOL        m_bEnableBack;
  50. static BOOL        m_bEnableTitleBar;
  51. BOOL        m_bActive;
  52. int         m_ExitButtonState;
  53. int         m_MaximizeButtonState;
  54. int         m_MinimizeButtonState;
  55. MouseState  m_NcMouseState;
  56. TitleButtons m_SelTitleButton;
  57. public:
  58. static BOOL EnableSkin(BOOL bEnable = TRUE,BOOL bEnableBorder = FALSE,BOOL bEnableBack=FALSE,BOOL bEnableTitleBar = FALSE);
  59. BOOL RTDrawFrameBorder(CDC *pDC,HRGN hrgn = NULL);
  60. BOOL RTDrawMenuBar(CDC *pDC,LPARAM lParam,HRGN hrgn = NULL);
  61. BOOL RTDrawTitleBar(CDC* pDC,BOOL bActive,HRGN hrgn = NULL);
  62. BOOL RTDrawTitleBarButtons(CDC* pDC);
  63. static BOOL SetBorderColor(COLORREF ColorArray[]);
  64. static BOOL SetMaximizeButtonBitmap(CBitmap *MaximizeButtonBitmap[],UINT DrawMode[]);
  65. static BOOL SetMinimizeButtonBitmap(CBitmap *MinimizeButtonBitmap[],UINT DrawMode[]);
  66. static BOOL SetExitButtonBitmap(CBitmap *ExitButtonBitmap[],UINT DrawMode[]);
  67. static BOOL SetRestoreButtonBitmap(CBitmap* RestoreButtonBitmap[],UINT DrawMode[]);
  68. static BOOL SetTitleBarBitmap(CBitmap* TitleBarBitmap[],UINT DrawMode[]);
  69. static BOOL SetMenuBarBitmap(CBitmap* MenuBarBitmap[],UINT DrawMode[]);
  70. LRESULT OnRTNcPaint(WPARAM wParam, LPARAM lParam);
  71. LRESULT OnRTNcActive(WPARAM wParam, LPARAM lParam);
  72. LRESULT OnRTActive(WPARAM wParam,LPARAM lParam);
  73. LRESULT OnRTNodify(WPARAM wParam, LPARAM lParam);
  74. LRESULT OnRTActiveApp(WPARAM wParam,LPARAM lParam);
  75. LRESULT OnRTSetIcon(WPARAM wParam, LPARAM lParam);
  76. LRESULT OnRTNcMouseMove(WPARAM wParam,LPARAM lParam);
  77. LRESULT OnRTNcLMouseDown(WPARAM wParam,LPARAM lParam);
  78. LRESULT OnRTNcLMouseUp(WPARAM wParam,LPARAM lParam);
  79. LRESULT OnRTMouseMove(WPARAM wParam, LPARAM lParam);
  80. LRESULT OnRTLButtonUp(WPARAM wParam, LPARAM lParam);
  81. LRESULT OnRTNcHitTest(WPARAM wParam, LPARAM lParam);
  82. LRESULT OnRTGetText(WPARAM wParam, LPARAM lParam);
  83. LRESULT OnRTSetText(WPARAM wParam, LPARAM lParam);
  84. LRESULT OnRTEraseBackGround(WPARAM wParam,LPARAM lParam);
  85. LRESULT OnRTNcRButtonDown(WPARAM wParam,LPARAM lParam);
  86. LRESULT OnRTNcRButtonUp(WPARAM wParam,LPARAM lParam);
  87. LRESULT OnRTSysCommand(WPARAM wParam,LPARAM lParam);
  88. LRESULT OnRTSetCursor(WPARAM wParam,LPARAM lParam);
  89. protected:
  90. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
  91. DECLARE_MESSAGE_MAP()
  92. DECLARE_MENUXP()
  93. protected:
  94. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  95. };