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 HISTORY_REPORT_DIALOG_H
19 #define HISTORY_REPORT_DIALOG_H
23 #include <sigc++/trackable.h>
26 #include "line-chart.h"
28 #include "LocationList.h"
29 #include "historymap.h"
32 #include "decorated.h"
39 class HistoryReportDialog: public Decorated
42 enum HistoryReportType {CITY = 0, RUIN, EVENTS, GOLD, WINNING};
43 HistoryReportDialog(Player *p, HistoryReportType type);
44 ~HistoryReportDialog();
46 void generatePastCitylists(); //data for map
47 void generatePastCityCounts(); //data for chart
48 void generatePastRuinlists(); //data for map
49 void generatePastRuinCounts(); //data for chart
50 void generatePastGoldCounts(); //data for chart
51 void generatePastWinningCounts(); //data for chart
52 void generatePastEventlists(); //data for events list
53 void set_parent_window(Gtk::Window &parent);
60 HistoryMap* historymap;
63 Gtk::Scale *turn_scale;
64 Gtk::Notebook *history_notebook;
65 Gtk::Label *city_label;
66 Gtk::Label *ruin_label;
67 Gtk::Label *gold_label;
68 Gtk::Label *winner_label;
69 Gtk::Alignment *city_alignment;
70 Gtk::Alignment *ruin_alignment;
71 Gtk::Alignment *gold_alignment;
72 Gtk::Alignment *winner_alignment;
74 std::vector<LocationList<City*>* > past_citylists;
75 LineChart *city_chart;
76 std::vector<std::list<NetworkHistory *> > past_eventlists;
77 std::list<std::list<guint32> > past_citycounts;
78 std::vector<LocationList<Ruin*>* > past_ruinlists;
79 LineChart *ruin_chart;
80 std::list<std::list<guint32> > past_ruincounts;
81 std::list<std::list<guint32> > past_goldcounts;
82 LineChart *gold_chart;
83 std::list<std::list<guint32> > past_rankcounts;
84 LineChart *rank_chart;
86 Gtk::Image *map_image;
88 std::list<Gdk::Color> d_colours; //player colours
90 Gtk::VBox *events_list_box;
92 void addHistoryEvent(NetworkHistory *event);
93 void on_close_button();
94 void on_map_changed(Glib::RefPtr<Gdk::Pixmap> map);
95 void on_turn_changed(Gtk::Scale *scale);
96 void fill_in_turn_info(guint32 turn);
97 void on_switch_page(GtkNotebookPage *page, guint number);
98 void update_window_title();