本文整理汇总了C++中Document::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::Close方法的具体用法?C++ Document::Close怎么用?C++ Document::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Document
的用法示例。
在下文中一共展示了Document::Close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Document
long Editor :: MenuCommand(wCommandMsg m)
{
Document *top = (Document*)TopMdiDocument();
short lp;
Document *doc;
// SET FOREGROUND COLOR
if (m.usCmd() >= O_FGCOLOR && m.usCmd() < O_BGCOLOR)
{
fgc = carr[m.usCmd() - O_FGCOLOR];
wColor oldc;
for (DocList()->First() ; (doc = (Document*)(DocList()->Current())) != 0 ; DocList()->Next())
oldc= doc->mle->SetForeground(fgc);
for (lp=0 ; lp < 16 && carr[lp] != oldc; lp++)
;
menu->UnCheckItem(lp + O_FGCOLOR);
menu->CheckItem(m.usCmd());
}
// SET BACKGROUND COLOR
if (m.usCmd() >= O_BGCOLOR && m.usCmd() < O_BGCOLOR + 18)
{
bgc = carr[m.usCmd() - O_BGCOLOR];
wColor oldc;
for (DocList()->First() ; (doc = (Document*)(DocList()->Current())) != 0 ; DocList()->Next())
oldc= doc->mle->SetBackground(bgc);
for (lp=0 ; lp < 16 && carr[lp] != oldc; lp++)
;
menu->UnCheckItem(lp + O_BGCOLOR);
menu->CheckItem(m.usCmd());
}
// SET FONT
if (m.usCmd() == O_FONT)
Fonts();
switch (m.usCmd())
{
case F_NEW:
new Document(this);
break;
case F_OPEN:
Open();
break;
case F_SAVE:
top->Save();
break;
case F_SAVEAS:
top->SaveAs();
break;
case F_CLOSE:
if (top->Close(wMessage()))
delete top;
break;
case F_QUIT:
if (top)
{
if (CloseAll())
PostMessage(wMessage(WM_QUIT, 0, 0));
}
break;
case E_UNDO:
top->mle->Undo();
break;
case E_CUT:
top->mle->CutSelection();
break;
case E_COPY:
top->mle->CopySelection();
break;
case E_PASTE:
top->mle->PasteSelection();
break;
case E_CLEAR:
top->mle->ClearSelection();
break;
case E_FIND:
{
ushort found = TRUE;
SearchDlg s(this, EDIT_SEARCH, &search, &replace, &cs);
switch(s.GetResult())
{
//.........这里部分代码省略.........