/* * Implementaion of face.h */ #include "face.h" #include <441/include/fontbyname.h> #include <441/include/paintlabel.h> #include <441/include/quitbutton.h> #include <441/include/simpledialog.h> #include #include #include #include void FaceAndButtons::Compose(World* world) { facebutton = new FaceButton(world); whobutton = new WhoButton(world); whybutton = new WhyButton(world); whatbutton = new WhatButton(world); VBox* vbox = new VBox( new VGlue(10), whobutton, new VGlue(10), whybutton, new VGlue(10), whatbutton, new VGlue(10) ); vbox->Align(Center); HBox* hbox = new HBox( new HGlue(20), facebutton, new HGlue(20), vbox, new HGlue(20) ); hbox->Align(Center); Insert(hbox); } FaceButton::FaceButton(World* world) : PaintedPushButton( "/home/phoenix/faculty/gfisher/441/examples/iv/face/face.xbm", new ButtonState(false), true) { this->world = world; } void FaceButton::Press() { SimpleDialog* dialog = new SimpleDialog( new VBox( new PaintLabel( "Can't get rid of him that easy.", "times", "medium", "r", "24"), new VGlue(10), new PaintLabel( "Looks like you need to do some coding.", "times", "medium", "r", "24") ), new class FontByName("times", "medium", "r", 18), "OK" ); dialog->Display(world); } WhoButton::WhoButton(World* world) : PaintedPushButton( "/home/phoenix/faculty/gfisher/441/examples/iv/face/who.xbm", new ButtonState(false), true) { this->world = world; } void WhoButton::Press() { SimpleDialog* dialog = new SimpleDialog( new PaintLabel( "It's Fisher, who do you think?", "times", "medium", "r", "24"), new class FontByName("times", "medium", "r", 18), "OK" ); dialog->Display(world); } WhyButton::WhyButton(World* world) : PaintedPushButton( "/home/phoenix/faculty/gfisher/441/examples/iv/face/why.xbm", new ButtonState(false), true) { this->world = world; } void WhyButton::Press() { SimpleDialog* dialog = new SimpleDialog( new PaintLabel( "Because your in this 441 lab.", "times", "medium", "r", "24"), new class FontByName("times", "medium", "r", 18), "OK" ); dialog->Display(world); } WhatButton::WhatButton(World* world) : PaintedPushButton( "/home/phoenix/faculty/gfisher/441/examples/iv/face/what.xbm", new ButtonState(false), true) { this->world = world; } void WhatButton::Press() { SimpleDialog* dialog = new SimpleDialog( new PaintLabel( "Click on his face.", "times", "medium", "r", "24"), new class FontByName("times", "medium", "r", 18), "OK" ); dialog->Display(world); }