Hi ,
I Use a "non-percent" width (width > 0).
I find this on "RVTable.pas" L 7557:
Code: Select all
procedure SetWidth(c,w,x: Integer; Decrement: Boolean);
var r,a,b,a1,b1,oldw: Integer;
Changed: Boolean;
Cell: TRVTableCellData;
begin
oldw := w-CellHPadding*2;
if Decrement then begin
if c<ColCount-1 then
x := Fmt.ColStarts[c+1] - (CellBorderWidth+(CellHSpacing+1) div 2)
else
x := Fmt.FWidth-(BorderWidth+BorderHSpacing+CellBorderWidth{+1}) div 2;
x := x + (Fmt.ColStarts[c]-Fmt.ColStarts[c-1] - (CellHSpacing+1) div 2)-w-CellBorderWidth;
w := x - Fmt.ColStarts[c];
end;
a := w;
dec(w, CellHPadding*2);
if c<ColCount-1 then begin
dec(w,CellBorderWidth);
dec(w, CellHSpacing div 2);
end
else
dec(w, (BorderWidth+BorderHSpacing+CellBorderWidth+1) div 2);
//inc(x, w-a);
if w<=0 then w := 1;
Changed := False;
for r := 0 to RowCount-1 do
if (Cells[r,c]<>nil) and (Cells[r,c].ColSpan=1) then begin
SetCellBestWidth(w,r,c);
Changed := True;
end;
for r := 0 to RowCount-1 do
if (Cells[r,c]=nil) then begin
Cell := Rows.GetMainCell(r,c,a,b);
if (b=c) or Decrement then continue;
if (c=ColCount-1) or
(Cells[r,c+1]<>nil) or
(Cell<>Rows.GetMainCell(r,c+1,a1,b1)) then begin
if Changed then
w := 0
else begin
// w := x-Cell.Left;
w := Cell.Width - Fmt.ColWidths[c]+oldw;
if w<=0 then
w := 1;
end;
SetCellBestWidth(w,a,b)
end;
end;
end;
I try to understand how it works
Thanks for help !
David