X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c67451472112b3c7bb3b425cfab523b2d38d0cf..212e8ef365cbf061ad24b1d03aa6f393c411ed6f:/src/motif/accel.cpp diff --git a/src/motif/accel.cpp b/src/motif/accel.cpp index 7ce7905121..ba59df93dd 100644 --- a/src/motif/accel.cpp +++ b/src/motif/accel.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: accel.cpp +// Name: src/motif/accel.cpp // Purpose: wxAcceleratorTable // Author: Julian Smart // Modified by: @@ -9,24 +9,26 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "accel.h" -#endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" -#include "wx/setup.h" #include "wx/accel.h" -#include "wx/string.h" -#include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/string.h" + #include "wx/utils.h" +#endif + #include IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData { - friend class WXDLLEXPORT wxAcceleratorTable; + friend class wxAcceleratorTable; public: wxAcceleratorRefData(); - ~wxAcceleratorRefData(); + virtual ~wxAcceleratorRefData(); public: int m_count; @@ -38,19 +40,19 @@ public: wxAcceleratorRefData::wxAcceleratorRefData() { m_count = 0; - m_entries = (wxAcceleratorEntry*) NULL; + m_entries = NULL; } wxAcceleratorRefData::~wxAcceleratorRefData() { delete[] m_entries; - m_entries = (wxAcceleratorEntry*) NULL; + m_entries = NULL; m_count = 0; } wxAcceleratorTable::wxAcceleratorTable() { - m_refData = (wxAcceleratorRefData*) NULL; + m_refData = NULL; } wxAcceleratorTable::~wxAcceleratorTable() @@ -78,9 +80,9 @@ wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[] } -bool wxAcceleratorTable::Ok() const +bool wxAcceleratorTable::IsOk() const { - return (m_refData != (wxAcceleratorRefData*) NULL); + return (m_refData != NULL); } int wxAcceleratorTable::GetCount() const @@ -99,18 +101,17 @@ 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 = tolower(accKeyCode2); + if (wxIsascii(accKeyCode2)) + accKeyCode2 = wxTolower(accKeyCode2); return ((eventAltDown == accAltDown) && (eventCtrlDown == accCtrlDown) && (eventShiftDown == accShiftDown) && ((eventKeyCode == accKeyCode || eventKeyCode == accKeyCode2))) ; } -