home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SAMPLES / CTRLBARS / PALETTE.H_ / PALETTE.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  1.9 KB  |  70 lines

  1. // palette.h : interface of the CPaletteBar class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #ifndef __AFXEXT_H__
  14. #include <afxext.h>         // for access to CToolBar
  15. #endif
  16.  
  17. class CPaletteBar : public CToolBar
  18. {
  19. // Constructor
  20. public:
  21.     CPaletteBar();
  22.     BOOL Create(CWnd* pOwnerWnd, int x, int y);
  23.     void SetSizes(SIZE sizeButton, SIZE sizeImage, UINT nColumns);
  24.     BOOL SetButtons(const UINT FAR* lpIDArray, int nIDCount, UINT nColumns);
  25.  
  26. // Attributes
  27. public:
  28.  
  29. // Operations
  30. public:
  31.  
  32. // Implementation
  33. public:
  34.     virtual ~CPaletteBar();
  35. #ifdef _DEBUG
  36.     virtual void AssertValid() const;
  37.     virtual void Dump(CDumpContext& dc) const;
  38. #endif
  39.  
  40. protected:
  41.     // overridden from CToolBar implementation
  42.     virtual void GetItemRect(int nIndex, LPRECT lpRect) const;
  43.     virtual int HitTest(CPoint point);
  44.     virtual void DoPaint(CDC* pDC);
  45.  
  46.     void InvertTracker(CPoint point);
  47.     void RecalcLayout(UINT nButtonCount);
  48.  
  49. protected:
  50.     BOOL    m_bTrackMove;
  51.     CPoint  m_ptMouse, m_ptLast;
  52.     UINT    m_nColumns;
  53.     CWnd*   m_pOwnerWnd;
  54.     UINT    m_cxRightBorder;
  55.  
  56. // Generated message map functions
  57. protected:
  58.     //{{AFX_MSG(CPaletteBar)
  59.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  60.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  61.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  62.     afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
  63.     //}}AFX_MSG
  64.     DECLARE_MESSAGE_MAP()
  65. };
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68.  
  69.  
  70.