1 // Copyright (C) 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 STACK_INFO_DIALOG_H
19 #define STACK_INFO_DIALOG_H
22 #include <sigc++/trackable.h>
23 #include <sigc++/signal.h>
27 #include "army-info-tip.h"
33 #include "decorated.h"
35 // dialog for showing hero information
36 class StackInfoDialog: public Decorated
39 StackInfoDialog(Vector<int> pos);
42 void set_parent_window(Gtk::Window &parent);
45 Stack * get_selected_stack() {return currently_selected_stack;};
52 Gtk::Table *stack_table;
54 ArmyInfoTip* army_info_tip;
55 std::vector<Gtk::ToggleButton *> toggles;
56 std::vector<const Army*> armies;
57 std::vector<Gtk::RadioButton *> radios;
58 Gtk::Button *group_button;
59 Gtk::Button *ungroup_button;
60 Stack *currently_selected_stack;
62 void addArmy (bool first, Stack *s, Army *a, guint32 modified_strength, int idx);
63 void addStack(Stack *s, guint32 &idx);
64 void on_group_clicked();
65 void on_ungroup_clicked();
66 void fill_stack_info();
67 void on_stack_toggled(Gtk::RadioButton *radio, Stack *s);
68 void on_army_toggled(Gtk::ToggleButton *toggle, Stack *s, Army *a);
69 bool on_army_button_event(GdkEventButton *e, Gtk::ToggleButton *toggle);