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.
Create ScaleRichView in runtime
It is necessary to add one line in constructor SRV.
constructor TSRichViewEdit.Create(AOwner: TComponent);
adding
or
constructor TSRichViewEdit.Create(AOwner: TComponent);
adding
Code: Select all
RichViewEdit := RV;
RefreshData;
rvCanFocus := True;
end;
Code: Select all
RichViewEdit := RV;
RefreshData;
rvCanFocus := True;
Loaded; // Adding
end;
Problem with tableinsert action
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;
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;
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: