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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3299 - (hide annotations) (download) (as text)
Sun Jul 9 12:44:59 2017 UTC (6 years, 9 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3234 byte(s)
* Combine Tool: Now it allows to select the instruments to be combined
  already in the main window's instruments list view; then either call
  the combine instrument dialog from the main menu or use the new
  keyboard shortcut Ctrl + j.
* Combine Tool: Show instruments' index number in the list view.
* Bumped version (1.0.0.svn54).

1 schoenebeck 2548 /*
2 schoenebeck 3068 Copyright (c) 2014-2017 Christian Schoenebeck
3 schoenebeck 2548
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 schoenebeck 3068 #ifdef LIBGIG_HEADER_FILE
12     # include LIBGIG_HEADER_FILE(gig.h)
13     #else
14     # include <gig.h>
15     #endif
16 schoenebeck 2548
17     #include <gtkmm/buttonbox.h>
18     #include <gtkmm/window.h>
19     #include <gtkmm/dialog.h>
20     #include <gtkmm/treeview.h>
21     #include <gtkmm/liststore.h>
22 schoenebeck 2558 #include <gtkmm/table.h>
23     #include <gtkmm/comboboxtext.h>
24 schoenebeck 2616 #include <gtkmm/scrolledwindow.h>
25 schoenebeck 2548
26     #include "wrapLabel.hh"
27 schoenebeck 2894 #include "ManagedWindow.h"
28 schoenebeck 2548
29 schoenebeck 3299 #include <set>
30    
31 schoenebeck 2548 /**
32     * @brief Modal dialog which allows to merge instruments.
33     *
34     * This dialog shows a list of all instruments of the currently open .gig file
35     * in gigedit and allows the user to shift select a set of instruments to be
36     * combined.
37     *
38     * If the user successfully combined instruments in this dialog, then
39     * newCombinedInstrument() will return a pointer to that new instrument.
40     */
41 schoenebeck 2894 class CombineInstrumentsDialog : public ManagedDialog {
42 schoenebeck 2548 public:
43     CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig);
44     bool fileWasChanged() const;
45     gig::Instrument* newCombinedInstrument() const;
46 schoenebeck 3299 void setSelectedInstruments(const std::set<int>& instrumentIndeces);
47 schoenebeck 2894
48     // implementation for abstract methods of interface class "ManagedDialog"
49     virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->combineInstrumentsWindowX; }
50     virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->combineInstrumentsWindowY; }
51     virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->combineInstrumentsWindowW; }
52     virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->combineInstrumentsWindowH; }
53    
54 schoenebeck 2548 protected:
55     gig::File* m_gig;
56     bool m_fileWasChanged;
57     gig::Instrument* m_newCombinedInstrument;
58    
59     Gtk::HButtonBox m_buttonBox;
60 schoenebeck 2616 Gtk::ScrolledWindow m_scrolledWindow;
61 schoenebeck 2548 Gtk::TreeView m_treeView;
62     Gtk::Button m_cancelButton;
63     Gtk::Button m_OKButton;
64     #if GTKMM_MAJOR_VERSION < 3
65     view::WrapLabel m_descriptionLabel;
66     #else
67     Gtk::Label m_descriptionLabel;
68     #endif
69 schoenebeck 2558 Gtk::Table m_tableDimCombo;
70     Gtk::ComboBox m_comboDimType;
71     Gtk::Label m_labelDimType;
72 schoenebeck 2548
73 schoenebeck 2558 class ComboDimsModel : public Gtk::TreeModel::ColumnRecord {
74     public:
75     ComboDimsModel() {
76     add(m_type_id);
77     add(m_type_name);
78     }
79    
80     Gtk::TreeModelColumn<int> m_type_id;
81     Gtk::TreeModelColumn<Glib::ustring> m_type_name;
82     } m_comboDimsModel;
83    
84 schoenebeck 2548 class ListModel : public Gtk::TreeModel::ColumnRecord {
85     public:
86     ListModel() {
87 schoenebeck 3299 add(m_col_index);
88 schoenebeck 2548 add(m_col_name);
89     add(m_col_instr);
90     }
91    
92 schoenebeck 3299 Gtk::TreeModelColumn<int> m_col_index;
93 schoenebeck 2548 Gtk::TreeModelColumn<Glib::ustring> m_col_name;
94     Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
95     } m_columns;
96    
97     Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
98    
99     void combineSelectedInstruments();
100     void onSelectionChanged();
101     };
102    
103     #endif // GIGEDIT_COMBINEINSTRUMENTSDIALOG

  ViewVC Help
Powered by ViewVC