Page 1 of 1

Table cells padding still exists

Posted: Sun Jan 12, 2020 11:46 am
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 18070 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;

Re: Table cells padding still exists

Posted: Mon Jan 13, 2020 7:03 am
by ZorkovIgor
Я бы купил TRichView и перешел с HTML Component Library, но такие мелочи вымораживают.

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

Извиняюсь что не на английском, гугль не справился с переводом :?

Re: Table cells padding still exists

Posted: Mon Jan 13, 2020 8:22 am
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.

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

Re: Table cells padding still exists

Posted: Thu Mar 19, 2020 8:38 am
by Sergey Tkachenko
Corrected in TRichView v18.3