Now works when derived from wxTextCtrlBase, using wxScrollHelper.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-10-22 13:44:30 +00:00
parent a4f4d548ce
commit 2f36e8dce5
3 changed files with 12 additions and 8 deletions

View 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);

View 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();

View 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)
{