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 »

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 »

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 »

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: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Will be fixed in the next update.
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

bug fixed. look next updating
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

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