1 //  Copyright (C) 2007 Ole Laursen
2 //  Copyright (C) 2007, 2008, 2009, 2014 Ben Asselstine
3 //
4 //  This program is free software; you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation; either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU Library General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program; if not, write to the Free Software
16 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 //  02110-1301, USA.
18 
19 #pragma once
20 #ifndef HERO_LEVELS_DIALOG_H
21 #define HERO_LEVELS_DIALOG_H
22 
23 #include <gtkmm.h>
24 #include <list>
25 #include "lw-dialog.h"
26 
27 class Player;
28 class Hero;
29 
30 // dialog for showing hero information
31 class HeroLevelsDialog: public LwDialog
32 {
33  public:
34     HeroLevelsDialog(Gtk::Window &parent, Player *player);
35     HeroLevelsDialog(Gtk::Window &parent, std::list<Hero*> heroes);
~HeroLevelsDialog()36     ~HeroLevelsDialog() {};
37 
38  private:
39     Player *player;
40     Gtk::TreeView *heroes_treeview;
41 
42     class HeroesColumns: public Gtk::TreeModelColumnRecord {
43     public:
HeroesColumns()44 	HeroesColumns()
45         { add(image); add(name); add(level);
46 	  add(exp); add(needs); add(str); add(move);}
47 
48 	Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > image;
49 	Gtk::TreeModelColumn<Glib::ustring> name;
50 	Gtk::TreeModelColumn<Glib::ustring> level;
51 	Gtk::TreeModelColumn<guint32> exp;
52 	Gtk::TreeModelColumn<guint32> needs;
53 	Gtk::TreeModelColumn<guint32> str;
54 	Gtk::TreeModelColumn<guint32> move;
55     };
56     const HeroesColumns heroes_columns;
57     Glib::RefPtr<Gtk::ListStore> heroes_list;
58  private:
59 
60     void init(Player *theplayer);
61     void addHero(Hero *h);
62 };
63 
64 #endif
65