X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d120f8391920145647ec10e84629bc21fa9f1bb..404f1d80d8211110151f5e89591805ee5e0dc555:/src/motif/accel.cpp diff --git a/src/motif/accel.cpp b/src/motif/accel.cpp index 46adbcc4b6..31a790d997 100644 --- a/src/motif/accel.cpp +++ b/src/motif/accel.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "accel.h" #endif @@ -19,9 +19,7 @@ #include "wx/utils.h" #include -#if !USE_SHARED_LIBRARIES IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) -#endif class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData { @@ -29,7 +27,7 @@ class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData public: wxAcceleratorRefData(); ~wxAcceleratorRefData(); - + public: int m_count; wxAcceleratorEntry* m_entries; @@ -61,23 +59,23 @@ wxAcceleratorTable::~wxAcceleratorTable() } // Load from .rc resource -wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) +wxAcceleratorTable::wxAcceleratorTable(const wxString& WXUNUSED(resource)) { m_refData = new wxAcceleratorRefData; } // Create from an array -wxAcceleratorTable::wxAcceleratorTable(int n, wxAcceleratorEntry entries[]) +wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) { wxAcceleratorRefData* data = new wxAcceleratorRefData; m_refData = data; - + data->m_count = n; data->m_entries = new wxAcceleratorEntry[n]; int i; for (i = 0; i < n; i++) data->m_entries[i] = entries[i]; - + } bool wxAcceleratorTable::Ok() const @@ -101,16 +99,16 @@ bool wxAcceleratorEntry::MatchesEvent(const wxKeyEvent& event) const bool eventAltDown = event.AltDown(); bool eventCtrlDown = event.ControlDown(); bool eventShiftDown = event.ShiftDown(); - int eventKeyCode = event.KeyCode(); - + int eventKeyCode = event.GetKeyCode(); + bool accAltDown = ((GetFlags() & wxACCEL_ALT) == wxACCEL_ALT); bool accCtrlDown = ((GetFlags() & wxACCEL_CTRL) == wxACCEL_CTRL); bool accShiftDown = ((GetFlags() & wxACCEL_SHIFT) == wxACCEL_SHIFT); int accKeyCode = GetKeyCode(); int accKeyCode2 = GetKeyCode(); if (isascii(accKeyCode2)) - accKeyCode2 = wxToLower(accKeyCode2); - + accKeyCode2 = tolower(accKeyCode2); + return ((eventAltDown == accAltDown) && (eventCtrlDown == accCtrlDown) && (eventShiftDown == accShiftDown) && ((eventKeyCode == accKeyCode || eventKeyCode == accKeyCode2))) ;