]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.cpp
Made DC cacheing less obstrusive
[wxWidgets.git] / src / stc / stc.cpp
index 9b46ce051069833e91ebe03f588da337baa6a9d4..35655c34114507e1ececceaa5a046a2f9c967c08 100644 (file)
@@ -88,9 +88,14 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
     EVT_SCROLLWIN               (wxStyledTextCtrl::OnScrollWin)
     EVT_SIZE                    (wxStyledTextCtrl::OnSize)
     EVT_LEFT_DOWN               (wxStyledTextCtrl::OnMouseLeftDown)
+#ifdef __WXMSW__
+    // Let Scintilla see the double click as a second click
+    EVT_LEFT_DCLICK             (wxStyledTextCtrl::OnMouseLeftDown)
+#endif
     EVT_MOTION                  (wxStyledTextCtrl::OnMouseMove)
     EVT_LEFT_UP                 (wxStyledTextCtrl::OnMouseLeftUp)
     EVT_RIGHT_UP                (wxStyledTextCtrl::OnMouseRightUp)
+    EVT_MOUSEWHEEL              (wxStyledTextCtrl::OnMouseWheel)
     EVT_CHAR                    (wxStyledTextCtrl::OnChar)
     EVT_KEY_DOWN                (wxStyledTextCtrl::OnKeyDown)
     EVT_KILL_FOCUS              (wxStyledTextCtrl::OnLoseFocus)
@@ -1072,7 +1077,7 @@ void wxStyledTextCtrl::SetText(const wxString& text) {
 // Retrieve all the text in the document.
 wxString wxStyledTextCtrl::GetText() {
                         wxString text;
-                        int   len  = GetTextLength();
+                        int   len  = GetTextLength()+1;
                         char* buff = text.GetWriteBuf(len+1);
 
                         SendMsg(2182, len, (long)buff);
@@ -1556,6 +1561,14 @@ void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) {
     m_swx->DoContextMenu(Point(pt.x, pt.y));
 }
 
+
+void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
+    m_swx->DoMouseWheel(evt.GetWheelRotation(),
+                        evt.GetWheelDelta(),
+                        evt.GetLinesPerAction());
+}
+
+
 void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) {
     long key = evt.KeyCode();
     if ((key > WXK_ESCAPE) &&