1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: accel.h
|
|
|
|
// Purpose: wxAcceleratorTable class
|
1999-10-13 22:34:18 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-13 22:34:18 +00:00
|
|
|
// Created: 10/13/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-13 22:34:18 +00:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_ACCEL_H_
|
|
|
|
#define _WX_ACCEL_H_
|
|
|
|
|
|
|
|
#include "wx/object.h"
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxAcceleratorTable;
|
|
|
|
|
|
|
|
// Hold Ctrl key down
|
|
|
|
#define wxACCEL_ALT 0x01
|
|
|
|
|
|
|
|
// Hold Ctrl key down
|
|
|
|
#define wxACCEL_CTRL 0x02
|
|
|
|
|
|
|
|
// Hold Shift key down
|
|
|
|
#define wxACCEL_SHIFT 0x04
|
|
|
|
|
|
|
|
// Hold no key down
|
|
|
|
#define wxACCEL_NORMAL 0x00
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxAcceleratorTable: public wxObject
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
|
|
|
public:
|
|
|
|
wxAcceleratorTable();
|
2000-07-15 19:51:35 +00:00
|
|
|
wxAcceleratorTable(const wxString& rsResource); // Load from .rc resource
|
|
|
|
wxAcceleratorTable( int n
|
2002-05-28 16:51:14 +00:00
|
|
|
,const wxAcceleratorEntry vaEntries[]
|
2000-07-15 19:51:35 +00:00
|
|
|
); // Load from array
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
// Copy constructors
|
2000-07-15 19:51:35 +00:00
|
|
|
inline wxAcceleratorTable(const wxAcceleratorTable& rAccel) { Ref(rAccel); }
|
|
|
|
inline wxAcceleratorTable(const wxAcceleratorTable* pAccel) { if (pAccel) Ref(*pAccel); }
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
~wxAcceleratorTable();
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& rAccel)
|
|
|
|
{ if (*this == rAccel) return (*this); Ref(rAccel); return *this; };
|
|
|
|
inline bool operator == (const wxAcceleratorTable& rAccel)
|
|
|
|
{ return m_refData == rAccel.m_refData; };
|
|
|
|
inline bool operator != (const wxAcceleratorTable& rAccel)
|
|
|
|
{ return m_refData != rAccel.m_refData; };
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
bool Ok() const;
|
1999-10-11 02:49:06 +00:00
|
|
|
void SetHACCEL(WXHACCEL hAccel);
|
2000-07-15 19:51:35 +00:00
|
|
|
WXHACCEL GetHACCEL(void) const;
|
1999-10-11 02:49:06 +00:00
|
|
|
|
|
|
|
// translate the accelerator, return TRUE if done
|
2000-07-15 19:51:35 +00:00
|
|
|
bool Translate( WXHWND hWnd
|
|
|
|
,WXMSG* pMsg
|
|
|
|
) const;
|
1999-07-29 05:11:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_ACCEL_H_
|