本文整理汇总了C++中Graphic::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphic::Append方法的具体用法?C++ Graphic::Append怎么用?C++ Graphic::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphic
的用法示例。
在下文中一共展示了Graphic::Append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Sim_Press
void VMouse::Sim_Press(Graphic* orig, Graphic* porig, Event& e) {
Canvas* screen = _myglass->GetCanvas();
Graphic* parent;
if (e.eventType == DownEvent) {
parent = orig->Parent();
if (parent != nil) {
orig->Erase(screen);
parent->Remove(orig);
parent->Append(porig);
porig->Draw(screen);
if (e.leftmouse) {
_vwriter->Request(1);
} else if (e.middlemouse) {
_vwriter->Request(2);
} else if (e.rightmouse) {
_vwriter->Request(3);
}
}
} else if (e.eventType == UpEvent) {
parent = porig->Parent();
if (parent != nil) {
porig->Erase(screen);
parent->Remove(porig);
parent->Append(orig);
orig->Draw(screen);
}
}
}
示例2: Picture
LinkComp::LinkComp (Line* line) {
if (line != nil) {
Coord x0, y0, x1, y1;
float fx0, fy0, fx1, fy1;
line->GetOriginal(x0, y0, x1, y1);
Transformer* t = line->GetTransformer();
Graphic* parent = new Picture(line);
parent->SetTransformer(nil);
if (t == nil) {
fx0 = x0; fy0 = y0; fx1 = x1; fy1 = y1;
} else {
t->Transform(float(x0), float(y0), fx0, fy0);
t->Transform(float(x1), float(y1), fx1, fy1);
}
delete line;
line = new Line(0, 0, 1, 1);
InitLine(line, fx0, fy0, fx1, fy1);
PinGraphic* pg1 = new PinGraphic;
PinGraphic* pg2 = new PinGraphic;
pg1->SetBrush(psnonebr);
pg2->SetBrush(psnonebr);
pg1->Translate(fx0, fy0);
pg2->Translate(fx1, fy1);
_conn1 = new PinComp(pg1);
_conn2 = new PinComp(pg2);
parent->Append(line, pg1, pg2);
SetGraphic(parent);
}
}
示例3: Read
void LinkComp::Read (istream& in) {
GraphicComp::Read(in);
Line* line = new Line(0, 0, 1, 1);
Transformer* t = ReadTransformer(in);
line->SetTransformer(t);
Unref(t);
_conn1 = (Connector*) unidraw->GetCatalog()->ReadComponent(in);
_conn2 = (Connector*) unidraw->GetCatalog()->ReadComponent(in);
Graphic* parent = new Picture;
parent->FillBg(ReadBgFilled(in));
PSColor* fg = ReadColor(in);
PSColor* bg = ReadColor(in);
parent->SetColors(fg, bg);
parent->SetBrush(ReadBrush(in));
t = ReadTransformer(in);
parent->SetTransformer(t);
Unref(t);
parent->Append(line, _conn1->GetGraphic(), _conn2->GetGraphic());
SetGraphic(parent);
}
示例4: GetGraphic
Graphic* LinkView::GetGraphic () {
Graphic* gr = GraphicView::GetGraphic();
if (gr == nil) {
LinkComp* linkComp = GetLinkComp();
gr = new Picture(linkComp->GetGraphic());
gr->Append(linkComp->GetLine()->Copy());
SetGraphic(gr);
Connector* c1, *c2;
linkComp->GetConnectors(c1, c2);
_connView1 = (ConnectorView*) c1->Create(COMPONENT_VIEW);
_connView2 = (ConnectorView*) c2->Create(COMPONENT_VIEW);
c1->Attach(_connView1);
c2->Attach(_connView2);
_connView1->Update();
_connView2->Update();
gr->Append(_connView1->GetGraphic(), _connView2->GetGraphic());
}
return gr;
}