00001 /* $Id:edit_game.h jjs $ */ 00002 /* 00003 Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl> 00004 Part of the Moros Project http://moros.sourceforge.net/ 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License. 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY. 00010 00011 See the COPYING file for more details. 00012 */ 00013 #ifndef EDIT_GAME_H 00014 #define EDIT_GAME_H 00015 00016 #include <gtkmm.h> 00017 #include <libglademm.h> 00018 #include "list_games.h" 00019 #include "edit_party.h" 00020 #include "../general/channel.h" 00021 00023 00024 class edit_game : public Gtk::Window { 00025 public: 00026 edit_game(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> refGlade); 00027 virtual ~edit_game(); 00028 void load(long gamenr); 00029 void save(); 00030 sigc::signal<void> signal_changed; 00031 private: 00032 std::string session; 00033 protected: 00034 int game_nr; 00035 Glib::RefPtr<Gnome::Glade::Xml> glade; 00036 Gtk::Entry* name; 00037 Gtk::TextView* description; 00038 Glib::RefPtr<Gtk::TextBuffer> desc_buffer; 00039 Gtk::ComboBox* join; 00040 Gtk::ComboBox* goal; 00041 Gtk::Entry* map_name; 00042 Gtk::Entry* game_url; 00043 Gtk::TreeView* party_list; 00044 Glib::RefPtr<Gtk::ListStore> party_store; 00045 Glib::RefPtr<Gtk::ListStore> join_store; 00046 Glib::RefPtr<Gtk::ListStore> goal_store; 00047 edit_party *party_window; 00048 vector<party> party_data; 00049 virtual void clicked_party(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); 00050 virtual void party_changed(); 00051 00052 Gtk::Button* cancel_game; 00053 virtual void clicked_cancel(); 00054 Gtk::Button* add_party; 00055 virtual void clicked_add_party(); 00056 Gtk::Button* create_game; 00057 Gtk::Label* create_label; 00058 virtual void clicked_create(); 00059 Gtk::Button* game_editor; 00060 virtual void clicked_editor(); 00061 void clear_data(); 00062 virtual void session_handler(channel *ch); 00063 00064 class ComboColumns : public Gtk::TreeModelColumnRecord { 00065 public: 00066 Gtk::TreeModelColumn<Glib::ustring> text; 00067 ComboColumns() { 00068 add(text); 00069 } 00070 }; 00071 const ComboColumns ccols; 00072 00073 class ModelColumns : public Gtk::TreeModelColumnRecord { 00074 public: 00075 Gtk::TreeModelColumn<Glib::ustring> name; 00076 Gtk::TreeModelColumn<Glib::ustring> description; 00077 Gtk::TreeModelColumn<int> party_nr; 00078 ModelColumns() { 00079 add(name); 00080 add(description); 00081 add(party_nr); 00082 } 00083 }; 00084 const ModelColumns cols; 00085 }; 00086 00087 #endif //EDIT_GAME_H