]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed [ 1905777 ] Defining default accelerators for wxRichTextCtrl
authorJulian Smart <julian@anthemion.co.uk>
Sat, 3 May 2008 20:18:49 +0000 (20:18 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 3 May 2008 20:18:49 +0000 (20:18 +0000)
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

index 17a0f07790c3773a5ae1b9a15b23699ba9f61f9c..b3395fe20bf21373931d7166bf10519c07fc4c3a 100644 (file)
@@ -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;
 }