1 //  Copyright (C) 2008, 2009, 2014 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 #pragma once
19 #ifndef SELECT_HIDDEN_RUIN_DIALOG_H
20 #define SELECT_HIDDEN_RUIN_DIALOG_H
21 
22 #include <gtkmm.h>
23 #include "lw-editor-dialog.h"
24 
25 class Ruin;
26 
27 //! Scenario editor.  Select a hidden Ruin object in the scenario.
28 class SelectHiddenRuinDialog: public LwEditorDialog
29 {
30  public:
31     SelectHiddenRuinDialog(Gtk::Window &parent);
~SelectHiddenRuinDialog()32     ~SelectHiddenRuinDialog() {}
33 
34     void run();
get_selected_hidden_ruin()35     const Ruin *get_selected_hidden_ruin()
36       { return selected_hidden_ruin; }
37 
38  private:
39     Gtk::Button *select_button;
40 
41     const Ruin *selected_hidden_ruin;
42 
43     Gtk::TreeView *hidden_ruins_treeview;
44     class HiddenRuinsColumns: public Gtk::TreeModelColumnRecord {
45     public:
HiddenRuinsColumns()46 	HiddenRuinsColumns()
47         { add(name); add(ruin);}
48 
49 	Gtk::TreeModelColumn<Glib::ustring> name;
50 	Gtk::TreeModelColumn<Ruin *> ruin;
51     };
52     const HiddenRuinsColumns hidden_ruins_columns;
53     Glib::RefPtr<Gtk::ListStore> hidden_ruins_list;
54 
55     void addHiddenRuin(Ruin *ruin);
56 
57     void set_select_button_state();
58 };
59 
60 #endif
61