1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: accel.h
|
|
|
|
// Purpose: wxAcceleratorTable class
|
1999-10-13 18:34:18 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-13 18:34:18 -04:00
|
|
|
// Created: 10/13/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-13 18:34:18 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04: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 15:51:35 -04:00
|
|
|
wxAcceleratorTable(const wxString& rsResource); // Load from .rc resource
|
|
|
|
wxAcceleratorTable( int n
|
2002-05-28 12:51:14 -04:00
|
|
|
,const wxAcceleratorEntry vaEntries[]
|
2000-07-15 15:51:35 -04:00
|
|
|
); // Load from array
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
// Copy constructors
|
2000-07-15 15:51:35 -04:00
|
|
|
inline wxAcceleratorTable(const wxAcceleratorTable& rAccel) { Ref(rAccel); }
|
|
|
|
inline wxAcceleratorTable(const wxAcceleratorTable* pAccel) { if (pAccel) Ref(*pAccel); }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
~wxAcceleratorTable();
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& rAccel)
|
|
|
|
{ if (*this == rAccel) return (*this); Ref(rAccel); return *this; };
|
2004-05-09 13:30:57 -04:00
|
|
|
inline bool operator== (const wxAcceleratorTable& rAccel) const
|
2000-07-15 15:51:35 -04:00
|
|
|
{ return m_refData == rAccel.m_refData; };
|
2004-05-09 13:30:57 -04:00
|
|
|
inline bool operator!= (const wxAcceleratorTable& rAccel) const
|
2000-07-15 15:51:35 -04:00
|
|
|
{ return m_refData != rAccel.m_refData; };
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
bool Ok() const;
|
1999-10-10 22:49:06 -04:00
|
|
|
void SetHACCEL(WXHACCEL hAccel);
|
2000-07-15 15:51:35 -04:00
|
|
|
WXHACCEL GetHACCEL(void) const;
|
1999-10-10 22:49:06 -04:00
|
|
|
|
|
|
|
// translate the accelerator, return TRUE if done
|
2000-07-15 15:51:35 -04:00
|
|
|
bool Translate( WXHWND hWnd
|
|
|
|
,WXMSG* pMsg
|
|
|
|
) const;
|
1999-07-29 01:11:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
|
|
|
|
|
2004-02-15 12:33:26 -05:00
|
|
|
WXDLLEXPORT wxString wxPMTextToLabel(const wxString& rsTitle);
|
1999-07-29 01:11:30 -04:00
|
|
|
#endif
|
|
|
|
// _WX_ACCEL_H_
|