]> git.saurik.com Git - wxWidgets.git/blame - include/wx/stubs/accel.h
WXFARPROC prototyped as `typedef int (__stdcall *WXFARPROC)()' (does Borland
[wxWidgets.git] / include / wx / stubs / accel.h
CommitLineData
7c23a0b0
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: accel.h
3// Purpose: wxAcceleratorTable class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_ACCEL_H_
13#define _WX_ACCEL_H_
14
15#ifdef __GNUG__
16#pragma interface "accel.h"
17#endif
18
19#include "wx/object.h"
20
21class WXDLLEXPORT wxAcceleratorTable;
22
23// Hold Ctrl key down
24#define wxACCEL_ALT 0x01
25
26// Hold Ctrl key down
27#define wxACCEL_CTRL 0x02
28
29 // Hold Shift key down
30#define wxACCEL_SHIFT 0x04
31
32class WXDLLEXPORT wxAcceleratorEntry
33{
34public:
35 wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0)
36 {
37 m_flags = flags; m_keyCode = keyCode; m_command = cmd;
38 }
39
40 inline void Set(int flags, int keyCode, int cmd)
41 { m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
42
43 inline int GetFlags() const { return m_flags; }
44 inline int GetKeyCode() const { return m_keyCode; }
45 inline int GetCommand() const { return m_command; }
46
47 int m_flags;
48 int m_keyCode; // ASCII or virtual keycode
49 int m_command; // Command id to generate
50};
51
52class WXDLLEXPORT wxAcceleratorTable: public wxObject
53{
54DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
55public:
56 wxAcceleratorTable();
57 wxAcceleratorTable(const wxString& resource); // Load from .rc resource
58 wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array
59
60 // Copy constructors
61 inline wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
62 inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
63
64 ~wxAcceleratorTable();
65
66 inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
67 inline bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; }
68 inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; }
69
70 bool Ok() const;
71/* TODO: Accessors for your GUI
72 void SetHACCEL(WXHACCEL hAccel);
73 WXHACCEL GetHACCEL() const;
74*/
75};
76
77WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
78
79#endif
80 // _WX_ACCEL_H_