home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1998 October / dpcb1098.iso / Business / Maxim / MAX5 / data.z / OwnComboBox.h < prev    next >
C/C++ Source or Header  |  1998-05-15  |  2KB  |  75 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // NAME.......: OwnComboBox.h                                               
  3. // PURPOSE....: Ownerdrawn combo (bmp and text) box for displaying 
  4. //              appointment types and assoc. bmps  (page 3)
  5. // WRITTEN....: 96/09/27 by Darko Juvan
  6. // DESCRIPTION: owner drawn combo box
  7. //
  8. // This code and information is provided "as is" without warranty of any
  9. // kind, either expressed or implied, including but not limited to the
  10. // implied warranties of merchantability and/or fitness for a particular
  11. // purpose..
  12. //
  13. // Copyright (c) 1998  Multiactive Software Inc.  All Rights Reserved.
  14. //
  15. //////////////////////////////////////////////////////////////////////////////
  16.  
  17.  
  18. class CBmpComboData 
  19. {
  20. public:
  21.     CBmpComboData (const char* pszText, UINT nBitmapID)
  22.         : m_sText (pszText), m_nBitmapID (nBitmapID) 
  23.         { }
  24.  
  25.     CSize GetSize();
  26.     void DrawItem (CDC* pDC, const CRect& rc, BOOL bSelected);
  27.     void Focus (CDC* pDC, const CRect& rc, BOOL bAddFocus);
  28.  
  29. protected:
  30.     CString m_sText;
  31.     UINT    m_nBitmapID;
  32.  
  33.     CBitmap m_bmp;
  34.     CSize   m_size;
  35.  
  36.     void LoadBitmap();
  37. };
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CBmpCombo window
  41.  
  42. class CBmpCombo : public CComboBox
  43. {
  44. // Construction
  45. public:
  46.     CBmpCombo();
  47.  
  48. // Operations
  49. public:
  50.     int AddItem (const char* pszText, UINT nBitmapID);
  51.  
  52. // Overrides
  53.     // ClassWizard generated virtual function overrides
  54.     //{{AFX_VIRTUAL(CBmpCombo)
  55.     public:
  56.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  57.     virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  58.     virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct);
  59.     //}}AFX_VIRTUAL
  60.  
  61. // Implementation
  62. public:
  63.     virtual ~CBmpCombo();
  64.  
  65.     // Generated message map functions
  66. protected:
  67.     //{{AFX_MSG(CBmpCombo)
  68.         // NOTE - the ClassWizard will add and remove member functions here.
  69.     //}}AFX_MSG
  70.  
  71.     DECLARE_MESSAGE_MAP()
  72. };
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75.