home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////
- //
- // CHotspot.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- //
- // (C) Copyright Black Diamond Consulting, Inc 1996. All rights reserved.
- //
- // You have a royalty-free right to use, modify, reproduce and
- // distribute the Sample Files (and/or any modified version) in
- // any way you find useful, provided that you agree that Black
- // Diamond Consulting has no warranty obligations or liability
- // for any Sample Application Files which are modified.
- //
- // Revision History:
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #define __CHOTSPOT_H__
-
- #include "Surround.h"
-
- /////////////////////////////////////////////////////////////////////////////
- // CHotspot object
-
- class CHotspot : public CObject
- {
-
- public:
- int m_id; // Hotspot ID
- CString m_name; // Hotspot name
- SPHERE_POINT m_location; // Location of hotspot
- CSize m_size; // Size of hotspot
- BOOL m_bLocked; // Locked flag
-
- public: // Accessors
- CString &GetName() { return m_name; }
- SPHERE_POINT* Location() { return &m_location; }
- SIZE* Size() { return &m_size; }
- void SetWidth( int width ) { m_size.cx = width; }
- void SetHeight( int height ) { m_size.cy = height; }
- int Width() { return m_size.cx; }
- int Height() { return m_size.cy; }
- BOOL IsLocked() { return m_bLocked; }
- int GetID() { return m_id; }
-
- public:
- CHotspot( int id );
- void Draw( CDC* pDC );
- virtual ~CHotspot();
- HRESULT Write( LPSTREAM pIStream );
- HRESULT Read( LPSTREAM pIStream );
- };
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CHotspotList object
- //
- // This class is simply a list manager for hotspots
- //
- class CHotspotList : public CObArray
- {
- private:
- int m_nextID; // Next hotspot ID
-
- public:
- CHotspotList();
- virtual ~CHotspotList();
- virtual CHotspot* Create( int *id = NULL ); // Create a new hotspot
- HRESULT Write( LPSTREAM pIStream ); // Write all hotspots to a stream
- HRESULT Read( LPSTREAM pIStream ); // Read hotspots from a stream
- void ResetContent( void ); // Delete all hotspots in the list
-
- public:
- void Draw( CDC* pDC ); // Draw all hotspots
- CHotspot* PtInHotspot( CPoint point ); // Find Hotspot at point
- BOOL IsValidEntry( CHotspot* pHotspot );
- void Delete( int index ); // Delete hotspot at given index
- CHotspot* GetById( int id ); // Get hotspot bv id
- CHotspot* GetByIndex( int index ); // Get hotspot by index
- int GetIndexFromId( int id ); // Get hotspot index from it's ID
- int GetIdFromIndex( int index ); // Get hotspot ID from it's index
- };
-
-
-