home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / win32 / CmdAccelOb.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-11-04  |  3.0 KB  |  114 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. // Copyright (C) 1998 by Thierry Maurel
  3. // All rights reserved
  4. //
  5. // Distribute freely, except: don't remove my name from the source or
  6. // documentation (don't take credit for my work), mark your changes (don't
  7. // get me blamed for your possible bugs), don't alter or remove this
  8. // notice.
  9. // No warrantee of any kind, express or implied, is included with this
  10. // software; use at your own risk, responsibility for damages (if any) to
  11. // anyone resulting from the use of this software rests entirely with the
  12. // user.
  13. //
  14. // Send bug reports, bug fixes, enhancements, requests, flames, etc., and
  15. // I'll try to keep a version up to date.  I can be reached as follows:
  16. //    tmaurel@caramail.com   (or tmaurel@hol.fr)
  17. //
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // File    : CmdAccelOb.h
  20. // Project : AccelsEditor
  21. ////////////////////////////////////////////////////////////////////////////////
  22. // Version : 1.0                       * Author : T.Maurel
  23. // Date    : 17.08.98
  24. //
  25. // Remarks : 
  26. //
  27. ////////////////////////////////////////////////////////////////////////////////
  28. #ifndef __CMDACCEL_OB_INCLUDE
  29. #define __CMDACCEL_OB_INCLUDE
  30.  
  31. #include <afxtempl.h>  // MFC Templates extension
  32.  
  33. ////////////////////////////////////////////////////////////////////////
  34. //
  35. //
  36. typedef struct tagMAPVIRTKEYS {
  37.   WORD wKey;
  38.   TCHAR szKey[15];
  39. } MAPVIRTKEYS, *PMAPVIRTKEYS;
  40.  
  41.  
  42. ////////////////////////////////////////////////////////////////////////
  43. //
  44. //
  45. #define sizetable(table) (sizeof(table)/sizeof(table[0]))
  46.  
  47.  
  48. ////////////////////////////////////////////////////////////////////////
  49. //
  50. //
  51. class CAccelsOb : public CObject {
  52.  public:
  53.   CAccelsOb();
  54.   CAccelsOb(CAccelsOb* pFrom);
  55.   CAccelsOb(BYTE cVirt, WORD wKey, bool bLocked = false);
  56.   CAccelsOb(LPACCEL pACCEL);
  57.  
  58.  public:
  59.   CAccelsOb& operator=(const CAccelsOb& from);
  60.  
  61.   void GetString(CString& szBuffer);
  62.   bool IsEqual(WORD wKey, bool bCtrl, bool bAlt, bool bShift);
  63.   DWORD GetData();
  64.   bool SetData(DWORD dwDatas);
  65.  
  66.  public:
  67. #ifdef _DEBUG
  68.   virtual void AssertValid() const;
  69.   virtual void Dump(CDumpContext& dc) const;
  70. #endif
  71.  
  72.  public:
  73.   BYTE m_cVirt;
  74.   WORD m_wKey;
  75.   bool m_bLocked;
  76. };
  77.  
  78.  
  79. //////////////////////////////////////////////////////////////////////
  80. //
  81. //
  82. class CCmdAccelOb : public CObject {
  83.  public:
  84.   CCmdAccelOb();
  85.   CCmdAccelOb(WORD wIDCommand, LPCTSTR szCommand);
  86.   CCmdAccelOb(BYTE cVirt, WORD wIDCommand, WORD wKey, LPCTSTR szCommand, bool bLocked = false);
  87.   ~CCmdAccelOb();
  88.  
  89.  public:
  90.   void Add(CAccelsOb* pAccel);
  91.   void Add(BYTE cVirt, WORD wKey, bool bLocked = false);
  92.   void Reset();
  93.   void DeleteUserAccels();
  94.  
  95.   CCmdAccelOb& operator=(const CCmdAccelOb& from);
  96.  public:
  97. #ifdef _DEBUG
  98.   virtual void AssertValid() const;
  99.   virtual void Dump(CDumpContext& dc) const;
  100. #endif
  101.  
  102.  public:
  103.   WORD m_wIDCommand;
  104.   CString m_szCommand;
  105.  
  106.   CList< CAccelsOb*, CAccelsOb*& > m_Accels;
  107. };
  108.  
  109.  
  110. ////////////////////////////////////////////////////////////////////////
  111. #endif // __CMDACCEL_OB_INCLUDE
  112.  
  113.  
  114.