From f2c95c1d5cc22858d06d890cd8a7e45f7577c0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Mon, 4 Apr 2016 19:51:42 +0200 Subject: [PATCH] Fix wxCheckListBox checkbox rendering under RTL When running under a RTL locale, checkboxes should not be mirrored, but should keep the same appearence in both RTL and LTR layouts. (cherry picked from commit 22f0801378674ccf815434389d3ec9faeb766af5) --- src/msw/checklst.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index 36484a73a9..b56e4113c9 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -157,7 +157,14 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc, int y = rc.GetY() + (rc.GetHeight() - size.GetHeight()) / 2; UINT uState = stat & wxOwnerDrawn::wxODSelected ? wxDSB_SELECTED : wxDSB_NORMAL; + + // checkmarks should not be mirrored in RTL layout + DWORD oldLayout = ::GetLayout(hdc); + if ( oldLayout & LAYOUT_RTL ) + ::SetLayout(hdc, oldLayout | LAYOUT_BITMAPORIENTATIONPRESERVED); wxDrawStateBitmap(hdc, hBmpCheck, x, y, uState); + if ( oldLayout & LAYOUT_RTL ) + ::SetLayout(hdc, oldLayout); return true; }