From 22f0801378674ccf815434389d3ec9faeb766af5 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. --- src/msw/checklst.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index 97f0cec73a..c47e6c3e09 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; }