Is first save?

General TRichView support forum. Please post your questions here
Post Reply
starhu
Posts: 49
Joined: Fri Jan 17, 2014 6:33 pm

Is first save?

Post by starhu »

Hello,

I need to log the save of the file only if it is the first save or save as.

- So the user creates a new document and save it -> I need to log it
- The user types in something and saves it -> I don't need to do anything
- The users clicks on Save As -> I need to log it

The problem is that in the rvActionSave1Saving method I cannot distinguish if it't the first save or not.

I tried comparing

srvActionsResource.rvActionSave1.GetDoc(MainForm.ActiveEditor.RichViewEdit).FileName and the input FileName because I though that srvActionsResource.rvActionSave1.GetDoc(MainForm.ActiveEditor.RichViewEdit).FileName would be the old file name but they are the same.

Thank you
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use TrvActionSave.OnDocumentFileChange event
starhu
Posts: 49
Joined: Fri Jan 17, 2014 6:33 pm

Post by starhu »

Hello,

Thank you, I tried it, but it never enters into OnDocumentFileChange event, no matter if I save, edit or close.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This event is already assigned in code of ActionTest demos.
It is assigned in FormCreate, and probably this assignment overrides yours.

In ActionTestTabs it is used to display a file name on a tab.
starhu
Posts: 49
Joined: Fri Jan 17, 2014 6:33 pm

Post by starhu »

Thank you, it works now.
Post Reply