1 // Copyright (C) 2007 Ole Laursen 2 // Copyright (C) 2007, 2008, 2009, 2012, 2014, 2015 Ben Asselstine 3 // 4 // This program is free software; you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation; either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Library General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program; if not, write to the Free Software 16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 17 // 02110-1301, USA. 18 19 #pragma once 20 #ifndef HERO_OFFER_DIALOG_H 21 #define HERO_OFFER_DIALOG_H 22 23 #include <gtkmm.h> 24 25 #include "heromap.h" 26 #include "player.h" 27 #include "hero.h" 28 #include "heroproto.h" 29 #include "lw-dialog.h" 30 31 //! dialog for accepting/rejecting a hero 32 class HeroOfferDialog: public LwDialog 33 { 34 public: 35 HeroOfferDialog(Gtk::Window &parent, Player *player, HeroProto *hero, City *city, int gold); ~HeroOfferDialog()36 ~HeroOfferDialog() {delete heromap;}; 37 38 bool run(); hide()39 void hide() {dialog->hide();}; 40 41 private: 42 //! The smallmap that shows where the Hero is emerging. 43 HeroMap* heromap; 44 45 Gtk::Image *map_image; 46 Gtk::Image *hero_image; 47 Gtk::RadioButton *male_radiobutton; 48 Gtk::RadioButton *female_radiobutton; 49 Gtk::Entry *name_entry; 50 Gtk::Button *accept_button; 51 52 HeroProto *hero; 53 City *city; 54 55 void on_toggled(); 56 void on_map_changed(Cairo::RefPtr<Cairo::Surface> map); 57 void update_buttons(); 58 void on_name_changed(); 59 60 }; 61 62 #endif 63