本文整理汇总了C++中Viewer::GetEditor方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::GetEditor方法的具体用法?C++ Viewer::GetEditor怎么用?C++ Viewer::GetEditor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewer
的用法示例。
在下文中一共展示了Viewer::GetEditor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: InterpretManipulator
Command* TextFileView::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)) {
// do nothing
} else {
cmd = TextOvView::InterpretManipulator(m);
}
return cmd;
}
示例3: InterpLinkCompManip
Command* LinkView::InterpLinkCompManip (Manipulator* m) {
Viewer* v = m->GetViewer();
Editor* ed = v->GetEditor();
GraphicView* views = v->GetGraphicView();
BrushVar* brVar = (BrushVar*) ed->GetState("BrushVar");
ConnectManip* cm = (ConnectManip*) m;
Transformer* rel = cm->GetTransformer();
RubberGroup* rg = (RubberGroup*) cm->GetRubberband();
RubberLine* rl = (RubberLine*) rg->First();
Coord x0, y0, x1, y1;
Connector* c1, *c2;
ConnectorView* target1, *target2;
MacroCmd* macro = new MacroCmd(ed);
rl->GetCurrent(x0, y0, x1, y1);
if (rel != nil) {
rel = new Transformer(rel);
rel->Invert();
}
Graphic* pg = GetGraphicComp()->GetGraphic();
Line* line = new Line(x0, y0, x1, y1, pg);
if (brVar != nil) line->SetBrush(brVar->GetBrush());
line->SetTransformer(rel);
Unref(rel);
LinkComp* linkComp = NewSubject(line);
linkComp->GetConnectors(c1, c2);
macro->Append(new PasteCmd(ed, new Clipboard(linkComp)));
target1 = views->ConnectorIntersecting(x0-SLOP, y0-SLOP, x0+SLOP, y0+SLOP);
target2 = views->ConnectorIntersecting(x1-SLOP, y1-SLOP, x1+SLOP, y1+SLOP);
if (target1 != nil) {
macro->Append(new ConnectCmd(ed, c1, target1->GetConnector()));
}
if (target2 != nil) {
macro->Append(new ConnectCmd(ed, c2, target2->GetConnector()));
}
return macro;
}