summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e558f95)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62077
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual bool Draw(wxDC&);
virtual bool IsModified() const { return m_documentModified; }
virtual bool Draw(wxDC&);
virtual bool IsModified() const { return m_documentModified; }
- virtual void Modify(bool mod) { m_documentModified = mod; }
+ virtual void Modify(bool mod);
virtual bool AddView(wxView *view);
virtual bool RemoveView(wxView *view);
virtual bool AddView(wxView *view);
virtual bool RemoveView(wxView *view);
return static_cast<wxView *>(m_documentViews.GetFirst()->GetData());
}
return static_cast<wxView *>(m_documentViews.GetFirst()->GetData());
}
+void wxDocument::Modify(bool mod)
+{
+ if (mod != m_documentModified)
+ {
+ m_documentModified = mod;
+
+ // Allow views to append asterix to the title
+ wxView* view = GetFirstView();
+ if (view) view->OnChangeFilename();
+ }
+}
+
wxDocManager *wxDocument::GetDocumentManager() const
{
return m_documentTemplate ? m_documentTemplate->GetDocumentManager() : NULL;
wxDocManager *wxDocument::GetDocumentManager() const
{
return m_documentTemplate ? m_documentTemplate->GetDocumentManager() : NULL;
wxDocument *doc = GetDocument();
if (!doc) return;
wxDocument *doc = GetDocument();
if (!doc) return;
- win->SetLabel(doc->GetUserReadableName());
+ wxString label = doc->GetUserReadableName();
+ if (doc->IsModified())
+ {
+ label += "*";
+ }
+ win->SetLabel(label);
}
void wxView::SetDocument(wxDocument *doc)
}
void wxView::SetDocument(wxDocument *doc)