Create ScaleRichView in runtime

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
prosoft
Posts: 24
Joined: Tue Jul 11, 2006 8:51 am

Create ScaleRichView in runtime

Post by prosoft » Mon Jun 30, 2008 6:50 am

I want to try to create scalerichview in runtime.
I have problem with it.
Can you help me what can i do?

My simple code is bellow, but doesn't work properly. *(problem with caret, access violation with inserting table)

Thanks Josef.

type
TForm8 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
FRV:TSRichViewEdit;

public
{ Public declarations }
end;

var
Form8: TForm8;

implementation

{$R *.dfm}

procedure TForm8.Button1Click(Sender: TObject);
begin

RVA_GetRichViewEditFromPopupComponent :=
SRVGetRichViewEditFromPopupComponent;
FRV:=TSRichViewEdit.Create(self);
FRv.Align:=alClient;
Frv.Parent:=self;
end;

end.

proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d » Mon Jun 30, 2008 7:44 am

It is necessary to add one line in constructor SRV.
constructor TSRichViewEdit.Create(AOwner: TComponent);
adding

Code: Select all

  RichViewEdit := RV;
  RefreshData;
  rvCanFocus := True;
end;
or

Code: Select all

  RichViewEdit := RV;
  RefreshData;
  rvCanFocus := True;
  Loaded; // Adding
end;

prosoft
Posts: 24
Joined: Tue Jul 11, 2006 8:51 am

Problem with tableinsert action

Post by prosoft » Mon Jun 30, 2008 3:51 pm

Thank you for your answer. Now i have next problem.

I am creating actions in runtime. All works fine but rvActionInsertTable1 doesn't work properly.
When i click on table insert button,
"table insert" form is opened and
when i click OK, exception appears in unit RVTInplace in procedure TRVTableInplaceRVData.GetSourceRVData where Fcell=nil.
This function is called from function TRVTableInplaceRVData.GetVOffs: Integer;

Thanks josef

function TRVTableInplaceRVData.GetSourceRVData: TCustomRVData;
begin
Result := TRVTableInplaceEdit(FRichView).FCell; //Fcell=nil
end;


function TRVTableInplaceRVData.GetVOffs: Integer;
begin
if not DrawOnParentMode then
Result := inherited GetVOffs
else

Result := TRVTableCellData(GetSourceRVData).GetVOffs+ //there is calling of GetSourceRVData
TRVTableCellData(GetSourceRVData).GetTable.CellVPadding;
end;

Sergey Tkachenko
Site Admin
Posts: 14759
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Tue Jul 01, 2008 5:07 pm

Will be fixed in the next update.

proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d » Tue Jul 01, 2008 6:03 pm

bug fixed. look next updating

Sergey Tkachenko
Site Admin
Posts: 14759
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Thu Jul 03, 2008 11:32 am

The fixed version is uploaded (available for registered users of TRichView).

Post Reply