]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/accel.h
wxMac should use /src/mac/carbon/spinctrl.cpp, applied some sizing
[wxWidgets.git] / include / wx / msw / accel.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/accel.h
3 // Purpose: wxAcceleratorTable class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 31/7/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_ACCEL_H_
13 #define _WX_ACCEL_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "accel.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // the accel table has all accelerators for a given window or menu
21 // ----------------------------------------------------------------------------
22
23 class WXDLLEXPORT wxAcceleratorTable : public wxObject
24 {
25 public:
26 // default ctor
27 wxAcceleratorTable();
28
29 // copy ctor
30 wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
31
32 // load from .rc resource (Windows specific)
33 wxAcceleratorTable(const wxString& resource);
34
35 // initialize from array
36 wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
37
38 virtual ~wxAcceleratorTable();
39
40 wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if ( *this != accel ) Ref(accel); return *this; }
41 bool operator==(const wxAcceleratorTable& accel) const
42 { return m_refData == accel.m_refData; } // FIXME: this is wrong (VZ)
43 bool operator!=(const wxAcceleratorTable& accel) const
44 { return !(*this == accel); }
45
46 bool Ok() const;
47 void SetHACCEL(WXHACCEL hAccel);
48 WXHACCEL GetHACCEL() const;
49
50 // translate the accelerator, return TRUE if done
51 bool Translate(wxWindow *window, WXMSG *msg) const;
52
53 private:
54 DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
55 };
56
57 #endif
58 // _WX_ACCEL_H_