1 // Copyright (C) 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 GUI_CITYSET_WINDOW_H
19 #define GUI_CITYSET_WINDOW_H
23 #include <sigc++/signal.h>
24 #include <sigc++/trackable.h>
29 //! Cityset Editor. Edit an cityset.
30 class CitySetWindow: public sigc::trackable
33 CitySetWindow(std::string load_filename = "");
39 Gtk::Window &get_window() { return *window; }
43 std::string current_save_filename;
44 Cityset *d_cityset; //current cityset
46 Gtk::MenuItem *new_cityset_menuitem;
47 Gtk::MenuItem *load_cityset_menuitem;
48 Gtk::MenuItem *save_cityset_menuitem;
49 Gtk::MenuItem *validate_cityset_menuitem;
50 Gtk::MenuItem *edit_cityset_info_menuitem;
51 Gtk::MenuItem *quit_menuitem;
52 Gtk::MenuItem *help_about_menuitem;
53 Gtk::Button *change_citypics_button;
54 Gtk::Button *change_razedcitypics_button;
55 Gtk::Button *change_portpic_button;
56 Gtk::Button *change_signpostpic_button;
57 Gtk::Button *change_ruinpics_button;
58 Gtk::Button *change_templepic_button;
59 Gtk::Button *change_towerpics_button;
60 Gtk::SpinButton *city_tile_width_spinbutton;
61 Gtk::SpinButton *ruin_tile_width_spinbutton;
62 Gtk::SpinButton *temple_tile_width_spinbutton;
63 Gtk::Frame *cityset_frame;
65 bool on_delete_event(GdkEventAny *e);
67 void update_cityset_panel();
68 void update_cityset_menuitems();
70 void load_cityset(std::string filename);
73 void on_new_cityset_activated();
74 void on_load_cityset_activated();
75 void on_save_cityset_activated();
76 void on_validate_cityset_activated();
77 void on_quit_activated();
78 bool on_window_closed(GdkEventAny*);
80 void on_edit_cityset_info_activated();
81 void on_help_about_activated();
82 void on_city_tile_width_changed();
83 void on_city_tile_width_text_changed(const Glib::ustring &s, int* p);
84 void on_ruin_tile_width_changed();
85 void on_ruin_tile_width_text_changed(const Glib::ustring &s, int* p);
86 void on_temple_tile_width_changed();
87 void on_temple_tile_width_text_changed(const Glib::ustring &s, int* p);
88 void on_change_citypics_clicked();
89 void on_change_razedcitypics_clicked();
90 void on_change_portpic_clicked();
91 void on_change_signpostpic_clicked();
92 void on_change_ruinpics_clicked();
93 void on_change_templepic_clicked();
94 void on_change_towerpics_clicked();