Patch from José Mejuto, fixes Listview column autosize

git-svn-id: trunk@26846 -
This commit is contained in:
sekelsenmat 2010-07-27 07:33:03 +00:00
parent a8ea014bf6
commit 72d00b6953
2 changed files with 8 additions and 1 deletions

View File

@ -94,7 +94,11 @@ begin
WSC.ColumnSetCaption(LV, Index, Self, FCaption);
WSC.ColumnSetMaxWidth(LV, Index, Self, FMaxWidth);
WSC.ColumnSetMinWidth(LV, Index, Self, FMinWidth);
WSC.ColumnSetWidth(LV, Index, Self, FWidth);
if FAutoSize then begin
WSC.ColumnSetAutosize(LV, Index, Self, FAutosize);
end else begin
WSC.ColumnSetWidth(LV, Index, Self, FWidth);
end;
WSC.ColumnSetImage(LV, Index, Self, FImageIndex);
WSC.ColumnSetVisible(LV, Index, Self, FVisible);
end;

View File

@ -673,6 +673,9 @@ begin
{$else}
ListView_SetItemText(ALV.Handle, AIndex, ASubIndex, PChar(AText));
{$endif}
if ALV.Column[ASubIndex].AutoSize then begin
ListView_SetColumnWidth(ALV.Handle, ASubIndex, LVSCW_AUTOSIZE);
end;
end;
class procedure TWin32WSCustomListView.ItemShow(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const PartialOK: Boolean);