initial commit, lordsawar source, slightly modified
[lordsawar] / src / gui / fight-order-dialog.h
1 //  Copyright (C) 2007, 2008, 2009 Ben Asselstine
2 //
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.
7 //
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.
12 //
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 
16 //  02110-1301, USA.
17
18 #ifndef FIGHT_ORDER_DIALOG_H
19 #define FIGHT_ORDER_DIALOG_H
20
21 #include <memory>
22 #include <sigc++/trackable.h>
23 #include <sigc++/signal.h>
24 #include <gtkmm.h>
25 #include <list>
26
27 class Stack;
28 class Player;
29
30 #include "decorated.h"
31
32 // dialog for showing and changing the order in which army types fight
33 // in battle
34 class FightOrderDialog: public Decorated
35 {
36  public:
37     FightOrderDialog(Player *player);
38     ~FightOrderDialog();
39
40     void set_parent_window(Gtk::Window &parent);
41
42     void hide();
43
44     void run();
45
46  private:
47     Gtk::Dialog* dialog;
48
49     Player *player;
50     Gtk::TreeView *armies_treeview;
51     Gtk::Button *reverse_button;
52
53     class ArmiesColumns: public Gtk::TreeModelColumnRecord {
54     public:
55         ArmiesColumns() 
56         { add(image); add(name); add(army_type);}
57         
58         Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > image;
59         Gtk::TreeModelColumn<Glib::ustring> name;
60         Gtk::TreeModelColumn<guint32> army_type;
61     };
62     const ArmiesColumns armies_columns;
63     Glib::RefPtr<Gtk::ListStore> armies_list;
64  private:
65     void addArmyType(guint32 army_type);
66     void on_reverse_button_clicked();
67 };
68
69 #endif