#include #include #include #include #include #include #include #include class PaintLabel : public Message { public: PaintLabel(char* msg, char* fam, char* wgt, char *sl, char *pnt); }; Font* FontByName(char* fam, char* wgt, char* sl, char* pnt) { char fontname[200]; sprintf(fontname, "*-*-%s-%s-%s-normal-*-*-%s0-*-*-*-*-iso8859-1", fam, wgt, sl, pnt, "\0"); return new Font(fontname); } PaintLabel::PaintLabel(char* msg, char* fam, char* wgt, char *sl, char *pnt) : (msg) { output = new Painter(); output->SetFont(FontByName(fam, wgt, sl, pnt)); Reconfig(); } main() { World* world = new World(); Tray* lt; VBox* b; PaintLabel* yo, * sf; world->InsertApplication( lt = new Tray( new HBox( new HGlue(round(0.5*inch), round(0.4*inch), round(2.0*inch)), b = new VBox( new VGlue(round(0.3*inch), round(0.2*inch), round(1.0*inch)), yo = new PaintLabel("Your Order", "helvetica", "medium", "r", "18"), sf = new PaintLabel("So Far:", "helvetica", "bold", "r", "16"), new VGlue(round(0.3*inch), round(0.2*inch), round(1.0*inch)) ), new HGlue(round(0.5*inch), round(0.4*inch), round(2.0*inch)) ) ) ); b->Align(Center); b->Change(); /* lt->Align(HorizCenter, yo, sf); lt->Change(); */ /* world->InsertApplication(lt = new Tray()); lt->Align(HorizCenter, yo = new PaintLabel("Your Order", "helvetica", "medium", "r", "18"), sf = new PaintLabel("So Far:", "helvetica", "medium", "r", "18")); lt->Change(); */ world->Run(); delete world; return 0; }