]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextctrl.cpp
Remove nonsensical custom comparison code from wxDataViewIndexListModel.
[wxWidgets.git] / src / richtext / richtextctrl.cpp
index f7dfab511dd82861f348c32d322adb66fcfc6236..e8eff5d801319effc3b75cdf8b88d1d72a0a38ad 100644 (file)
@@ -356,6 +356,7 @@ void wxRichTextCtrl::Init()
     m_selectionAnchorObject = NULL;
     m_selectionState = wxRichTextCtrlSelectionState_Normal;
     m_editable = true;
+    m_verticalScrollbarEnabled = true;
     m_caretAtLineStart = false;
     m_dragging = false;
 #if wxUSE_DRAG_AND_DROP
@@ -1175,7 +1176,8 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
 
             ScrollIntoView(m_caretPosition, WXK_LEFT);
 
-            if (deletions > 0)
+            // Always send this event; wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED will be sent only if there is an actual deletion.
+            //if (deletions > 0)
             {
                 wxRichTextEvent cmdEvent(
                     wxEVT_COMMAND_RICHTEXT_DELETE,
@@ -1313,7 +1315,8 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
 
         ScrollIntoView(m_caretPosition, WXK_LEFT);
 
-        if (deletions > 0)
+        // Always send this event; wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED will be sent only if there is an actual deletion.
+        //if (deletions > 0)
         {
             wxRichTextEvent cmdEvent(
                 wxEVT_COMMAND_RICHTEXT_DELETE,
@@ -1386,7 +1389,8 @@ void wxRichTextCtrl::OnChar(wxKeyEvent& event)
 
         ScrollIntoView(m_caretPosition, WXK_LEFT);
 
-        if (deletions > 0)
+        // Always send this event; wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED will be sent only if there is an actual deletion.
+        //if (deletions > 0)
         {
             wxRichTextEvent cmdEvent(
                 wxEVT_COMMAND_RICHTEXT_DELETE,
@@ -2555,7 +2559,7 @@ void wxRichTextCtrl::SetupScrollbars(bool atTop)
     if (IsFrozen())
         return;
 
-    if (GetBuffer().IsEmpty())
+    if (GetBuffer().IsEmpty() || !m_verticalScrollbarEnabled)
     {
         SetScrollbars(0, 0, 0, 0, 0, 0);
         return;
@@ -4560,6 +4564,12 @@ bool wxRichTextCtrl::CanInsertContent(wxRichTextParagraphLayoutBox& WXUNUSED(con
     return true;
 }
 
+void wxRichTextCtrl::EnableVerticalScrollbar(bool enable)
+{
+    m_verticalScrollbarEnabled = enable;
+    SetupScrollbars();
+}
+
 
 #if wxRICHTEXT_USE_OWN_CARET