/[svn]/gigedit/trunk/src/gigedit/dimensionmanager.h
ViewVC logotype

Contents of /gigedit/trunk/src/gigedit/dimensionmanager.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1677 - (show annotations) (download) (as text)
Sun Feb 10 08:50:35 2008 UTC (16 years, 2 months ago) by persson
File MIME type: text/x-c++hdr
File size: 2633 byte(s)
* bugfix: dimension manager window didn't update when another region
  was selected (#78)

1 /* -*- 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 sigc::signal<void, gig::Region*> region_to_be_changed_signal;
36 sigc::signal<void, gig::Region*> region_changed_signal;
37
38 DimensionManager();
39 void show(gig::Region* region);
40 void set_region(gig::Region* region);
41 protected:
42 gig::Region* region;
43 Gtk::VBox vbox;
44 Gtk::HButtonBox buttonBox;
45 Gtk::ScrolledWindow scrolledWindow;
46 Gtk::TreeView treeView;
47 Gtk::Button addButton;
48 Gtk::Button removeButton;
49
50 class ModelColumns : public Gtk::TreeModel::ColumnRecord {
51 public:
52 ModelColumns() {
53 add(m_dim_type);
54 add(m_bits);
55 add(m_zones);
56 add(m_description);
57 add(m_definition);
58 }
59
60 Gtk::TreeModelColumn<Glib::ustring> m_dim_type;
61 Gtk::TreeModelColumn<int> m_bits;
62 Gtk::TreeModelColumn<int> m_zones;
63 Gtk::TreeModelColumn<Glib::ustring> m_description;
64 Gtk::TreeModelColumn<gig::dimension_def_t*> m_definition;
65 } tableModel;
66
67 class ComboModelColumns : public Gtk::TreeModel::ColumnRecord {
68 public:
69 ComboModelColumns() {
70 add(m_type_id);
71 add(m_type_name);
72 }
73
74 Gtk::TreeModelColumn<int> m_type_id;
75 Gtk::TreeModelColumn<Glib::ustring> m_type_name;
76 } comboModel;
77
78 Glib::RefPtr<Gtk::ListStore> refTableModel;
79
80 void refreshManager();
81 void addDimension();
82 void removeDimension();
83 };
84
85 #endif // GIGEDIT_DIMENSIONMANAGER_H

  ViewVC Help
Powered by ViewVC