+
+ elif id == wx.ID_CLOSE:
+ document = self.GetDocumentManager().GetCurrentDocument()
+ if document and document.GetDocumentTemplate().GetDocumentType() == ProjectDocument:
+ self.OnProjectClose(event)
+ return True
+ else:
+ return False
+ return False
+
+
+ def ProcessUpdateUIEventBeforeWindows(self, event):
+ id = event.GetId()
+
+ if id == wx.ID_CLOSE_ALL:
+ for document in self.GetDocumentManager().GetDocuments():
+ if document.GetDocumentTemplate().GetDocumentType() != ProjectDocument:
+ event.Enable(True)
+ return True
+
+ event.Enable(False)
+ return True
+
+ elif id == wx.ID_CLOSE:
+ document = self.GetDocumentManager().GetCurrentDocument()
+ if document and document.GetDocumentTemplate().GetDocumentType() == ProjectDocument:
+ projectFilenames = self.GetView().GetSelectedProjects()
+ if projectFilenames and len(projectFilenames):
+ event.Enable(True)
+ else:
+ event.Enable(False)
+ return True
+