Page 1 of 1

rvActionInsertTable: How to preset vertical Middle alignment

Posted: Fri May 30, 2014 9:20 pm
by PeterPanino
I use rvActionInsertTable to insert a table into RichViewEdit. Unfortunately, the cells in this table are all vertically aligned to the Top. So how can I preset this action to have all cells vertically aligned to Middle instead?

RichView 13.6.3
Delphi XE2
Windows 7 x64 SP1

Typo

Posted: Fri May 30, 2014 9:25 pm
by PeterPanino
Sorry for the typo. Of course the action name is:

r v A c t i o n I n s e r t T a b l e

Found a solution:

Posted: Fri May 30, 2014 10:10 pm
by PeterPanino

Code: Select all

procedure TformHV.rvActionInsertTable1Inserting(Sender: TrvActionInsertTable; table: TRVTableItemInfo);
var
  i: Integer;
begin
  for i := 0 to table.RowCount - 1 do  
    table.SetRowVAlign(rvcMiddle, i);
end;
Or is there a better way?

Posted: Sun Jun 01, 2014 3:23 pm
by Sergey Tkachenko
Using OnInserting is the only way.
You can define properties of a table itself by changing properties of TrvActionInsertTable, but if you want to change properties of rows and/or cells, use this event.