diff --git a/docs/changes.txt b/docs/changes.txt index 730996fbaa..a54a866046 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -509,6 +509,7 @@ All (GUI): - wxRTC: corrected centring and right-justification spacing. - wxRTC: fixed style selection reset after editing a style. - wxRTC: can now edit line spacing in .1 increments from 1 to 2. +- wxRTC: added PaintAboveContent function for drawing on top of text. - Added wxBORDER_THEME to XRC. - wxGraphicsContext is now enabled by default if supported by the platform. - Fix building with using system libpng 1.4 (Volker Grabsch). diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index 23a5fdd62c..cbd236f559 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -687,6 +687,9 @@ public: /// Paint the background virtual void PaintBackground(wxDC& dc); + /// Other user defined painting after everything else (i.e. all text) is painted + virtual void PaintAboveContent(wxDC& dc) {} + #if wxRICHTEXT_BUFFERED_PAINTING /// Recreate buffer bitmap if necessary virtual bool RecreateBuffer(const wxSize& size = wxDefaultSize); diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 18d061a4c5..0b115f6b6b 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -409,6 +409,9 @@ void wxRichTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.DestroyClippingRegion(); + // Other user defined painting after everything else (i.e. all text) is painted + PaintAboveContent(dc); + #if wxRICHTEXT_USE_OWN_CARET if (GetCaret()->IsVisible()) {