home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / DEMOT.ZIP / Src / Include / OutlookBar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-23  |  2.8 KB  |  106 lines

  1. // OutlookBar.h : header file
  2. // Copyright ⌐1998 - Kirk Stowell
  3. // All Rights Reserved.
  4. //
  5. // Email: kstowel@sprynet.com
  6. // URL:   www.geocities.com/SiliconValley/Haven/8230
  7. //
  8. // You are free to use, modify and distribute this source, as long as
  9. // it is not sold for profit, and this HEADER stays intact. This source is
  10. // supplied "AS-IS", and without WARRANTY OF ANY KIND. The user
  11. // agrees to hold the author(s) blameless from any or all problems that
  12. // may arise from the use or distribution of this code.
  13. //
  14. /////////////////////////////////////////////////////////////////////////////
  15.  
  16. #if !defined(OUTLOOKBAR_H_INCLUDED)
  17. #define OUTLOOKBAR_H_INCLUDED
  18.  
  19. #if _MSC_VER >= 1000
  20. #pragma once
  21. #endif // _MSC_VER >= 1000
  22.  
  23. //////////////////////////////////////////////////////////////////////
  24. // CContentItems - Container class for menu items.
  25.  
  26. class CLASS_EXPORT CContentItems
  27. {
  28. protected:
  29.     UINT m_nImageID;
  30.     CString m_csText;
  31.  
  32. public:
  33.     CContentItems( UINT nID, CString str ) :
  34.       m_nImageID( nID ), m_csText( str ) {
  35.     }
  36.  
  37.     void operator = ( CContentItems& pItems ) {
  38.         m_nImageID = pItems.m_nImageID;
  39.         m_csText = pItems.m_csText;
  40.     }
  41.  
  42.     UINT GetImageID() { return m_nImageID; }
  43.     CString GetText() { return m_csText;  }
  44. };
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // COutlookBar class
  48.  
  49. class CLASS_EXPORT COutlookBar : public CListBox
  50. {
  51.     DECLARE_DYNAMIC(COutlookBar)
  52.  
  53. // Construction
  54. public:
  55.     COutlookBar();
  56.  
  57. // Attributes
  58. public:
  59.  
  60. // Operations
  61. public:
  62.  
  63. // Overrides
  64.     // ClassWizard generated virtual function overrides
  65.     //{{AFX_VIRTUAL(COutlookBar)
  66.     public:
  67.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  68.     virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  69.     virtual void OnSelButton() = 0;
  70.     //}}AFX_VIRTUAL
  71.  
  72. // Implementation
  73. public:
  74.     void SetImageList( UINT uList, UINT uSize, COLORREF clrMask );
  75.     void SetItems( CContentItems* pItems, int nNumItems );
  76.     virtual ~COutlookBar();
  77.  
  78. // Generated message map functions
  79. protected:
  80.     //{{AFX_MSG(COutlookBar)
  81.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  82.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  83.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  84.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  85.     afx_msg void OnTimer(UINT nIDEvent);
  86.     //}}AFX_MSG
  87.     DECLARE_MESSAGE_MAP()
  88.  
  89. protected:
  90.     CPoint          m_point;
  91.     CImageList*        m_pImageList;
  92.     CContentItems*  m_pContents;
  93.     int             m_nNumItems;
  94.     int             m_nIndex;
  95.     bool            m_bHilight;
  96.     bool            m_bLBDown;
  97. };
  98.  
  99. /////////////////////////////////////////////////////////////////////////////
  100.  
  101. //{{AFX_INSERT_LOCATION}}
  102. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  103.  
  104. #endif // !defined(OUTLOOKBAR_H_INCLUDED)
  105.  
  106.