X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec758a20a2b166b2073e1c902cc745db01290f02..4cb1706ae52c02214a4540c6c4b6882bed5af416:/src/gtk/accel.cpp?ds=sidebyside diff --git a/src/gtk/accel.cpp b/src/gtk/accel.cpp index 3a3d479635..f3f9ba6a68 100644 --- a/src/gtk/accel.cpp +++ b/src/gtk/accel.cpp @@ -2,9 +2,9 @@ // Name: accel.cpp // Purpose: // Author: Robert Roebling -// Id: $id$ +// Id: $id:$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -13,6 +13,8 @@ #include "wx/accel.h" +#if wxUSE_ACCEL + #include //----------------------------------------------------------------------------- @@ -22,13 +24,12 @@ class wxAccelRefData: public wxObjectRefData { public: - - wxAccelRefData(void); - - wxList m_accels; + wxAccelRefData(); + + wxList m_accels; }; -wxAccelRefData::wxAccelRefData(void) +wxAccelRefData::wxAccelRefData() { m_accels.DeleteContents( TRUE ); } @@ -38,7 +39,7 @@ wxAccelRefData::wxAccelRefData(void) #define M_ACCELDATA ((wxAccelRefData *)m_refData) IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable,wxObject) - + wxAcceleratorTable::wxAcceleratorTable() { } @@ -46,13 +47,13 @@ wxAcceleratorTable::wxAcceleratorTable() wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] ) { m_refData = new wxAccelRefData(); - + for (int i = 0; i < n; i++) { int flag = entries[i].GetFlags(); int keycode = entries[i].GetKeyCode(); int command = entries[i].GetCommand(); - if ((keycode >= (int)'A') && (keycode <= (int)'Z')) keycode = (int)tolower( (char)keycode ); + if ((keycode >= (int)'a') && (keycode <= (int)'z')) keycode = (int)toupper( (char)keycode ); M_ACCELDATA->m_accels.Append( new wxAcceleratorEntry( flag, keycode, command ) ); } } @@ -78,12 +79,13 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event ) (((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) && (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) && (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown())) - { + { return entry->GetCommand(); - } + } node = node->Next(); } - + return -1; } +#endif