本文整理汇总了C++中CFunctionEditorDoc::OnSaveDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ CFunctionEditorDoc::OnSaveDocument方法的具体用法?C++ CFunctionEditorDoc::OnSaveDocument怎么用?C++ CFunctionEditorDoc::OnSaveDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFunctionEditorDoc
的用法示例。
在下文中一共展示了CFunctionEditorDoc::OnSaveDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumChildProc
/**
* \brief Callback function which can be used to close windows during configuration switching
* \param[in] HWND hwnd, LPARAM lParam
* \return TRUE
* \authors Arunkumar Karri
* \date 14.02.2013 Created
*/
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM /* lParam */)
{
if ( hwnd )
{
CWnd* pWnd = CWnd::FromHandle(hwnd);
if ( pWnd )
{
CRuntimeClass* pRunTimeClass = pWnd->GetRuntimeClass();
if ( pRunTimeClass )
{
if ( pRunTimeClass == RUNTIME_CLASS(CEditFrameWnd) || pRunTimeClass == RUNTIME_CLASS(COutWnd) )
{
/* If any function editor window is open */
if ( pRunTimeClass == RUNTIME_CLASS(CEditFrameWnd) )
{
CEditFrameWnd* pEditWnd = (CEditFrameWnd*)pWnd;
CFunctionEditorDoc* pDoc = (CFunctionEditorDoc*)pEditWnd->GetActiveDocument();
/* If a function editor window is modified */
if ( nullptr != pDoc && pDoc->IsModified() )
{
/* take confirmation from user for the first time only */
if ( g_bReqUserConfirmation )
{
g_bReqUserConfirmation = false;
INT nSelection = ::MessageBox( hwnd, _("Simulation files have been modified. Do You Want to save the Changes?"), _("Modified"), MB_YESNO | MB_ICONQUESTION);
switch(nSelection)
{
case IDYES:
g_bQueryConfirm = true;
break;
case IDNO:
g_bQueryConfirm = false;
break;
}
}
/* Based on user response, save the simulation files */
if ( g_bQueryConfirm )
{
if (pDoc != nullptr)
{
pDoc->OnSaveDocument(pDoc->GetPathName());
}
}
}
}
/* Destroy the window */
pWnd->DestroyWindow();
}
}
}
}
return TRUE;
}