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 GUI_SHIELDSET_WINDOW_H
19 #define GUI_SHIELDSET_WINDOW_H
23 #include <sigc++/signal.h>
24 #include <sigc++/trackable.h>
28 #include "shieldset.h"
31 //! Shieldset Editor. Edit an Shieldset.
32 class ShieldSetWindow: public sigc::trackable
35 ShieldSetWindow(std::string load_filename = "");
41 Gtk::Window &get_window() { return *window; }
45 std::string current_save_filename;
46 Shieldset *d_shieldset; //current shieldset
47 Shield *d_shield; //current shield
49 Gtk::TreeView *shields_treeview;
50 Gtk::MenuItem *new_shieldset_menuitem;
51 Gtk::MenuItem *load_shieldset_menuitem;
52 Gtk::MenuItem *save_shieldset_menuitem;
53 Gtk::MenuItem *validate_shieldset_menuitem;
54 Gtk::MenuItem *edit_shieldset_info_menuitem;
55 Gtk::MenuItem *quit_menuitem;
56 Gtk::MenuItem *help_about_menuitem;
57 Gtk::Frame *shield_frame;
58 Gtk::Button *change_smallpic_button;
59 Gtk::Button *change_mediumpic_button;
60 Gtk::Button *change_largepic_button;
61 Gtk::ColorButton *player_colorbutton;
63 class ShieldsColumns: public Gtk::TreeModelColumnRecord {
66 { add(name); add(shield);}
68 Gtk::TreeModelColumn<Glib::ustring> name;
69 Gtk::TreeModelColumn<Shield*> shield;
71 const ShieldsColumns shields_columns;
72 Glib::RefPtr<Gtk::ListStore> shields_list;
74 void on_new_shieldset_activated();
75 void on_load_shieldset_activated();
76 void on_save_shieldset_activated();
77 void on_validate_shieldset_activated();
78 void on_quit_activated();
79 bool on_delete_event(GdkEventAny *e);
80 bool on_window_closed(GdkEventAny*);
81 void on_edit_shieldset_info_activated();
82 void on_help_about_activated();
83 void on_shield_selected();
84 void on_change_smallpic_clicked();
85 void on_change_mediumpic_clicked();
86 void on_change_largepic_clicked();
87 void on_player_color_changed();
89 void fill_shield_info(Shield *shield);
90 void load_shieldset(std::string filename);
91 void update_shield_panel();
92 void update_shieldset_menuitems();
95 void addNewShield(Shield::Colour owner, Gdk::Color colour);
96 void loadShield(Shield *shield);