本文整理汇总了C++中OverlayComp::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ OverlayComp::Copy方法的具体用法?C++ OverlayComp::Copy怎么用?C++ OverlayComp::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OverlayComp
的用法示例。
在下文中一共展示了OverlayComp::Copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Interpret
void OverlaysComp::Interpret (Command* cmd) {
Editor* ed = cmd->GetEditor();
if (
(cmd->IsA(DELETE_CMD) || cmd->IsA(CUT_CMD)) &&
ed->GetComponent() != this
) {
Iterator i;
for (First(i); !Done(i); Next(i)) {
GetComp(i)->Interpret(cmd);
}
} else if (cmd->IsA(DELETE_CMD)) {
Clipboard* cb = cmd->GetClipboard();
Selection* s = ed->GetSelection();
if (cb == nil) {
if (s->IsEmpty()) {
return;
}
cmd->SetClipboard(cb = new Clipboard);
cb->Init(s);
}
s->Clear();
Iterator i;
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
OverlayComp* comp = (OverlayComp*)cb->GetComp(i);
unidraw->CloseDependents(comp);
comp->Interpret(cmd);
StorePosition(comp, cmd);
Remove(comp);
}
Notify();
unidraw->Update();
} else if (cmd->IsA(CUT_CMD)) {
Clipboard* cb = cmd->GetClipboard();
Selection* s = ed->GetSelection();
if (cb == nil) {
if (s->IsEmpty()) {
return;
}
GraphicView* views = ed->GetViewer()->GetGraphicView();
s->Sort(views);
cmd->SetClipboard(cb = new Clipboard);
cb->Init(s);
Clipboard* globalcb = unidraw->GetCatalog()->GetClipboard();
globalcb->DeleteComps();
globalcb->CopyInit(s);
}
s->Clear();
Iterator i;
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
OverlayComp* comp = (OverlayComp*)cb->GetComp(i);
unidraw->CloseDependents(comp);
comp->Interpret(cmd);
StorePosition(comp, cmd);
Remove(comp);
}
Notify();
unidraw->Update();
} else if (cmd->IsA(PASTE_CMD)) {
Clipboard* cb = cmd->GetClipboard();
Iterator i;
if (cb == nil) {
Clipboard* globalcb = unidraw->GetCatalog()->GetClipboard();
if (globalcb->IsEmpty()) {
return;
}
cmd->SetClipboard(cb = globalcb->DeepCopy());
}
for (cb->First(i); !cb->Done(i); cb->Next(i)) {
Append((OverlayComp*)cb->GetComp(i));
}
Notify();
SelectClipboard(cb, ed);
unidraw->Update();
} else if (cmd->IsA(DUP_CMD)) {
GraphicView* views = ed->GetViewer()->GetGraphicView();
OverlayComp* prev, *dup1;
Iterator i, pos;
Clipboard* cb = cmd->GetClipboard();
const float offset = 8;
MoveCmd move(ed, offset, offset);
if (cb == nil) {
OverlaySelection* s = (OverlaySelection*)ed->GetSelection();
if (s->IsEmpty()) {
return;
}
//.........这里部分代码省略.........