accel.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/generic/accel.h
  3. // Purpose: wxAcceleratorTable class
  4. // Author: Robert Roebling
  5. // Copyright: (c) Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_GENERIC_ACCEL_H_
  9. #define _WX_GENERIC_ACCEL_H_
  10. class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
  11. // ----------------------------------------------------------------------------
  12. // wxAcceleratorTable
  13. // ----------------------------------------------------------------------------
  14. class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
  15. {
  16. public:
  17. wxAcceleratorTable();
  18. wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
  19. virtual ~wxAcceleratorTable();
  20. bool Ok() const { return IsOk(); }
  21. bool IsOk() const;
  22. void Add(const wxAcceleratorEntry& entry);
  23. void Remove(const wxAcceleratorEntry& entry);
  24. // implementation
  25. // --------------
  26. wxMenuItem *GetMenuItem(const wxKeyEvent& event) const;
  27. int GetCommand(const wxKeyEvent& event) const;
  28. const wxAcceleratorEntry *GetEntry(const wxKeyEvent& event) const;
  29. protected:
  30. // ref counting code
  31. virtual wxObjectRefData *CreateRefData() const;
  32. virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
  33. private:
  34. DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
  35. };
  36. #endif // _WX_GENERIC_ACCEL_H_