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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2558 - (show annotations) (download) (as text)
Sat May 17 23:55:30 2014 UTC (9 years, 11 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 2329 byte(s)
* Combine instruments: generalized this tool to allow combining instruments
  based on any dimension (selectable by combo box), not only the 'layer'
  dimension. Also fixed some bugs that could lead to undesired results
  when combining instruments, i.e. source instruments being copied into
  wrong target zones or in wrong order under certain conditions.
* 'Dimension Manager' dialog: show dialog window with at least 460x300px on
  initial usage (was far too small by default).

1 /*
2 Copyright (c) 2014 Christian Schoenebeck
3
4 This file is part of "gigedit" and released under the terms of the
5 GNU General Public License version 2.
6 */
7
8 #ifndef GIGEDIT_COMBINEINSTRUMENTSDIALOG
9 #define GIGEDIT_COMBINEINSTRUMENTSDIALOG
10
11 #include <gig.h>
12
13 #include <gtkmm/buttonbox.h>
14 #include <gtkmm/window.h>
15 #include <gtkmm/dialog.h>
16 #include <gtkmm/treeview.h>
17 #include <gtkmm/liststore.h>
18 #include <gtkmm/table.h>
19 #include <gtkmm/comboboxtext.h>
20
21 #include "wrapLabel.hh"
22
23 /**
24 * @brief Modal dialog which allows to merge instruments.
25 *
26 * This dialog shows a list of all instruments of the currently open .gig file
27 * in gigedit and allows the user to shift select a set of instruments to be
28 * combined.
29 *
30 * If the user successfully combined instruments in this dialog, then
31 * newCombinedInstrument() will return a pointer to that new instrument.
32 */
33 class CombineInstrumentsDialog : public Gtk::Dialog {
34 public:
35 CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig);
36 bool fileWasChanged() const;
37 gig::Instrument* newCombinedInstrument() const;
38 protected:
39 gig::File* m_gig;
40 bool m_fileWasChanged;
41 gig::Instrument* m_newCombinedInstrument;
42
43 Gtk::HButtonBox m_buttonBox;
44 Gtk::TreeView m_treeView;
45 Gtk::Button m_cancelButton;
46 Gtk::Button m_OKButton;
47 #if GTKMM_MAJOR_VERSION < 3
48 view::WrapLabel m_descriptionLabel;
49 #else
50 Gtk::Label m_descriptionLabel;
51 #endif
52 Gtk::Table m_tableDimCombo;
53 Gtk::ComboBox m_comboDimType;
54 Gtk::Label m_labelDimType;
55
56 class ComboDimsModel : public Gtk::TreeModel::ColumnRecord {
57 public:
58 ComboDimsModel() {
59 add(m_type_id);
60 add(m_type_name);
61 }
62
63 Gtk::TreeModelColumn<int> m_type_id;
64 Gtk::TreeModelColumn<Glib::ustring> m_type_name;
65 } m_comboDimsModel;
66
67 class ListModel : public Gtk::TreeModel::ColumnRecord {
68 public:
69 ListModel() {
70 add(m_col_name);
71 add(m_col_instr);
72 }
73
74 Gtk::TreeModelColumn<Glib::ustring> m_col_name;
75 Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
76 } m_columns;
77
78 Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
79
80 void combineSelectedInstruments();
81 void onSelectionChanged();
82 };
83
84 #endif // GIGEDIT_COMBINEINSTRUMENTSDIALOG

  ViewVC Help
Powered by ViewVC