How to keep the margins configuration in the file

General TRichView support forum. Please post your questions here
Post Reply
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

How to keep the margins configuration in the file

Post by alexandreq »

Hello Sergey,

When I give a double click on margins it calls this code:

srvActionPageSetup1.ExecuteTarget(Editor);

When I change my page configuration, for example, from landscape to portrait or vice versa, the new parameters page is not keept in my db.

When I close the system and open it again, my page returns to the same configuration and didn't keep my preferences.

What is wrong with this code? Something missing? I notice when I change the page configuration, my db state doesn't change to dsedit, for example.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Open SRVActions.pas, find TsrvActionPageSetup.ExecuteTarget.
Change

Code: Select all

frm.Apply(Edit);
to

Code: Select all

if Edit.RichViewEdit.CanChange then
  frm.Apply(Edit);
This fix will be included in the next update.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Hi Sergey,

I didn't find the SRVActions.pas, only RichViewActions,

My version is 12 and the code that I have inside the procedure is:

procedure TrvActionPageSetup.ExecuteTarget(Target: TObject);
var frm: TfrmRVPageSetup;
begin
frm := TfrmRVPageSetup.Create(Application);
try
if MarginsUnits=rvpmuInches then
frm.UseInches;
if frm.Init and (frm.ShowModal=mrOk) then begin

frm.Apply;
if Assigned(FOnChange) then
FOnChange(Self);
end;
finally
frm.Free;
end;
end;


When I tried to add your code, Delphi doesn't find the Edit.

What Can I do?

I also call this code when I give double click on the margins, when I do this, I run this code:

srvActionPageSetup1.ExecuteTarget(Editor);

Maybe can it be worked around here?

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

Post by Sergey Tkachenko »

SRVActions.pas is included in ScaleRichView. It contains TsrvActionPageSetup.
TrvActionPageSetup from RichViewActions.pas is a different action, it is for TRichViewEdit, not TSRichViewEdit.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Sergey,

I don't have .pas from this file SRVActions, only DCU.

My Version is 3.03 of my scaleRichView.

is it a possible to work around with this in my code?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TrvActionPageSetup is useless for ScaleRichView. It changes properties of TRVPrint component which is not used by ScaleRichView.

Do you use a trial version of ScaleRichView?
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Hi Sergey,

This version is not a trial version.

In the example of the demo that come with the component, on the event onMarginDbClick is used this code:

srvActionPageSetup1.ExecuteTarget(ActiveEditor);


Well, what do you suggest me to do whether TrvActionPageSetup is useless?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you have a full version of ScaleRichView, it must include all source files, including SRVActions.pas.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Well, this computer that I work doesn't have the .pas of this file

I don't know why and I am new in company.

is it other way to work around of this?

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

Post by Sergey Tkachenko »

I can send you a source code if I will be able to identify you as a registered user.
What is the company name or email address that was used when ordering? Please send this information in a private message or email.
alexandreq
Posts: 184
Joined: Wed Jan 18, 2012 6:22 pm

Post by alexandreq »

Hi sergey

Unfortunately nobody know about this here in company.

It seems that the guys that worked here before me brought this component with him and installed.

Now, I don't know what to do.

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

Post by Sergey Tkachenko »

Answered in a private message
Post Reply