/**** * * Quick test of building a new GraphicBlock in an attempt to figure out why * we're having grblock.o link problems. The answer to the link problems is to * allocate a (dummy) Perspective. * */ #include #include #include #include #include #include #include class MyGraphicBlock : public GraphicBlock { public: MyGraphicBlock(Sensor* s, Graphic* g, Coord pad = 0, Alignment a = Center, Zooming z = Continuous); void Resize(); }; MyGraphicBlock::MyGraphicBlock(Sensor* s, Graphic* g, Coord pad = 0, Alignment a, Zooming z) : GraphicBlock(s, g, pad, a, z) { } void MyGraphicBlock::Resize() { GraphicBlock::Resize(); } main() { World* w = new World(); // TheManager = new ObjectMan( // "graphics", &GraphicsInitialize, &GraphicsConstruct // ); // Picture* p = (Picture*) (*(*TheManager->GetRoot())[1])(); Picture* p = new Picture(); Perspective* ps = new Perspective(); MyGraphicBlock* gb; Tray* t; MonoScene* m = new MonoScene(); FullGraphic dfault; Shape s; s.Rect(75,75); /* * Do some necessary IV init. */ InitPPaint(); p->SetTransformer(nil); /* * Set default drawing properties in the full graphic to be used by the * graphic construtor functions, such as Line::Line */ dfault.FillBg(true); dfault.SetColors(pblack, pwhite); dfault.SetPattern(psolid); dfault.SetBrush(psingle); dfault.SetFont(pstdfont); /* * Draw a simple line in the picture. */ p->Append(new Line(0, 0, 75, 75, &dfault)); /* * Alloc the new graphic block. This must be done AFTER the picture is * is drawn if we want the size of the graphic block to be computed based * on the shape of the picture. */ gb = new MyGraphicBlock(new Sensor(), p); // gb->Update(); gb->Resize(); m->Insert(t = new Tray(gb)); // gb->Reshape(s); w->InsertApplication(m); //t->Change(); w->Run(); }