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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2009-10-21 08:02:12 UTC
  • mfrom: (1.1.8 upstream) (5.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091021080212-wpmd6xdaxrgnn63y
Tags: 0.1.6-1
[ Barry deFreese ]
* New upstream release.
  + Drop libsdl-image1.2 from build-deps, no longer needed.
* Add README.source for quilt patch system.
* Clean up debian/copyright some.
* Bump Standards Version to 3.8.3. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//  Copyright (C) 2007, Ole Laursen
2
 
//  Copyright (C) 2007, 2008 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 2 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
 
#ifndef CITY_DIALOG_H
20
 
#define CITY_DIALOG_H
21
 
 
22
 
#include <memory>
23
 
#include <sigc++/trackable.h>
24
 
#include <gtkmm/button.h>
25
 
#include <gtkmm/checkbutton.h>
26
 
#include <gtkmm/dialog.h>
27
 
#include <gtkmm/entry.h>
28
 
#include <gtkmm/spinbutton.h>
29
 
#include <gtkmm/comboboxtext.h>
30
 
#include <gtkmm/treeview.h>
31
 
#include <gtkmm/liststore.h>
32
 
 
33
 
 
34
 
class CreateScenarioRandomize;
35
 
class City;
36
 
class ArmyProdBase;
37
 
 
38
 
//! Scenario editor.  Edits a City object.
39
 
class CityDialog: public sigc::trackable
40
 
{
41
 
 public:
42
 
    CityDialog(City *city, CreateScenarioRandomize *randomizer);
43
 
 
44
 
    void set_parent_window(Gtk::Window &parent);
45
 
 
46
 
    void run();
47
 
    
48
 
 private:
49
 
    std::auto_ptr<Gtk::Dialog> dialog;
50
 
    Gtk::ComboBoxText *player_combobox;
51
 
    Gtk::CheckButton *capital_checkbutton;
52
 
    Gtk::Entry *name_entry;
53
 
    Gtk::SpinButton *income_spinbutton;
54
 
    Gtk::CheckButton *burned_checkbutton;
55
 
 
56
 
    Gtk::TreeView *army_treeview;
57
 
    
58
 
    class ArmyColumns: public Gtk::TreeModelColumnRecord {
59
 
    public:
60
 
        ArmyColumns()
61
 
            { add(army); add(name);
62
 
              add(strength); add(moves); add(upkeep); add(duration); }
63
 
 
64
 
        Gtk::TreeModelColumn<const ArmyProdBase *> army;
65
 
        Gtk::TreeModelColumn<Glib::ustring> name;
66
 
        Gtk::TreeModelColumn<int> strength, moves, upkeep, duration;
67
 
    };
68
 
    const ArmyColumns army_columns;
69
 
    Glib::RefPtr<Gtk::ListStore> army_list;
70
 
    Gtk::Button *add_button;
71
 
    Gtk::Button *remove_button;
72
 
    Gtk::Button *randomize_armies_button;
73
 
    Gtk::Button *randomize_name_button;
74
 
    Gtk::Button *randomize_income_button;
75
 
 
76
 
    City *city;
77
 
 
78
 
    void on_add_clicked();
79
 
    void on_remove_clicked();
80
 
    void on_randomize_armies_clicked();
81
 
    void on_randomize_name_clicked();
82
 
    void on_randomize_income_clicked();
83
 
    void on_selection_changed();
84
 
    void on_player_changed();
85
 
 
86
 
    void add_army(const ArmyProdBase *a);
87
 
    void set_button_sensitivity();
88
 
    CreateScenarioRandomize *d_randomizer;
89
 
};
90
 
 
91
 
#endif