in the RichViewActions Demo, which i costumize, i need costum buttons in the toolbar.
Normal OnClick-Events don´t work, as i get exceptions with buttons without any action applied.
Therefor i wanted to create custom Actions, but i don´t know how to access the richview (scalerichview) which is on the executing form.
Here i want to open a Template-RTF which i created.
Code: Select all
procedure TsrvActionsResource.OpenPlainTemplateActionExecute(Sender: TObject);
begin
end;
Code: Select all
procedure TrvActionsResource.rvActionEvent1Execute(Sender: TObject;
Editor: TCustomRichViewEdit);
var gr: TGraphic;
Tag: TRVTag;
Align: TRVVAlign;
s: TRVAnsiString;
info: String;
begin
Editor.GetCurrentPictureInfo(s, gr, Align, Tag);
info := Format('%s %dx%d', [gr.ClassName, gr.Width, gr.Height]);
Application.MessageBox(PChar(info), 'Image Info', MB_OK or MB_ICONINFORMATION);
end;
procedure TrvActionsResource.rvActionEvent1Update(Sender: TObject;
Editor: TCustomRichViewEdit);
var CurStyleNo: Integer;
begin
CurStyleNo := Editor.CurItemStyle;
(Sender as TrvActionEvent).Enabled := (CurStyleNo=rvsPicture) or
(CurStyleNo=rvsHotPicture);
end;
How can i accomplish this?
Greetings, Spo