Table cells padding still exists

General TRichView support forum. Please post your questions here
Post Reply
ZorkovIgor
Posts: 2
Joined: Sun Jan 12, 2020 11:18 am

Table cells padding still exists

Post by ZorkovIgor »

Table cells padding still exists even if property CellPadding set to 0, some times cursor change to crDefault when i move mouse through cells
test.jpg
test.jpg (30.31 KiB) Viewed 18016 times

Code: Select all

var
  table: TRVTableItemInfo;
  r, c: Integer;
begin
  table := TRVTableItemInfo.CreateEx(4, 3, RichViewEdit1.RVData);

  table.BorderStyle := rvtbRaisedColor;
  table.CellBorderStyle := rvtbLoweredColor;
  table.BorderLightColor := $00FAF1C9;
  table.BorderColor := $00A98E10;
  table.CellBorderLightColor := $00FAF1C9;
  table.CellBorderColor := $00A98E10;
  table.Color := $00EAC724;
  table.BorderWidth := 0;
  table.CellBorderWidth := 0;
  table.CellPadding := 0;
  table.CellVPadding := 0;
  table.CellHPadding := 0;
  table.CellVSpacing := 0;
  table.CellHSpacing := 0;
  table.BorderVSpacing := 0;
  table.BorderHSpacing := 0;

  for r := 0 to table.Rows.Count - 1 do
    for c := 0 to table.Rows[r].Count - 1 do
    begin
      table.Cells[r, c].BestWidth := 100;
    end;

  table.MergeCells(0, 0, 3, 1, False);
  table.MergeCells(1, 0, 1, 3, False);
  with table.Cells[0, 0] do
  begin
    Color := clInfoBk;
    Clear;
    AddNL(' Example 1 ', 1, -1);
    AddNL('All cells have 100 pixels width, width of table itself is calculated basing on width of cells.',
      0, 0);
  end;
ZorkovIgor
Posts: 2
Joined: Sun Jan 12, 2020 11:18 am

Re: Table cells padding still exists

Post by ZorkovIgor »

Я бы купил TRichView и перешел с HTML Component Library, но такие мелочи вымораживают.

Или я ошибаюсь и это не баг?

Извиняюсь что не на английском, гугль не справился с переводом :?
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Table cells padding still exists

Post by Sergey Tkachenko »

The table layout is correct: there is no space between cells.
But mouse hit-testing is not precise; it was made to allow mouse resizing of tables like that. But your are right, arrow cursor must not be displayed, I'll fix it in the next update.

Таблица рисуется правильно, лишнего пространства между ячейками нет.
При вычислении того, что находится под мышью, сделано так, что некоторая часть ячеек считается как пространство между ячейками - иначе такие таблицы нельзя было бы ресайзить мышью. Но действительно, стрелка не должна появляться, я поправлю код.
Post Reply