Hi,
I am trying to find the width of a table cell after the user has re-sized the cell. Using the examples in the user guide I have it almost working except for the following:
1. I am checking for this in the OnMouseUp event as there doesn't seem to be anything more suitable. This is obviously firing far more often than I would like - is there a better event I should use? This is also leading to problem 2:
2. The value I am getting from _IsWidthTW is the width of the cell before the resize whereas I need the value after the resize.
Here is my code:
Code
procedure TPreviewForm.RichTextMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
var
cell, row, par: TParagraph;
ct: integer;
begin
cell:=RichText.ActiveParagraph.Cell;
row:=RichText.TableRow;
if (not Assigned(Cell)) or (Not Assigned(Row)) then
exit;
par:=Row.ChildPar;
ct:=1;
while Par<>nil do
begin
if Par=Cell then
begin
ShowMessage('Width for cell '+IntToStr(ct)+' is '+IntToStr(Cell._IsWidthTw)+' twips.');
break;
end;
Par:=Par.NextPar;
Inc(ct);
end;
end;
Alles anzeigen