TrvActionSave.CanCloseDoc

<< Click to display table of contents >>

TrvActionSave.CanCloseDoc

Performs necessary operations when closing the form containing rve.

function CanCloseDoc(rve: TCustomRichViewEdit): Boolean;

If document in rve is not modified, the method returns True.

Otherwise, the method asks the user: "Save changes to <FileName>?" (Yes/No/Cancel). If "Yes", the method saves and returns True. If "No", the method does not save and returns True. If "Cancel", the method returns False.

This method should be used in OnCloseQuery method of the form containing rve.

Example:

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);

begin

  CanClose := rvActionSave1.CanCloseDoc(RichViewEdit1);

end;