+ self.UpdateAllViews(hint=("modify", self, self._documentModified))
+
+
+ def SetDocumentModificationDate(self):
+ """
+ Saves the file's last modification date.
+ This is used to check if the file has been modified outside of the application.
+ This method has been added to wxPython and is not in wxWindows.
+ """
+ self._documentModificationDate = os.path.getmtime(self.GetFilename())
+
+
+ def GetDocumentModificationDate(self):
+ """
+ Returns the file's modification date when it was loaded from disk.
+ This is used to check if the file has been modified outside of the application.
+ This method has been added to wxPython and is not in wxWindows.
+ """
+ return self._documentModificationDate
+
+
+ def IsDocumentModificationDateCorrect(self):
+ """
+ Returns False if the file has been modified outside of the application.
+ This method has been added to wxPython and is not in wxWindows.
+ """
+ if not os.path.exists(self.GetFilename()): # document must be in memory only and can't be out of date
+ return True
+ return self._documentModificationDate == os.path.getmtime(self.GetFilename())