/**** * * Implementation of add-card-buttons.h * */ #include "add-card-buttons.h" #include "add-card-dialog.h" #include "card.h" #include "rolodex-menu-ui.h" #include "rolodex.h" #include #include #include #include #ifndef HP700 #include #endif FoundCardsButtons::FoundCardsButtons(Rolodex* r, FoundCardsDialog* fcd, RolodexMenuUI* rmui) : View(NULL, r) { ncb = new NextCardButton(fcd); pcb = new PreviousCardButton(fcd); dfb = new DoneFindButton(rmui, fcd); } FoundCardsButtons::~FoundCardsButtons() { } void FoundCardsButtons::Compose() { /* * Make the window of this an HBox. */ w = new HBox(); /* * Enter the buttons into the box, delimited with glue. */ ((HBox*)w)->Insert(new HGlue(round(0.2 * inch), hfil, hfil)); ((HBox*)w)->Insert(ncb); ((HBox*)w)->Insert(new HGlue(round(0.2 * inch), hfil, hfil)); ((HBox*)w)->Insert(pcb); ((HBox*)w)->Insert(new HGlue(round(0.2 * inch), hfil, hfil)); ((HBox*)w)->Insert(dfb); ((HBox*)w)->Insert(new HGlue(round(0.2 * inch), hfil, hfil)); } NextCardButton::NextCardButton(FoundCardsDialog* fcd) : PushButton("Next Card", new ButtonState(), true) { this->fcd = fcd; } void NextCardButton::Press() { fcd->Next(); } PreviousCardButton::PreviousCardButton(FoundCardsDialog* fcd) : PushButton("Previous Card", new ButtonState(), true) { this->fcd = fcd; } void PreviousCardButton::Press() { fcd->Previous(); } DoneFindButton::DoneFindButton(RolodexMenuUI* rmui, FoundCardsDialog* fcd) : PushButton("Done", new ButtonState(), true) { this->rmui = rmui; this->fcd = fcd; } void DoneFindButton::Press() { fcd->Done(); rmui->ShowEmptyDialog(); }