00001 /* $Id: list_games.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 LIST_GAMES_H 00014 #define LIST_GAMES_H 00015 00016 #include <gtkmm.h> 00017 #include <libglademm.h> 00018 00020 00021 class list_games : public Gtk::Window { 00022 public: 00023 list_games(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> refGlade); 00024 virtual ~list_games(); 00025 void load(); 00026 00027 protected: 00028 Glib::RefPtr<Gnome::Glade::Xml> m_refGlade; 00029 virtual void clicked_cancel(); 00030 virtual void clicked_chat(); 00031 virtual void clicked_new_game(); 00032 Gtk::Button* cancel_game; 00033 Gtk::Button* new_game; 00034 Gtk::Button* join_game; 00035 Gtk::Button* general_chat; 00036 Gtk::TreeView* games_list; 00037 Glib::RefPtr<Gtk::ListStore> games_store; 00038 virtual void clicked_game(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column); 00039 00040 00042 struct ModelColumns : public Gtk::TreeModelColumnRecord { 00043 Gtk::TreeModelColumn<Glib::ustring> name; 00044 Gtk::TreeModelColumn<Glib::ustring> owner; 00045 Gtk::TreeModelColumn<Glib::ustring> join; 00046 Gtk::TreeModelColumn<Glib::ustring> goal; 00047 Gtk::TreeModelColumn<Glib::ustring> game_map; 00048 Gtk::TreeModelColumn<Glib::ustring> description; 00049 Gtk::TreeModelColumn<int> game_nr; 00050 ModelColumns() 00051 { 00052 add(name); add(owner); add(join); add(goal); add(game_map); add(description); 00053 add(game_nr); 00054 } 00055 }; 00056 const ModelColumns cols; 00057 }; 00058 00059 #endif //LIST_GAMES_H