1
// Copyright (C) 2008, 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 2 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 GUI_REWARDLIST_DIALOG_H
19
#define GUI_REWARDLIST_DIALOG_H
23
#include <sigc++/signal.h>
24
#include <sigc++/trackable.h>
25
#include <libglademm/xml.h>
26
#include <gtkmm/window.h>
27
#include <gtkmm/dialog.h>
28
#include <gtkmm/container.h>
29
#include <gtkmm/liststore.h>
30
#include <gtkmm/treemodelcolumn.h>
31
#include <gtkmm/treeview.h>
32
#include <gtkmm/textview.h>
33
#include <gtkmm/filechooserbutton.h>
34
#include <gtkmm/image.h>
35
#include <gtkmm/button.h>
36
#include <gtkmm/spinbutton.h>
37
#include <gtkmm/table.h>
38
#include <gtkmm/checkbutton.h>
39
#include <gtkmm/radiobutton.h>
40
#include <gtkmm/tooltips.h>
42
#include "../rewardlist.h"
44
//! Scenario editor. Manages Reward objects in the Rewardlist.
45
class RewardlistDialog: public sigc::trackable
51
void set_parent_window(Gtk::Window &parent);
55
Gtk::Dialog &get_dialog() { return *dialog.get(); }
58
std::auto_ptr<Gtk::Dialog> dialog;
59
Reward *d_reward; //current reward
60
Gtk::TreeView *rewards_treeview;
61
Gtk::Button *add_button;
62
Gtk::Button *remove_button;
63
Gtk::Button *edit_button;
65
class RewardsColumns: public Gtk::TreeModelColumnRecord {
68
{ add(name); add(reward);}
70
Gtk::TreeModelColumn<Glib::ustring> name;
71
Gtk::TreeModelColumn<Reward *> reward;
73
const RewardsColumns rewards_columns;
74
Glib::RefPtr<Gtk::ListStore> rewards_list;
76
void addReward(Reward *reward);
77
void update_rewardlist_buttons();
80
void on_add_clicked();
81
void on_remove_clicked();
82
void on_edit_clicked();
83
void on_reward_selected();