diff --git a/docs/changes.txt b/docs/changes.txt index 95a3a55d0f..28fe18da7e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -607,6 +607,7 @@ wxMSW: - Fix appearance of wxToggleButtons with non default colours (Artur Wieczorek). - Fix drawing on wxDC when using right-to-left layout (Artur Wieczorek). - Fix wxGrid appearance and behaviour in RTL (Artur Wieczorek). +- Add paragraph spacing attributes support to wxTextCtrl (dannchr). 3.0.1: (released 2014-06-15) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 4583fbd6b0..bf3b3b2f4e 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2817,6 +2817,24 @@ bool wxTextCtrl::MSWSetParaFormat(const wxTextAttr& style, long start, long end) } } +#if wxUSE_RICHEDIT2 + if ( style.HasParagraphSpacingAfter() ) + { + pf.dwMask |= PFM_SPACEAFTER; + + // Convert from 1/10 mm to TWIPS + pf.dySpaceAfter = (int) (((double) style.GetParagraphSpacingAfter()) * mm2twips / 10.0) ; + } + + if ( style.HasParagraphSpacingBefore() ) + { + pf.dwMask |= PFM_SPACEBEFORE; + + // Convert from 1/10 mm to TWIPS + pf.dySpaceBefore = (int) (((double) style.GetParagraphSpacingBefore()) * mm2twips / 10.0) ; + } +#endif // wxUSE_RICHEDIT2 + #if wxUSE_RICHEDIT2 if ( m_verRichEdit > 1 ) {