1 // Copyright (C) 2007 Ole Laursen
2 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
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.
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.
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
19 #ifndef BUY_PRODUCTION_DIALOG_H
20 #define BUY_PRODUCTION_DIALOG_H
24 #include <sigc++/trackable.h>
27 #include "army-info-tip.h"
29 #include "armyproto.h"
32 #include "decorated.h"
33 // dialog for buying a production slot for a city
34 class BuyProductionDialog: public Decorated
37 BuyProductionDialog(City *city);
38 ~BuyProductionDialog();
40 void set_parent_window(Gtk::Window &parent);
45 enum { NO_ARMY_SELECTED = -1 };
46 int get_selected_army() { return selected_army == NO_ARMY_SELECTED ? NO_ARMY_SELECTED : purchasables[selected_army]->getTypeId(); }
50 ArmyInfoTip* army_info_tip;
51 Gtk::Label *production_info_label1;
52 Gtk::Label *production_info_label2;
53 Gtk::Button *buy_button;
58 std::vector<Gtk::ToggleButton *> production_toggles;
60 std::vector<const ArmyProto*> purchasables;
62 void on_production_toggled(Gtk::ToggleButton *toggle);
63 bool on_production_button_event(GdkEventButton *e, Gtk::ToggleButton *toggle);
64 void fill_in_production_info();
65 void set_buy_button_state();
66 const ArmyProto *army_id_to_army();