本文整理汇总了C++中CModelerDoc::IsModified方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelerDoc::IsModified方法的具体用法?C++ CModelerDoc::IsModified怎么用?C++ CModelerDoc::IsModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelerDoc
的用法示例。
在下文中一共展示了CModelerDoc::IsModified方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSaveDocument
BOOL CModelerDoc::OnSaveDocument(LPCTSTR lpszPathName)
{
CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
//return CDocument::OnSaveDocument(lpszPathName);
CTFileName fnModelFile = CTString(lpszPathName);
try
{
fnModelFile.RemoveApplicationPath_t();
}
catch( char *err_str)
{
AfxMessageBox( err_str);
return FALSE;
}
#if BUILD_PUBLISHER
WarningMessage(
"Saving is disabled in this version!");
return FALSE;
#else
try
{
m_emEditModel.Save_t( fnModelFile);
m_emEditModel.SaveMapping_t( fnModelFile.NoExt()+".map", 0);
}
catch( char *err_str)
{
MessageBoxA(pMainFrame->m_hWnd, err_str, "Warning! Model Save failed.", MB_OK|MB_ICONHAND|MB_SYSTEMMODAL);
return FALSE;
}
SetModifiedFlag( FALSE);
CModelerView *pModelerView = CModelerView::GetActiveView();
if( pModelerView != NULL)
{
pModelerView->SaveThumbnail();
}
// reload attachments of all loaded models
POSITION pos = theApp.m_pdtModelDocTemplate->GetFirstDocPosition();
while (pos!=NULL)
{
CModelerDoc *pmdCurrent = (CModelerDoc *)theApp.m_pdtModelDocTemplate->GetNextDoc(pos);
if( pmdCurrent != this)
{
BOOL bUpdateAttachments = TRUE;
// if document is modified
if( pmdCurrent->IsModified())
{
CTString strMessage;
CTFileName fnDoc = CTString(pmdCurrent->GetPathName());
strMessage.PrintF("Do you want to save model \"%s\" before reloading its attachments?", fnDoc.FileName() );
if( ::MessageBox( pMainFrame->m_hWnd, strMessage,
"Warning !", MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON1 |
MB_TASKMODAL | MB_TOPMOST) != IDYES)
{
bUpdateAttachments = FALSE;
}
// save document
else
{
pmdCurrent->OnSaveDocument(pmdCurrent->GetPathName());
}
}
if( bUpdateAttachments)
{
POSITION pos = pmdCurrent->GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
((CModelerView *)pView)->m_ModelObject.AutoSetAttachments();
//CModelData *pmd = (CModelData *) ((CModelerView *)pView)->m_ModelObject.GetData();
//pmd->Reload();
}
}
}
}
return TRUE;
#endif
}