1 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 #ifndef REPORT_DIALOG_H
19 #define REPORT_DIALOG_H
23 #include <sigc++/trackable.h>
26 #include "LocationList.h"
27 #include "vectormap.h"
35 #include "decorated.h"
39 class ReportDialog: public Decorated
42 enum ReportType {ARMY = 0, CITY, GOLD, PRODUCTION, WINNING};
44 ReportDialog(Player *player, ReportType type);
47 void set_parent_window(Gtk::Window &parent);
49 static std::string calculateRank(std::list<guint32> scores, guint32 score);
59 Gtk::Image *map_image;
61 Gtk::Label *army_label;
62 Gtk::Label *city_label;
63 Gtk::Label *gold_label;
64 Gtk::Label *production_label;
65 Gtk::Label *winning_label;
66 Gtk::Notebook *report_notebook;
67 Gtk::Alignment *army_alignment;
69 Gtk::Alignment *city_alignment;
71 Gtk::Alignment *gold_alignment;
73 Gtk::Alignment *winning_alignment;
74 BarChart *winning_chart;
77 void on_army_map_changed(Glib::RefPtr<Gdk::Pixmap> map);
78 void on_city_map_changed(Glib::RefPtr<Gdk::Pixmap> map);
79 void on_vector_map_changed(Glib::RefPtr<Gdk::Pixmap> map);
80 void on_switch_page(GtkNotebookPage *page, guint number);
82 Gtk::TreeView *armies_treeview;
84 class ArmiesColumns: public Gtk::TreeModelColumnRecord {
87 { add(city_id) ;add(image); add(desc);}
89 Gtk::TreeModelColumn<guint32> city_id;
90 Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > image;
91 Gtk::TreeModelColumn<Glib::ustring> desc;
93 const ArmiesColumns armies_columns;
94 Glib::RefPtr<Gtk::ListStore> armies_list;
95 void addProduction(const Action *action);
96 void on_close_button();
99 void updateArmyChart();
100 void updateCityChart();
101 void updateGoldChart();
102 void updateWinningChart();
103 void on_army_selected();