本文整理汇总了C++中Viewer::Update方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::Update方法的具体用法?C++ Viewer::Update怎么用?C++ Viewer::Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewer
的用法示例。
在下文中一共展示了Viewer::Update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void Editor::Update () {
Viewer* v;
for (int i = 0; (v = GetViewer(i)) != nil; ++i) {
v->Update();
}
}
示例2: InterpretManipulator
Command* TextOvView::InterpretManipulator (Manipulator* m) {
Viewer* v = m->GetViewer();
Editor* ed = v->GetEditor();
Tool* tool = m->GetTool();
Command* cmd = nil;
if (tool->IsA(GRAPHIC_COMP_TOOL) || tool->IsA(RESHAPE_TOOL)) {
TextManip* tm = (TextManip*) m;
int size;
const char* text = tm->GetText(size);
if (size == 0) {
if (tool->IsA(RESHAPE_TOOL)) {
cmd = new OvDeleteCmd(ed);
} else {
v->Update(); // to repair text display-incurred damage
}
} else {
Coord xpos, ypos;
tm->GetPosition(xpos, ypos);
Painter* p = tm->GetPainter();
Transformer* rel = tm->GetPainter()->GetTransformer();
int lineHt = tm->GetLineHeight();
Graphic* pg = GetGraphicComp()->GetGraphic();
TextGraphic* textgr = new TextGraphic(text, lineHt, pg);
if (tool->IsA(GRAPHIC_COMP_TOOL)) {
textgr->SetTransformer(nil);
}
if (rel != nil) {
if (v->GetOrientation()==Rotated && !tool->IsA(RESHAPE_TOOL))
rel->Rotate(-90);
rel->InvTransform(xpos, ypos);
}
if (v->GetOrientation()==Rotated && !tool->IsA(RESHAPE_TOOL))
textgr->Rotate(90.0);
textgr->Translate(xpos, ypos);
textgr->FillBg(false);
textgr->SetFont((PSFont*) p->GetFont());
textgr->SetColors((PSColor*) p->GetFgColor(), nil);
if (tool->IsA(GRAPHIC_COMP_TOOL)) {
cmd = new PasteCmd(ed, new Clipboard(new TextOvComp(textgr)));
} else {
cmd = new ReplaceCmd(ed, new TextOvComp(textgr));
}
}
} else {
cmd = OverlayView::InterpretManipulator(m);
}
return cmd;
}