]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix display of right aligned columns in wxGenericListCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 13 Oct 2010 22:10:45 +0000 (22:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 13 Oct 2010 22:10:45 +0000 (22:10 +0000)
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
src/generic/listctrl.cpp

index 4e6372ab869f3700abb5cabafe69aad15b475680..da88a048165967c6bd9a39b28611783815f7965a 100644 (file)
@@ -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:
 
index eddc8e41080896608a824c7850376f406406b250..1a82b85138d5ac8c335dc62d5279eaaeed2078e3 100644 (file)
@@ -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);
     }
 }