Why don't you make the DoConvertRVtoSRV visible?

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Why don't you make the DoConvertRVtoSRV visible?

Post by vit »

Hi!

Have you tried to create application like \srv_demos\Demos\CustomDraw\Rectangles\DrawAll, but wich also draws rectangles when either RVHeader or RVFooter is edited?

Try to replace SRichViewEdit1.RichViewEdit.RVData by SRichViewEdit1.ActiveEditor.RVData and enter some text into RVHEader. You'll see that coordinates of rectangles are converted relative to SRichViewEdit1.RichViewEdit, not SRichViewEdit1.RVHeader.

Public method ConvertRVtoSRV uses DoConvertRVToSRV which receives TCustomRichViewEdit as parameter.

Now I have to do this:

Code: Select all

type
  TSRVEAccess = class(TSRichViewEdit);
***

Code: Select all

  if FSRVE.ActiveEditor.GetItemCoordsEx(RVData, ItemNo, PartNo, True, Rect) then
  begin
    TSRVEAccess(FSRVE).DoConvertRVtoSRV(Rect.TopLeft, FSRVE.RVHeader,
      Rect.TopLeft, PageNoStub, False);
    TSRVEAccess(FSRVE).DoConvertRVtoSRV(Rect.BottomRight, FSRVE.RVHeader,
      Rect.BottomRight, PageNoStub, False);
    Result := True;
  end
  else
    Result := False;
And it work's fine
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Would it be ok if we add an optional Editor parameter in ConvertRVToSRV? If it is omitted, the method would use ActiveEditor
vit
Posts: 115
Joined: Tue Feb 03, 2009 3:11 pm

Post by vit »

Yes, it would be OK.
Post Reply