procedure TfoDocuments.DoScrollDocuments(FocusedRecord: TcxCustomGridRecord);
var
MessageList: TStringList;
FileName:
string;
Test1, Test2: Pointer;
begin
if FLogic.DocumentDatasource.Changed
then
begin
MessageList := TStringList.Create;
try
FileName := FLogic.ModifiedDocument.FileName;
MessageList.Add(Format(conTextConfirmationChangedDocument, [QuotedStr(FileName)]));
MessageList.Add('
');
MessageList.Add(conTextConfirmationChangedDocument_1);
if TMessageDialog.MessageDlg(MessageList, conTextSaveHeader, vmtQuestion, [buYes, buNo], clBlack, Self) = mrYes
then
begin
FLogic.SaveDocument;
end;
finally
MessageList.Free;
end;
end;
FLogic.AfterScrollDocuments(FocusedRecord.RecordIndex);
// Wechsel des Objekte in der Logic
Test1 := Pointer(FLogic.OriginalDocument);
// Kontrolle
Test2 := Pointer(FLogic.ModifiedDocument);
// Kontrolle
if FLogic.ModifiedDocument.FileName.EndsWith('
.pdf', True)
then
begin
if FileExists(FLogic.ModifiedDocument.FileName)
then
begin
WPViewPDF1.LoadFromFile(FLogic.ModifiedDocument.FileName);
end
else
begin
WPViewPDF1.Clear;
TMessageDialog.MessageDlg(Format(conErrorFileNotPresent, [QuotedStr(FLogic.ModifiedDocument.FileName)]), conTextCheckHeader, vmtError, [buOk], clBlack, Self);
// --> Zugriffsverletzung aus dem TReader im OnCreate der Dialog Form (siehe Unit)
end;
end;
ShowDocument(FLogic.ModifiedDocument);
end;