Undo Problem

General TRichView support forum. Please post your questions here
Post Reply
yoon jin suk
Posts: 20
Joined: Fri Sep 01, 2006 4:20 am
Location: seoul korea

Undo Problem

Post by yoon jin suk »

Hi.

I uses trichviewEdit v1.9.38 for delphi 7.

When a Page break is working..and the table exists..
the undo doesn't work well.

Please help me.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You should not be able to insert page break in table cells.
yoon jin suk
Posts: 20
Joined: Fri Sep 01, 2006 4:20 am
Location: seoul korea

Post by yoon jin suk »

You mean that if table exist then TRichViewEdit's page break option
must be false?

I must use page break by default.
And My Edit uses table very much.

How can I use 'Undo' function well?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

When caret is inside table, you can call code to split this table in two parts and insert page break between: http://www.trichview.com/forums/viewtopic.php?t=586
Otherwise, this command must be disabled when the caret is inside table cell (when RichViewEdit.InplaceEditor<>nil)
yoon jin suk
Posts: 20
Joined: Fri Sep 01, 2006 4:20 am
Location: seoul korea

Post by yoon jin suk »

I found my Edit's bug.

I uses RVPrint.OnFormatting event to change the table when the edit is
printed.

----------------------------------------------------------------------------------
procedure TfEditorMain.RVPrint1Formatting(Sender: TCustomRichView;
PageCompleted: Integer; Step: TRVPrintingStep);
var
i: integer;
table : TRVTableItemInfo;
begin
if step = rvpsStarting then
begin
for i := 0 to RichViewEdit1.RVData.Items.Count - 1 do
if RichViewEdit1.RVData.GetItemStyle(i) = rvsTable then
begin
table := TRVTableItemInfo(RichViewEdit1.RVData.GetItem(i));
table.CellVSpacing := 0;
table.CellHSpacing := 0;
table.bestwidth := table.width-42;
table.OnDrawBorder := DoDrawBorder;
end;
end
else if step = rvpsFinished then
begin
for i := 0 to RichViewEdit1.RVData.Items.Count - 1 do
if RichViewEdit1.RVData.GetItemStyle(i) = rvsTable then
begin
table := TRVTableItemInfo(RichViewEdit1.RVData.GetItem(i));
table.CellVSpacing := -1;
table.CellHSpacing := -1;
table.bestwidth := table.width;
table.OnDrawBorder := DoDrawBorder;
table.Changed;
end;
end;
end;
------------------------------------------------------------------------------

If page break is working and the above event is also working then
the undo event works abnormally.(If Table exists)

So... I will use above event exactly when I printing.

However ..If page break is working ..and below code is in button
click event.. and click event is accured..
---------------
RichViewEdit1.InsertRVFFromStreamEd(s);
---------------

then.. the undo event works but exception accured.

Please answer how to use 'undo' fuction..
When I uses page break and InsertRVFFromStreamEd at the same time.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You cannot use this event to make changes in document. Any error is possible if you do it.
Please redesign your application to make changes in another place.
Post Reply