From cff48ba847a27ba4fb3402f4542d40251c5a7a27 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 13 Oct 2010 22:10:45 +0000 Subject: [PATCH] Fix display of right aligned columns in wxGenericListCtrl. Take into account the width of the image when drawing the right aligned item in wxGenericListCtrl. Closes #12562. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/generic/listctrl.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 4e6372ab86..da88a04816 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -415,6 +415,7 @@ All (GUI): - Add support for CP-866 encoding to wxEncodingConverter (madnut). - Consistency fixes for keyboard events across all major ports. - Added EVT_RIBBONBAR_TAB_LEFT_DCLICK event (snowleopard). +- Fix display of right aligned columns in wxGenericListCtrl (jl). MSW: diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index eddc8e4108..1a82b85138 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -804,7 +804,8 @@ void wxListLineData::DrawInReportMode( wxDC *dc, int xOld = x; x += width; - const int wText = width - 8; + width -= 8; + const int wText = width; wxDCClipper clipper(*dc, xOld, rect.y, wText, rect.height); if ( item->HasImage() ) @@ -820,7 +821,7 @@ void wxListLineData::DrawInReportMode( wxDC *dc, } if ( item->HasText() ) - DrawTextFormatted(dc, item->GetText(), col, xOld, yMid, wText); + DrawTextFormatted(dc, item->GetText(), col, xOld, yMid, width); } }