home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2233.zip / wxOS2-2_3_3.zip / wxWindows-2.3.3 / include / wx / generic / accel.h next >
C/C++ Source or Header  |  2002-08-31  |  2KB  |  65 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        wx/generic/accel.h
  3. // Purpose:     wxAcceleratorTable class
  4. // Author:      Robert Roebling
  5. // RCS-ID:      $Id: accel.h,v 1.6 2002/08/31 11:29:11 GD Exp $
  6. // Copyright:   (c) Robert Roebling
  7. // Licence:     wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9.  
  10. #ifndef _WX_GENERIC_ACCEL_H_
  11. #define _WX_GENERIC_ACCEL_H_
  12.  
  13. #if defined(__GNUG__) && !defined(__APPLE__)
  14. #pragma interface "accel.h"
  15. #endif
  16.  
  17. class WXDLLEXPORT wxKeyEvent;
  18.  
  19. // ----------------------------------------------------------------------------
  20. // wxAcceleratorTable
  21. // ----------------------------------------------------------------------------
  22.  
  23. class WXDLLEXPORT wxAcceleratorTable : public wxObject
  24. {
  25. public:
  26.     wxAcceleratorTable();
  27.     wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
  28.     virtual ~wxAcceleratorTable();
  29.  
  30.     wxAcceleratorTable(const wxAcceleratorTable& accel)
  31.         : wxObject()
  32.         { Ref(accel); }
  33.     wxAcceleratorTable& operator=(const wxAcceleratorTable& accel)
  34.       { if ( m_refData != accel.m_refData ) Ref(accel); return *this; }
  35.  
  36.     bool operator==(const wxAcceleratorTable& accel) const
  37.         { return m_refData == accel.m_refData; } // FIXME: this is wrong (VZ)
  38.     bool operator!=(const wxAcceleratorTable& accel) const
  39.         { return !(*this == accel); }
  40.  
  41.     bool Ok() const;
  42.  
  43.     void Add(const wxAcceleratorEntry& entry);
  44.     void Remove(const wxAcceleratorEntry& entry);
  45.  
  46.     // implementation
  47.     // --------------
  48.  
  49.     wxMenuItem *GetMenuItem(const wxKeyEvent& event) const;
  50.     int GetCommand(const wxKeyEvent& event) const;
  51.  
  52.     const wxAcceleratorEntry *GetEntry(const wxKeyEvent& event) const;
  53.  
  54. protected:
  55.     // ref counting code
  56.     virtual wxObjectRefData *CreateRefData() const;
  57.     virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
  58.  
  59. private:
  60.     DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
  61. };
  62.  
  63. #endif // _WX_GENERIC_ACCEL_H_
  64.  
  65.