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 SELECT_ITEM_DIALOG_H
19
#define SELECT_ITEM_DIALOG_H
23
#include <sigc++/trackable.h>
24
#include <gtkmm/dialog.h>
25
#include <gtkmm/container.h>
26
#include <gtkmm/liststore.h>
27
#include <gtkmm/treemodelcolumn.h>
28
#include <gtkmm/treeview.h>
29
#include <gtkmm/textview.h>
30
#include <gtkmm/label.h>
31
#include <gtkmm/button.h>
36
//! Scenario editor. Select an Item object from the Itemlist.
37
class SelectItemDialog: public sigc::trackable
42
void set_parent_window(Gtk::Window &parent);
46
const Item *get_selected_item() { return selected_item; }
49
std::auto_ptr<Gtk::Dialog> dialog;
50
Gtk::Button *select_button;
52
const Item *selected_item;
54
Gtk::TreeView *items_treeview;
55
class ItemsColumns: public Gtk::TreeModelColumnRecord {
58
{ add(name); add(item);}
60
Gtk::TreeModelColumn<Glib::ustring> name;
61
Gtk::TreeModelColumn<Item *> item;
63
const ItemsColumns items_columns;
64
Glib::RefPtr<Gtk::ListStore> items_list;
67
void addItem(Item *item);
69
void set_select_button_state();