X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4ae0def641ce0366e3946e546e1aaf2b7e6b821..a2dd2ea753f431b08ba4119d67ba90f6ca5e3966:/src/richtext/richtextctrl.cpp?ds=sidebyside diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index caf9d338d8..14b77e9b1d 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -151,7 +151,7 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va // The base attributes must all have default values wxTextAttrEx attributes; attributes.SetFont(GetFont()); - attributes.SetTextColour(*wxBLACK); + attributes.SetTextColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); attributes.SetAlignment(wxTEXT_ALIGNMENT_LEFT); attributes.SetLineSpacing(10); attributes.SetParagraphSpacingAfter(10); @@ -166,7 +166,7 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va wxTextAttrEx defaultAttributes; SetDefaultStyle(defaultAttributes); - SetBackgroundColour(*wxWHITE); + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); SetBackgroundStyle(wxBG_STYLE_CUSTOM); // Tell the sizers to use the given or best size @@ -229,7 +229,10 @@ void wxRichTextCtrl::Thaw() if (m_freezeCount == 0) { - SetupScrollbars(); + if (GetBuffer().GetDirty()) + LayoutContent(); + else + SetupScrollbars(); Refresh(false); } } @@ -244,11 +247,9 @@ void wxRichTextCtrl::Clear() m_caretAtLineStart = false; m_selectionRange.SetRange(-2, -2); - SetScrollbars(0, 0, 0, 0, 0, 0); - if (m_freezeCount == 0) { - SetupScrollbars(); + LayoutContent(); Refresh(false); } SendTextUpdatedEvent(); @@ -2713,12 +2714,13 @@ void wxRichTextCtrl::PositionCaret() wxRect caretRect; if (GetCaretPositionForIndex(GetCaretPosition(), caretRect)) { - wxPoint originalPt = caretRect.GetPosition(); - wxPoint pt = GetPhysicalPoint(originalPt); - if (GetCaret()->GetPosition() != pt) + wxPoint newPt = caretRect.GetPosition(); + wxSize newSz = caretRect.GetSize(); + wxPoint pt = GetPhysicalPoint(newPt); + if (GetCaret()->GetPosition() != pt || GetCaret()->GetSize() != newSz) { GetCaret()->Move(pt); - GetCaret()->SetSize(caretRect.GetSize()); + GetCaret()->SetSize(newSz); } } }