From addcf76c65f61c5955652615b4acbf06a0aec621 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 3 May 2008 20:18:49 +0000 Subject: [PATCH] Fixed [ 1905777 ] Defining default accelerators for wxRichTextCtrl Added standard accelerators for cut, copy, paste and select all. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextctrl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 17a0f07790..b3395fe20b 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -32,6 +32,7 @@ #include "wx/dcbuffer.h" #include "wx/arrimpl.cpp" #include "wx/fontenum.h" +#include "wx/accel.h" // DLL options compatibility check: #include "wx/app.h" @@ -255,6 +256,17 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va GetBuffer().AddEventHandler(this); + // Accelerators + wxAcceleratorEntry entries[4]; + + entries[0].Set(wxACCEL_CMD, (int) 'C', wxID_COPY); + entries[1].Set(wxACCEL_CMD, (int) 'X', wxID_CUT); + entries[2].Set(wxACCEL_CMD, (int) 'V', wxID_PASTE); + entries[3].Set(wxACCEL_CMD, (int) 'A', wxID_SELECTALL); + + wxAcceleratorTable accel(4, entries); + SetAcceleratorTable(accel); + return true; }