From 155834936182e637f2efb3e806de3600151be9c1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 10 May 2014 16:16:01 +0000 Subject: [PATCH] Improve RTL support in wxStyledTextCtrl. Use the correct HDC, inheriting the right text orientation, when creating wxMemoryDC in SurfaceImpl code. There may still be problems with the actual RTL languages, but at the very least English text displayed in RTL locale is not mirrored any more. Closes #16230. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/stc/PlatWX.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index f748c2c364..cd188166b7 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -46,6 +46,7 @@ All (GUI): - Add wxFont::GetBaseFont() (Melroy Tellis). - Update included Scintilla to version 3.3.9 (Christian Walther). - Add wxStyledTextCtrl copy/paste text events (Christian Walther). +- Improve RTL support in wxStyledTextCtrl (Zane U. Ji). - Add support for loading old V1 BMP files to wxImage (Artur Wieczorek). - Improve auto sizing of wrapped cells in wxGrid (iwbnwif). - Fix handling of rectangular selections in wxStyledTextCtrl (roberto). diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 7c0f513520..e6b34535e7 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -211,9 +211,12 @@ void SurfaceImpl::Init(SurfaceID hdc_, WindowID) { hdc = (wxDC*)hdc_; } -void SurfaceImpl::InitPixMap(int width, int height, Surface *WXUNUSED(surface_), WindowID winid) { +void SurfaceImpl::InitPixMap(int width, int height, Surface *surface, WindowID winid) { Release(); - hdc = new wxMemoryDC(); + if (surface) + hdc = new wxMemoryDC(static_cast(surface)->hdc); + else + hdc = new wxMemoryDC(); hdcOwned = true; if (width < 1) width = 1; if (height < 1) height = 1;