~ubuntu-branches/ubuntu/trusty/lordsawar/trusty

« back to all changes in this revision

Viewing changes to src/editor/rewardlist-dialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2008-06-17 16:07:00 UTC
  • mto: (5.1.1 lenny) (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20080617160700-6d8ofoz0qkasxlnw
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2008, 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 2 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 GUI_REWARDLIST_DIALOG_H
 
19
#define GUI_REWARDLIST_DIALOG_H
 
20
 
 
21
#include <memory>
 
22
#include <vector>
 
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>
 
41
 
 
42
#include "../rewardlist.h"
 
43
 
 
44
//! Scenario editor.  Manages Reward objects in the Rewardlist.
 
45
class RewardlistDialog: public sigc::trackable
 
46
{
 
47
 public:
 
48
    RewardlistDialog();
 
49
    ~RewardlistDialog();
 
50
 
 
51
    void set_parent_window(Gtk::Window &parent);
 
52
 
 
53
    void run();
 
54
 
 
55
    Gtk::Dialog &get_dialog() { return *dialog.get(); }
 
56
 
 
57
 private:
 
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;
 
64
 
 
65
    class RewardsColumns: public Gtk::TreeModelColumnRecord {
 
66
    public:
 
67
        RewardsColumns() 
 
68
        { add(name); add(reward);}
 
69
        
 
70
        Gtk::TreeModelColumn<Glib::ustring> name;
 
71
        Gtk::TreeModelColumn<Reward *> reward;
 
72
    };
 
73
    const RewardsColumns rewards_columns;
 
74
    Glib::RefPtr<Gtk::ListStore> rewards_list;
 
75
 
 
76
    void addReward(Reward *reward);
 
77
    void update_rewardlist_buttons();
 
78
 
 
79
    //callbacks
 
80
    void on_add_clicked();
 
81
    void on_remove_clicked();
 
82
    void on_edit_clicked();
 
83
    void on_reward_selected();
 
84
 
 
85
 
 
86
};
 
87
 
 
88
#endif