home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / nsadrtyp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.7 KB  |  86 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. // NSAdrTyp.h : header file
  20. //
  21.  
  22. #ifndef __NSADRTYP_H__
  23. #define __NSADRTYP_H__
  24.  
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CAddressTypeComboBox window
  28.  
  29. class CNSAddressTypeControl : public CListBox //CComboBox
  30. {
  31. protected:
  32.     CPen pen3dLight;
  33.     CPen pen3dShadow;
  34.     CPen pen3dHilight;
  35.     CPen pen3dDkShadow;
  36.     CPen penFace;
  37.     CBrush brushFace;
  38.     HFONT m_cfTextFont;
  39.     int m_iTypeBitmapWidth;
  40. // Construction
  41. public:
  42.     CNSAddressTypeControl();
  43.     BOOL Create( CWnd *pParent );
  44.     void DrawItemSoItLooksLikeAButton(CDC * pDC, CRect & rect, CString & cs);
  45.  
  46. protected:
  47. // Overrides
  48.     // ClassWizard generated virtual function overrides
  49.     //{{AFX_VIRTUAL(CNSAddressTypeControl)
  50.     public:
  51.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  52.     virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  53.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  54.     virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct);
  55.     //}}AFX_VIRTUAL
  56.  
  57. // Implementation
  58. public:
  59.     virtual ~CNSAddressTypeControl();
  60.  
  61.     // Generated message map functions
  62. protected:
  63.     void DrawHighlight(HDC hDC, CRect &rect, HPEN hpenTopLeft, HPEN hpenBottomRight);
  64.     void DrawRaisedRect(HDC hDC, CRect &rect);
  65.  
  66.     //{{AFX_MSG(CNSAddressTypeControl)
  67.     afx_msg void OnKillFocus(CWnd *);
  68.     afx_msg void OnSetFocus(CWnd* pOldWnd);
  69.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  70.     afx_msg void OnSelchange();
  71.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  72.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  73.     //}}AFX_MSG
  74.  
  75.     DECLARE_MESSAGE_MAP()
  76. };
  77.  
  78. void DrawTransparentBitmap(
  79.     HDC hdc, HBITMAP hBitmap, short xStart, short yStart, COLORREF cTransparentColor 
  80.     );
  81. void DrawTypeBitmap(CRect &rect, CDC * pDC, BOOL bPressed, BOOL bHighlight = FALSE);
  82.  
  83. #define TEXT_PAD    8
  84.  
  85. #endif // __NSADRTYP_H__  include class CNSAddressTypeControl
  86.