当前位置: 首页>>代码示例>>C++>>正文


C++ TDocument::CanClose方法代码示例

本文整理汇总了C++中TDocument::CanClose方法的典型用法代码示例。如果您正苦于以下问题:C++ TDocument::CanClose方法的具体用法?C++ TDocument::CanClose怎么用?C++ TDocument::CanClose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDocument的用法示例。


在下文中一共展示了TDocument::CanClose方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

//
/// Checks to see if all child documents can be closed before closing the current
/// document. If any child returns false, CanClose returns false and aborts the
/// process. If all children return true, calls TDocManager::FlushDoc. If FlushDoc
/// finds that the document has been changed but not saved, it displays a message
/// asking the user to either save the document, discard any changes, or cancel the
/// operation. If the document has not been changed and all children's CanClose
/// functions return true, this CanClose function returns true.
//
bool
TDocument::CanClose()
{
  TDocument* pdoc = 0;
  while ((pdoc = ChildDoc.Next(pdoc)) != 0)
    if (!pdoc->CanClose())
      return false;

  return DocManager->FlushDoc(*this);  // do the UI in the doc manager
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:19,代码来源:document.cpp

示例2: while

//
/// Checks to see if all child documents can be closed before closing the current
/// document. If any child returns false,  returns false and aborts the process. If
/// all children return true, EvCanClose calls TDocManager::FlushDoc for each
/// document. If FlushDoc finds that the document is dirty, it displays a message
/// asking the user to save the document, discard any changes, or cancel the
/// operation. If the document is not dirty and CanClose returns true, EvCanClose
/// returns true.
//
bool
TDocManager::EvCanClose()
{
  TDocument* doc = 0;
  while ((doc = DocList.Next(doc)) != 0) {
    if (!doc->CanClose())  // normally calls back to FlushDoc()
      return false;
  }
  return true;
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:19,代码来源:docmanag.cpp

示例3: GetCurrentDoc

//
/// If the document can be closed it is closed.
//
void
TDocManager::FileClose()
{
  TDocument* doc = GetCurrentDoc();
  if (doc && doc->CanClose()) {  // normally calls back to FlushDoc()
    if (!doc->Close())
      PostDocError(*doc, IDS_UNABLECLOSE);
    else
      delete doc;
  }
  WARNX(OwlDocView, !doc, 0, _T("FileClose invoked with no current doc"));
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:15,代码来源:docmanag.cpp

示例4: GetObject

void
TDocument::Streamer::Write(opstream& os) const
{
  TDocument* o = GetObject();

  while (!o->CanClose())   // can't permit cancel here
    ;
  os << o->OpenMode;
  _USES_CONVERSION;
  os.fwriteString(_W2A(o->DocPath));
  os.fwriteString(_W2A(o->Title));
  os << o->Template;       // templates already streamed, must be so if static
  os << o->ParentDoc;
  os << o->ViewList;       // each view streams out the next
  os << TView::NextViewId; // insure that this static var gets set on reload
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:16,代码来源:document.cpp

示例5: PostDocError

//
/// Overrideable method invoked just before the DocumentManager creates a new
/// document. The default behaviour is to close and delete the current
/// document if we're in SDI mode.
//
bool
TDocManager::CreatingDoc(TDocTemplate* /*tpl*/)
{
  if (Mode & dmSDI) {
    TDocument* doc = DocList.Next(0);
    if (doc) {
      if (!doc->CanClose())
        return false;
      if (!doc->Close()) {
        PostDocError(*doc, IDS_UNABLECLOSE);
        return false;
      }
      delete doc;
    }
  }
  return true;
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:22,代码来源:docmanag.cpp


注:本文中的TDocument::CanClose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。