home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / imagemap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 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. #ifndef __IMAGEMAP_H
  20. #define __IMAGEMAP_H
  21.  
  22. #ifndef __APIIMG_H
  23.     #include "apiimg.h"
  24. #endif
  25.  
  26. class CTreeImageMap 
  27. {
  28. protected:
  29.     int m_iImageWidth;
  30.     int m_iImageHeight;
  31.     int m_iImageCount;
  32.     int m_iBitmapWidth;
  33.     unsigned int m_iResourceID;
  34.     HBITMAP m_hBitmap;
  35.     HBITMAP m_hbmNormal;
  36.     HBITMAP m_hbmHighlight;
  37.     HBITMAP m_hbmButton;
  38.     HBITMAP m_hOriginalBitmap;
  39.     HDC m_hdcMem;
  40.  
  41.     int InitializeImage (HBITMAP);
  42.  
  43. public:
  44.     CTreeImageMap (unsigned int rcid, int width = 16, int height = 16 );
  45.     ~CTreeImageMap ( );
  46.     void Initialize ( void );
  47.     int GetImageHeight ( void ) { return m_iImageHeight; }
  48.     int GetImageWidth ( void )  { return m_iImageWidth; }
  49.     int GetImageCount ( void )  { return m_iImageCount; }
  50.     unsigned int GetResourceID ( void ) { return m_iResourceID; }
  51.     void DrawImage ( int idxImage, int x, int y, HDC hDestDC, BOOL bButton = FALSE );
  52.     void DrawTransImage ( int idxImage, int x, int y, HDC hDestDC );
  53.     void UseHighlight ( void );
  54.     void UseNormal ( void );
  55.     void CreateDefaults (int width = 16, int height = 16);
  56.     void ReInitialize(void);
  57. };
  58.  
  59. class CNSImageMap :         public  CGenericObject,
  60.                             public  IImageMap
  61. {
  62. protected:
  63.     CTreeImageMap * m_pImageMap;
  64. public:
  65.     CNSImageMap();
  66.     ~CNSImageMap();
  67.  
  68.     STDMETHODIMP QueryInterface(REFIID,LPVOID *);
  69.  
  70.     // IImageMap
  71.     virtual int  Initialize (unsigned int rcid, int width, int height);
  72.     virtual void DrawImage (int index,int x,int y,HDC hDestDC,BOOL bButton);
  73.     virtual void DrawTransImage (int index,int x,int y,HDC hDestDC);
  74.     virtual void DrawImage (int index,int x,int y,CDC * pDestDC,BOOL bButton);
  75.     virtual void DrawTransImage (int index,int x,int y,CDC * pDestDC);
  76.     virtual void ReInitialize (void);
  77.     virtual void UseNormal (void);
  78.     virtual void UseHighlight (void);
  79.     virtual int GetImageHeight (void);
  80.     virtual int GetImageWidth (void);
  81.     virtual int GetImageCount (void);
  82.     virtual unsigned int GetResourceID (void);
  83. };
  84.  
  85. #endif
  86.