Add const wxWindow::GetAcceleratorTable() overload

This will allow const member functions to call GetAcceleratorTable()
without const_casts.
This commit is contained in:
Vadim Zeitlin
2026-09-25 18:21:23 +02:00
parent fb1258f87d
commit 833dcf56f9
2 changed files with 14 additions and 2 deletions
+2 -1
View File
@@ -962,7 +962,8 @@ public:
{ m_acceleratorTable = accel; }
wxAcceleratorTable *GetAcceleratorTable()
{ return &m_acceleratorTable; }
const wxAcceleratorTable* GetAcceleratorTable() const
{ return &m_acceleratorTable; }
#endif // wxUSE_ACCEL
#if wxUSE_HOTKEY
+12 -1
View File
@@ -3673,10 +3673,21 @@ public:
void SetWindowVariant(wxWindowVariant variant);
/**
Gets the accelerator table for this window. See wxAcceleratorTable.
Gets the accelerator table for this window, if any.
@see SetAcceleratorTable(), wxAcceleratorTable
*/
wxAcceleratorTable* GetAcceleratorTable();
/**
Gets the accelerator table for this window, if any.
@see SetAcceleratorTable(), wxAcceleratorTable
@since 3.3.4
*/
const wxAcceleratorTable* GetAcceleratorTable() const;
/**
Returns the accessible object for this window, if any.
See also wxAccessible.