]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextctrl.cpp
move Ellipsize() to wxControl so it can be easily used by other controls
[wxWidgets.git] / src / richtext / richtextctrl.cpp
index 1b321c28f1988a034551b2cc8a3b16812f6819d6..d9cc7959576023a2973a5d715962e8b1dd5bac53 100644 (file)
@@ -120,9 +120,9 @@ private:
 };
 #endif
 
-IMPLEMENT_CLASS( wxRichTextCtrl, wxControl )
+IMPLEMENT_DYNAMIC_CLASS( wxRichTextCtrl, wxControl )
 
-IMPLEMENT_CLASS( wxRichTextEvent, wxNotifyEvent )
+IMPLEMENT_DYNAMIC_CLASS( wxRichTextEvent, wxNotifyEvent )
 
 BEGIN_EVENT_TABLE( wxRichTextCtrl, wxControl )
     EVT_PAINT(wxRichTextCtrl::OnPaint)
@@ -256,14 +256,16 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va
     GetBuffer().AddEventHandler(this);
 
     // Accelerators
-    wxAcceleratorEntry entries[4];
+    wxAcceleratorEntry entries[6];
 
     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);
+    entries[4].Set(wxACCEL_CMD,   (int) 'Z',       wxID_UNDO);
+    entries[5].Set(wxACCEL_CMD,   (int) 'Y',       wxID_REDO);
 
-    wxAcceleratorTable accel(4, entries);
+    wxAcceleratorTable accel(6, entries);
     SetAcceleratorTable(accel);
 
     return true;
@@ -767,13 +769,12 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
 
             long newPos = m_caretPosition;
 
-            DeleteSelectedContent(& newPos);
+            bool processed = DeleteSelectedContent(& newPos);
 
             // Submit range in character positions, which are greater than caret positions,
             // so subtract 1 for deleted character and add 1 for conversion to character position.
             if (newPos > -1)
             {
-                bool processed = false;
                 if (event.CmdDown())
                 {
                     long pos = wxRichTextCtrl::FindNextWordPosition(-1);