From 0ab495989d6e1d558c6a45cbcd637e30bff1362c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Oct 2002 20:42:34 +0000 Subject: [PATCH] no changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 7776a1a1ed..6a5e81119e 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1751,12 +1751,12 @@ void wxListLineData::DrawInReportMode( wxDC *dc, } } -void wxListLineData::DrawTextFormatted( wxDC *dc, - const wxString &text, - int col, - int x, - int y, - int width ) +void wxListLineData::DrawTextFormatted(wxDC *dc, + const wxString &text, + int col, + int x, + int y, + int width) { wxString drawntext, ellipsis; wxCoord w, h, base_w; @@ -1766,7 +1766,8 @@ void wxListLineData::DrawTextFormatted( wxDC *dc, dc->GetTextExtent(text, &w, &h); // if it can, draw it - if (w <= width) { + if (w <= width) + { m_owner->GetColumn(col, item); if (item.m_format == wxLIST_FORMAT_LEFT) dc->DrawText(text, x, y); @@ -1774,17 +1775,17 @@ void wxListLineData::DrawTextFormatted( wxDC *dc, dc->DrawText(text, x + width - w, y); else if (item.m_format == wxLIST_FORMAT_CENTER) dc->DrawText(text, x + ((width - w) / 2), y); - - // otherwise, truncate and add an ellipsis if possible - } else { - + } + else // otherwise, truncate and add an ellipsis if possible + { // determine the base width ellipsis = wxString(wxT("...")); dc->GetTextExtent(ellipsis, &base_w, &h); // continue until we have enough space or only one character left drawntext = text.Left(text.Length() - 1); - while (drawntext.Length() > 1) { + while (drawntext.Length() > 1) + { dc->GetTextExtent(drawntext, &w, &h); if (w + base_w <= width) break; @@ -1792,17 +1793,16 @@ void wxListLineData::DrawTextFormatted( wxDC *dc, } // if still not enough space, remove ellipsis characters - while (ellipsis.Length() > 0 && w + base_w > width) { - ellipsis = ellipsis.Left(ellipsis.Length() - 1); - dc->GetTextExtent(ellipsis, &base_w, &h); + while (ellipsis.Length() > 0 && w + base_w > width) + { + ellipsis = ellipsis.Left(ellipsis.Length() - 1); + dc->GetTextExtent(ellipsis, &base_w, &h); } // now draw the text dc->DrawText(drawntext, x, y); dc->DrawText(ellipsis, x + w, y); - } - } bool wxListLineData::Highlight( bool on )