Added ForceDelayedLayout

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2011-04-21 12:44:26 +00:00
parent daa3165144
commit 987695522c
2 changed files with 30 additions and 5 deletions

View File

@@ -221,6 +221,18 @@ public:
/// Get the threshold in character positions for doing layout optimization during sizing
long GetDelayedLayoutThreshold() const { return m_delayedLayoutThreshold; }
bool GetFullLayoutRequired() const { return m_fullLayoutRequired; }
void SetFullLayoutRequired(bool b) { m_fullLayoutRequired = b; }
wxLongLong GetFullLayoutTime() const { return m_fullLayoutTime; }
void SetFullLayoutTime(wxLongLong t) { m_fullLayoutTime = t; }
long GetFullLayoutSavedPosition() const { return m_fullLayoutSavedPosition; }
void SetFullLayoutSavedPosition(long p) { m_fullLayoutSavedPosition = p; }
// Force any pending layout due to large buffer
void ForceDelayedLayout();
/// Set text cursor
void SetTextCursor(const wxCursor& cursor ) { m_textCursor = cursor; }

View File

@@ -2204,6 +2204,19 @@ void wxRichTextCtrl::OnSize(wxSizeEvent& event)
event.Skip();
}
// Force any pending layout due to large buffer
void wxRichTextCtrl::ForceDelayedLayout()
{
if (m_fullLayoutRequired)
{
m_fullLayoutRequired = false;
m_fullLayoutTime = 0;
GetBuffer().Invalidate(wxRICHTEXT_ALL);
ShowPosition(m_fullLayoutSavedPosition);
Refresh(false);
Update();
}
}
/// Idle-time processing
void wxRichTextCtrl::OnIdle(wxIdleEvent& event)