From 08547057c54d877d29bcd46616394d4a26509966 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 14 Aug 2014 12:17:08 +0000 Subject: [PATCH] Add support for paragraph spacing attribute to wxTextCtrl in wxMSW. Use PFM_SPACEAFTER/PFM_SPACEBEFORE to implement support for them. Closes #16417. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/msw/textctrl.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) 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 ) {