From d4ae8219d9bb3ebf8ef88006bee1c590615c66be Mon Sep 17 00:00:00 2001 From: Pete Bannister Date: Fri, 9 Sep 2016 23:39:20 +0200 Subject: [PATCH] Fix rendering of owner-drawn multi-column menus in wxMSW Compute the item rectangle bounds correctly for the items in non-first column. See #17072. (cherry picked from commit 61083f4871772b32b5b238342a0347e20522574b) --- docs/changes.txt | 1 + src/msw/menuitem.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index fa28d309df..918ff34326 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -629,6 +629,7 @@ wxGTK: wxMSW: - Fix compilation with g++ 4.9 in non-C++11 mode. +- Fix rendering of owner drawn multi-column menus (Pete Bannister). - Fix regression in accessibility support (Leland Lucius). - Fix regression in wxDC drawing with bottom-to-top y axis (Artur Wieczorek). - Fix compilation with C++Builder XE compiler (Nichka). diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index f845e3b3d3..2d53e1576d 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -873,7 +873,8 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc, data->SeparatorMargin.ApplyTo(rcSeparator); RECT rcGutter = rcSelection; - rcGutter.right = data->ItemMargin.cxLeftWidth + rcGutter.right = rcGutter.left + + data->ItemMargin.cxLeftWidth + data->CheckBgMargin.cxLeftWidth + data->CheckMargin.cxLeftWidth + imgWidth