X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e320a79f187558effb04d92020b470372bbe456..399b60a0ad232265cd74ce8bf6a53a1f2cc57ff2:/src/os2/accel.cpp diff --git a/src/os2/accel.cpp b/src/os2/accel.cpp index b0b8734d55..7be1c6acd3 100644 --- a/src/os2/accel.cpp +++ b/src/os2/accel.cpp @@ -1,25 +1,29 @@ ///////////////////////////////////////////////////////////////////////////// // Name: accel.cpp // Purpose: wxAcceleratorTable -// Author: AUTHOR +// Author: David Webster // Modified by: -// Created: ??/??/98 +// Created: 10/13/99 // RCS-ID: $Id$ -// Copyright: (c) AUTHOR +// Copyright: (c) David Webster // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "accel.h" -#endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" +#ifndef WX_PRECOMP +#include #include "wx/setup.h" -#include "wx/accel.h" -#include "wx/string.h" +#include "wx/window.h" +#endif + +#include "wx/os2/accel.h" + +#include "wx/os2/private.h" + -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) -#endif class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData { @@ -28,11 +32,10 @@ public: wxAcceleratorRefData(); ~wxAcceleratorRefData(); -/* TODO: implementation inline HACCEL GetHACCEL() const { return m_hAccel; } protected: HACCEL m_hAccel; -*/ + bool m_ok; }; #define M_ACCELDATA ((wxAcceleratorRefData *)m_refData) @@ -76,6 +79,8 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) */ } +extern int wxCharCodeWXToOS2(int id, bool *isVirtual); + // Create from an array wxAcceleratorTable::wxAcceleratorTable(int n, wxAcceleratorEntry entries[]) { @@ -91,3 +96,29 @@ bool wxAcceleratorTable::Ok() const return FALSE; } +void wxAcceleratorTable::SetHACCEL(WXHACCEL hAccel) +{ + if (!M_ACCELDATA) + m_refData = new wxAcceleratorRefData; + + M_ACCELDATA->m_hAccel = (HACCEL) hAccel; +} + +WXHACCEL wxAcceleratorTable::GetHACCEL() const +{ + if (!M_ACCELDATA) + return 0; + return (WXHACCEL) M_ACCELDATA->m_hAccel; +} + +bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const +{ + // TODO: +/* + MSG *msg = (MSG *)wxmsg; + + return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); +*/ + return FALSE; +} +