annotate src/win32/CmdAccelOb.h @ 1:f9f4f1b99eed

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