]> git.saurik.com Git - wxWidgets.git/commitdiff
Now works when derived from wxTextCtrlBase, using wxScrollHelper.
authorJulian Smart <julian@anthemion.co.uk>
Sat, 22 Oct 2005 13:44:30 +0000 (13:44 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 22 Oct 2005 13:44:30 +0000 (13:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/richtext/richtextctrl.h
src/richtext/richtextbuffer.cpp
src/richtext/richtextctrl.cpp

index 4f61ba36d2f3b82f6b2b281b6aa811271f78fa20..0fb3f1ed535aa3f68c270ba7d754ed7a925515d7 100644 (file)
@@ -383,7 +383,7 @@ public:
 
     /// Layout the buffer: which we must do before certain operations, such as
     /// setting the caret position.
-    virtual bool Layout(bool onlyVisibleRect = false);
+    virtual bool LayoutContent(bool onlyVisibleRect = false);
 
     /// Move the caret to the given character position
     virtual bool MoveCaret(long pos, bool showAtLineStart = false);
@@ -573,6 +573,10 @@ public:
 
 // Implementation
 
+#if wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
+     WX_FORWARD_TO_SCROLL_HELPER()
+#endif
+
     /// Set font, and also default attributes
     virtual bool SetFont(const wxFont& font);
 
index 82ae7f3c0d32651445aa8f8d43fc7214a3a0b89a..217156ad8789b535da432074749b03e72557718d 100644 (file)
@@ -4113,7 +4113,7 @@ void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent
         m_ctrl->SetCaretPosition(caretPosition);
         if (!m_ctrl->IsFrozen())
         {
-            m_ctrl->Layout();
+            m_ctrl->LayoutContent();
             m_ctrl->PositionCaret();
             m_ctrl->Refresh();
 
index 297a3dea4f1252fad8038099e9ca971b74470966..893ddfee78ba0bb10187dc873a31cbef1e3fda1c 100644 (file)
@@ -1381,7 +1381,7 @@ void wxRichTextCtrl::OnSize(wxSizeEvent& event)
         m_fullLayoutRequired = true;
         m_fullLayoutTime = wxGetLocalTimeMillis();
         m_fullLayoutSavedPosition = GetFirstVisiblePosition();
-        Layout(true /* onlyVisibleRect */);
+        LayoutContent(true /* onlyVisibleRect */);
     }
     else
         GetBuffer().Invalidate(wxRICHTEXT_ALL);
@@ -1497,7 +1497,7 @@ bool wxRichTextCtrl::LoadFile(const wxString& filename, int type)
 
     DiscardEdits();
     SetInsertionPoint(0);
-    Layout();
+    LayoutContent();
     PositionCaret();
     SetupScrollbars(true);
     Refresh();
@@ -1763,7 +1763,7 @@ void wxRichTextCtrl::Cut()
         GetBuffer().CopyToClipboard(range);
 
         DeleteSelectedContent();
-        Layout();
+        LayoutContent();
         Refresh();
     }
 }
@@ -1915,7 +1915,7 @@ void wxRichTextCtrl::Remove(long from, long to)
         from,                           // New caret position
         this);
 
-    Layout();
+    LayoutContent();
     if (!IsFrozen())
         Refresh();
 }
@@ -2289,7 +2289,7 @@ wxRichTextLine* wxRichTextCtrl::GetVisibleLineForCaretPosition(long caretPositio
 bool wxRichTextCtrl::MoveCaret(long pos, bool showAtLineStart)
 {
     if (GetBuffer().GetDirty())
-        Layout();
+        LayoutContent();
 
     if (pos <= GetBuffer().GetRange().GetEnd())
     {
@@ -2305,7 +2305,7 @@ bool wxRichTextCtrl::MoveCaret(long pos, bool showAtLineStart)
 
 /// Layout the buffer: which we must do before certain operations, such as
 /// setting the caret position.
-bool wxRichTextCtrl::Layout(bool onlyVisibleRect)
+bool wxRichTextCtrl::LayoutContent(bool onlyVisibleRect)
 {
     if (GetBuffer().GetDirty() || onlyVisibleRect)
     {