Page 1 of 1

Create ScaleRichView in runtime

Posted: Mon Jun 30, 2008 6:50 am
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.

Posted: Mon Jun 30, 2008 7:44 am
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;

Problem with tableinsert action

Posted: Mon Jun 30, 2008 3:51 pm
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;

Posted: Tue Jul 01, 2008 5:07 pm
by Sergey Tkachenko
Will be fixed in the next update.

Posted: Tue Jul 01, 2008 6:03 pm
by proxy3d
bug fixed. look next updating

Posted: Thu Jul 03, 2008 11:32 am
by Sergey Tkachenko
The fixed version is uploaded (available for registered users of TRichView).