]> git.saurik.com Git - wxWidgets.git/commitdiff
Added ForceDelayedLayout
authorJulian Smart <julian@anthemion.co.uk>
Thu, 21 Apr 2011 12:44:26 +0000 (12:44 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 21 Apr 2011 12:44:26 +0000 (12:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 6456ef94afeeab6a0bd03717c660184ae1896cae..35e84f2d8dd9bb5464f9470b9d03b27922769269 100644 (file)
@@ -203,11 +203,11 @@ public:
     virtual void GetSelection(long* from, long* to) const;
 
     virtual wxString GetStringSelection() const;
-    
+
     const wxRichTextSelection& GetSelection() const { return m_selection; }
     wxRichTextSelection& GetSelection() { return m_selection; }
     void SetSelection(const wxRichTextSelection& sel) { m_selection = sel; }
-    
+
 
     /// Get filename
     wxString GetFilename() const { return m_filename; }
@@ -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; }
 
@@ -269,7 +281,7 @@ public:
     const wxRichTextContextMenuPropertiesInfo& GetContextMenuPropertiesInfo() const { return m_contextMenuPropertiesInfo; }
 
     /// The wxRichTextObject object that currently has the editing focus
-    wxRichTextParagraphLayoutBox* GetFocusObject() const { return m_focusObject; }    
+    wxRichTextParagraphLayoutBox* GetFocusObject() const { return m_focusObject; }
     bool SetFocusObject(wxRichTextParagraphLayoutBox* obj, bool setCaretPosition = true);
 
 // Operations
@@ -990,7 +1002,7 @@ private:
 
     /// Selection range in character positions. -2, -2 means no selection.
     wxRichTextSelection     m_selection;
-    
+
     wxRichTextCtrlSelectionState m_selectionState;
 
     /// Anchor so we know how to extend the selection
@@ -1026,7 +1038,7 @@ private:
     wxCursor                m_urlCursor;
 
     static wxArrayString    sm_availableFontNames;
-    
+
     wxRichTextContextMenuPropertiesInfo m_contextMenuPropertiesInfo;
 
     /// The object that currently has the editing focus
index 8a8f5c130dc8ae4c5ff77442739cd97a09bd4920..c95805f58a4fbf097aa3ba7742d29331da82ee12 100644 (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)