]> git.saurik.com Git - wxWidgets.git/blame - src/os2/accel.cpp
Various distrib things,
[wxWidgets.git] / src / os2 / accel.cpp
CommitLineData
0e320a79
DW
1/////////////////////////////////////////////////////////////////////////////
2// Name: accel.cpp
3// Purpose: wxAcceleratorTable
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
75f11ad7
DW
12// For compilers that support precompilation, includes "wx.h".
13#include "wx/wxprec.h"
0e320a79 14
75f11ad7
DW
15#ifndef WX_PRECOMP
16#include <stdio.h>
0e320a79 17#include "wx/setup.h"
75f11ad7
DW
18#include "wx/window.h"
19#endif
20
21#include "wx/os2/accel.h"
22
23#include "wx/os2/private.h"
24
0e320a79
DW
25
26#if !USE_SHARED_LIBRARIES
27IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject)
28#endif
29
30class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData
31{
32 friend class WXDLLEXPORT wxAcceleratorTable;
33public:
34 wxAcceleratorRefData();
35 ~wxAcceleratorRefData();
36
0e320a79
DW
37 inline HACCEL GetHACCEL() const { return m_hAccel; }
38protected:
39 HACCEL m_hAccel;
0e320a79
DW
40};
41
42#define M_ACCELDATA ((wxAcceleratorRefData *)m_refData)
43
44wxAcceleratorRefData::wxAcceleratorRefData()
45{
46 // TODO
47/*
48 HACCEL m_hAccel;
49*/
50}
51
52wxAcceleratorRefData::~wxAcceleratorRefData()
53{
54/*
55 if (m_hAccel)
56 {
57 DestroyAcceleratorTable((HACCEL) m_hAccel);
58 }
59 m_hAccel = 0 ;
60*/
61}
62
63wxAcceleratorTable::wxAcceleratorTable()
64{
65 m_refData = NULL;
66}
67
68wxAcceleratorTable::~wxAcceleratorTable()
69{
70}
71
72// Load from .rc resource
73wxAcceleratorTable::wxAcceleratorTable(const wxString& resource)
74{
75 m_refData = new wxAcceleratorRefData;
76
77/* TODO: load acelerator from resource, if appropriate for your platform
78 M_ACCELDATA->m_hAccel = hAccel;
79 M_ACCELDATA->m_ok = (hAccel != 0);
80*/
81}
82
83// Create from an array
84wxAcceleratorTable::wxAcceleratorTable(int n, wxAcceleratorEntry entries[])
85{
86 m_refData = new wxAcceleratorRefData;
87
88/* TODO: create table from entries
89 */
90}
91
92bool wxAcceleratorTable::Ok() const
93{
94 // TODO
95 return FALSE;
96}
97
75f11ad7
DW
98void wxAcceleratorTable::SetHACCEL(WXHACCEL hAccel)
99{
100 if (!M_ACCELDATA)
101 m_refData = new wxAcceleratorRefData;
102
103 M_ACCELDATA->m_hAccel = (HACCEL) hAccel;
104}
105
106WXHACCEL wxAcceleratorTable::GetHACCEL() const
107{
108 if (!M_ACCELDATA)
109 return 0;
110 return (WXHACCEL) M_ACCELDATA->m_hAccel;
111}
112
113bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const
114{
115 // TODO:
116/*
117 MSG *msg = (MSG *)wxmsg;
118
119 return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg);
120*/
121 return FALSE;
122}
123