1 |
schoenebeck |
1225 |
/* -*- c++ -*- |
2 |
|
|
* Copyright (C) 2006, 2007 Andreas Persson |
3 |
|
|
* |
4 |
|
|
* This program is free software; you can redistribute it and/or |
5 |
|
|
* modify it under the terms of the GNU General Public License as |
6 |
|
|
* published by the Free Software Foundation; either version 2, or (at |
7 |
|
|
* your option) any later version. |
8 |
|
|
* |
9 |
|
|
* This program is distributed in the hope that it will be useful, but |
10 |
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 |
|
|
* General Public License for more details. |
13 |
|
|
* |
14 |
|
|
* You should have received a copy of the GNU General Public License |
15 |
|
|
* along with program; see the file COPYING. If not, write to the Free |
16 |
|
|
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
17 |
|
|
* 02110-1301 USA. |
18 |
|
|
*/ |
19 |
|
|
|
20 |
|
|
#ifndef GIGEDIT_DIMENSIONMANAGER_H |
21 |
|
|
#define GIGEDIT_DIMENSIONMANAGER_H |
22 |
|
|
|
23 |
|
|
#include <gtkmm/window.h> |
24 |
|
|
#include <gtkmm/layout.h> |
25 |
|
|
#include <gtkmm/button.h> |
26 |
|
|
#include <gtkmm/buttonbox.h> |
27 |
|
|
#include <gtkmm/treeview.h> |
28 |
|
|
#include <gtkmm/liststore.h> |
29 |
|
|
#include <gtkmm/scrolledwindow.h> |
30 |
|
|
|
31 |
|
|
#include <gig.h> |
32 |
|
|
|
33 |
|
|
class DimensionManager : public Gtk::Window { |
34 |
|
|
public: |
35 |
|
|
// triggered on all changes (i.e. dimension added or removed) |
36 |
|
|
sigc::signal<void> articulation_changed_signal; |
37 |
|
|
|
38 |
|
|
DimensionManager(); |
39 |
|
|
void show(gig::Region* region); |
40 |
|
|
protected: |
41 |
|
|
gig::Region* region; |
42 |
|
|
Gtk::VBox vbox; |
43 |
|
|
Gtk::HButtonBox buttonBox; |
44 |
|
|
Gtk::ScrolledWindow scrolledWindow; |
45 |
|
|
Gtk::TreeView treeView; |
46 |
|
|
Gtk::Button addButton; |
47 |
|
|
Gtk::Button removeButton; |
48 |
|
|
|
49 |
|
|
class ModelColumns : public Gtk::TreeModel::ColumnRecord { |
50 |
|
|
public: |
51 |
|
|
ModelColumns() { |
52 |
|
|
add(m_dim_type); |
53 |
|
|
add(m_bits); |
54 |
|
|
add(m_zones); |
55 |
|
|
add(m_description); |
56 |
|
|
add(m_definition); |
57 |
|
|
} |
58 |
|
|
|
59 |
|
|
Gtk::TreeModelColumn<Glib::ustring> m_dim_type; |
60 |
|
|
Gtk::TreeModelColumn<int> m_bits; |
61 |
|
|
Gtk::TreeModelColumn<int> m_zones; |
62 |
|
|
Gtk::TreeModelColumn<Glib::ustring> m_description; |
63 |
|
|
Gtk::TreeModelColumn<gig::dimension_def_t*> m_definition; |
64 |
|
|
} tableModel; |
65 |
|
|
|
66 |
|
|
class ComboModelColumns : public Gtk::TreeModel::ColumnRecord { |
67 |
|
|
public: |
68 |
|
|
ComboModelColumns() { |
69 |
|
|
add(m_type_id); |
70 |
|
|
add(m_type_name); |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
Gtk::TreeModelColumn<int> m_type_id; |
74 |
|
|
Gtk::TreeModelColumn<Glib::ustring> m_type_name; |
75 |
|
|
} comboModel; |
76 |
|
|
|
77 |
|
|
Glib::RefPtr<Gtk::ListStore> refTableModel; |
78 |
|
|
|
79 |
|
|
void refreshManager(); |
80 |
|
|
void addDimension(); |
81 |
|
|
void removeDimension(); |
82 |
|
|
}; |
83 |
|
|
|
84 |
|
|
#endif // GIGEDIT_DIMENSIONMANAGER_H |