X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4da152ea3ec3968fb2f304b6ed73e0279c19506..86b79b93fbbb0c2e90e6595f7fea0f979b80881c:/src/msw/accel.cpp diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index 88351417c7..5f82d74601 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "accel.h" #endif @@ -26,6 +26,8 @@ #include "wx/accel.h" +#if wxUSE_ACCEL + #include "wx/msw/private.h" IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) @@ -57,10 +59,7 @@ wxAcceleratorRefData::~wxAcceleratorRefData() { if (m_hAccel) { - // This function not available in WIN16 -#if !defined(__WIN16__) && !defined(__TWIN32__) DestroyAcceleratorTable((HACCEL) m_hAccel); -#endif } m_hAccel = 0 ; } @@ -80,7 +79,7 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) m_refData = new wxAcceleratorRefData; HACCEL hAccel = -#if defined(__WIN32__) && !defined(__TWIN32__) +#if defined(__WIN32__) #ifdef UNICODE ::LoadAcceleratorsW(wxGetInstance(), (const wxChar *)resource); #else @@ -96,10 +95,8 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) extern int wxCharCodeWXToMSW(int id, bool *isVirtual); // Create from an array -#if !defined(__WIN16__) && !defined(__TWIN32__) wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) { - // Not available in WIN16 m_refData = new wxAcceleratorRefData; ACCEL* arr = new ACCEL[n]; @@ -131,14 +128,6 @@ wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[] M_ACCELDATA->m_ok = (M_ACCELDATA->m_hAccel != 0); } -#else // Win16 -wxAcceleratorTable::wxAcceleratorTable(int WXUNUSED(n), const wxAcceleratorEntry WXUNUSED(entries)[]) -{ - // No, we simply gracefully degrade; we don't expect the - // developer to pepper their code with #ifdefs just for this. - // wxFAIL_MSG("not implemented"); -} -#endif // Win32/16 bool wxAcceleratorTable::Ok() const { @@ -166,3 +155,4 @@ bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); } +#endif