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.
This commit is contained in:
Václav Slavík
2016-04-04 19:51:42 +02:00
parent e209beed8e
commit 22f0801378

View File

@@ -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;
}