ControlBarEx.h
上传用户:xywutai
上传日期:2007-01-02
资源大小:72k
文件大小:1k
源码类别:

工具条

开发平台:

Visual C++

  1. #ifndef __CNTBAR_H__
  2. #define __CNTBAR_H__
  3. #ifndef __AFXWIN_H__
  4.   #include <afxwin.h>
  5. #endif
  6. #ifndef __AFXIMPL_H__
  7.   #include <afximpl.h>
  8. #endif
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CControlBarEx
  11. #define CBRS_GRIPPER        0x00800000L
  12. class CControlBarEx : public CControlBar
  13. {
  14.   DECLARE_DYNAMIC(CControlBarEx)
  15. // Construction
  16. protected:
  17.   CControlBarEx()
  18.   { }
  19. // Attributes
  20.   // getting and setting border space
  21.   void SetBorders(LPCRECT lpRect)
  22.   { SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }
  23.   void SetBorders(int cxLeft = 0, int cyTop = 0, int cxRight = 0, int cyBottom = 0);
  24.   CRect GetBorders() const;
  25. // Implementation
  26. public:
  27.   virtual ~CControlBarEx()
  28.   { }
  29. virtual void DoPaint(CDC* pDC);
  30.   void DrawGripper(CDC* pDC, const CRect& rect);
  31.   // implementation helpers
  32.   virtual LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
  33.   void CalcInsideRect(CRect& rect, BOOL bHorz) const; // adjusts borders etc
  34.   void EraseNonClient();
  35.   //{{AFX_MSG(CControlBarEx)
  36.   afx_msg void OnPaint();
  37.   afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos);
  38.   //}}AFX_MSG
  39.   DECLARE_MESSAGE_MAP()
  40. };
  41. #endif //__CNTBAR_H__
  42. /////////////////////////////////////////////////////////////////////////////