added wxDocument::AlreadySaved() and use it in OnUpdateFileSave() to ensure that the "Save" menu item is enabled for new documents, even although they're not modified yet (otherwise the standard Ctrl-S key doesn't work in this case which is pretty annoying)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -259,7 +259,7 @@ bool wxDocument::OnNewDocument()
|
||||
|
||||
bool wxDocument::Save()
|
||||
{
|
||||
if (!IsModified() && m_savedYet)
|
||||
if ( AlreadySaved() )
|
||||
return true;
|
||||
|
||||
if ( m_documentFile.empty() || !m_savedYet )
|
||||
@@ -1094,8 +1094,8 @@ void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event)
|
||||
|
||||
void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event)
|
||||
{
|
||||
wxDocument *doc = GetCurrentDocument();
|
||||
event.Enable( doc && doc->IsModified() );
|
||||
wxDocument * const doc = GetCurrentDocument();
|
||||
event.Enable( doc && !doc->AlreadySaved() );
|
||||
}
|
||||
|
||||
void wxDocManager::OnUpdateUndo(wxUpdateUIEvent& event)
|
||||
|
Reference in New Issue
Block a user