/[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 3409 - (hide annotations) (download) (as text)
Tue Jan 23 16:30:56 2018 UTC (6 years, 3 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 4422 byte(s)
* Added new main menu item "View" -> "Tooltips for Beginners" which allows
  to disable tooltips intended for newbies only (default: on).
* Bumped version (1.1.0.svn3).

1 schoenebeck 2548 /*
2 schoenebeck 3409 Copyright (c) 2014-2018 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 schoenebeck 3364 #include "compat.h"
18    
19 schoenebeck 2548 #include <gtkmm/buttonbox.h>
20     #include <gtkmm/window.h>
21     #include <gtkmm/dialog.h>
22     #include <gtkmm/treeview.h>
23     #include <gtkmm/liststore.h>
24 schoenebeck 3300 #include <gtkmm/iconview.h>
25 schoenebeck 3364 #if USE_GTKMM_GRID
26     # include <gtkmm/grid.h>
27     #else
28     # include <gtkmm/table.h>
29     #endif
30 schoenebeck 2558 #include <gtkmm/comboboxtext.h>
31 schoenebeck 2616 #include <gtkmm/scrolledwindow.h>
32 schoenebeck 2548
33     #include "wrapLabel.hh"
34 schoenebeck 2894 #include "ManagedWindow.h"
35 schoenebeck 2548
36 schoenebeck 3299 #include <set>
37    
38 schoenebeck 2548 /**
39     * @brief Modal dialog which allows to merge instruments.
40     *
41     * This dialog shows a list of all instruments of the currently open .gig file
42     * in gigedit and allows the user to shift select a set of instruments to be
43     * combined.
44     *
45     * If the user successfully combined instruments in this dialog, then
46     * newCombinedInstrument() will return a pointer to that new instrument.
47     */
48 schoenebeck 2894 class CombineInstrumentsDialog : public ManagedDialog {
49 schoenebeck 2548 public:
50     CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig);
51     bool fileWasChanged() const;
52     gig::Instrument* newCombinedInstrument() const;
53 schoenebeck 3299 void setSelectedInstruments(const std::set<int>& instrumentIndeces);
54 schoenebeck 2894
55     // implementation for abstract methods of interface class "ManagedDialog"
56     virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->combineInstrumentsWindowX; }
57     virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->combineInstrumentsWindowY; }
58     virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->combineInstrumentsWindowW; }
59     virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->combineInstrumentsWindowH; }
60    
61 schoenebeck 2548 protected:
62     gig::File* m_gig;
63     bool m_fileWasChanged;
64     gig::Instrument* m_newCombinedInstrument;
65    
66 schoenebeck 3364 HButtonBox m_buttonBox;
67 schoenebeck 2616 Gtk::ScrolledWindow m_scrolledWindow;
68 schoenebeck 2548 Gtk::TreeView m_treeView;
69 schoenebeck 3300 Gtk::IconView m_iconView;
70 schoenebeck 2548 Gtk::Button m_cancelButton;
71     Gtk::Button m_OKButton;
72     #if GTKMM_MAJOR_VERSION < 3
73     view::WrapLabel m_descriptionLabel;
74     #else
75     Gtk::Label m_descriptionLabel;
76     #endif
77 schoenebeck 3364 #if USE_GTKMM_GRID
78     Gtk::Grid m_tableDimCombo;
79     #else
80 schoenebeck 2558 Gtk::Table m_tableDimCombo;
81 schoenebeck 3364 #endif
82 schoenebeck 2558 Gtk::ComboBox m_comboDimType;
83     Gtk::Label m_labelDimType;
84 schoenebeck 3300 Gtk::Label m_labelOrder;
85 schoenebeck 2548
86 schoenebeck 2558 class ComboDimsModel : public Gtk::TreeModel::ColumnRecord {
87     public:
88     ComboDimsModel() {
89     add(m_type_id);
90     add(m_type_name);
91     }
92    
93     Gtk::TreeModelColumn<int> m_type_id;
94     Gtk::TreeModelColumn<Glib::ustring> m_type_name;
95     } m_comboDimsModel;
96    
97 schoenebeck 2548 class ListModel : public Gtk::TreeModel::ColumnRecord {
98     public:
99     ListModel() {
100 schoenebeck 3299 add(m_col_index);
101 schoenebeck 2548 add(m_col_name);
102     add(m_col_instr);
103     }
104    
105 schoenebeck 3299 Gtk::TreeModelColumn<int> m_col_index;
106 schoenebeck 2548 Gtk::TreeModelColumn<Glib::ustring> m_col_name;
107     Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
108     } m_columns;
109    
110 schoenebeck 3300 class OrderListModel : public Gtk::TreeModel::ColumnRecord {
111     public:
112     OrderListModel() {
113     add(m_col_name);
114     add(m_col_markup);
115     add(m_col_instr);
116     }
117    
118     Gtk::TreeModelColumn<Glib::ustring> m_col_name;
119     Gtk::TreeModelColumn<Glib::ustring> m_col_markup;
120     Gtk::TreeModelColumn<gig::Instrument*> m_col_instr;
121     } m_orderColumns;
122    
123 schoenebeck 2548 Glib::RefPtr<Gtk::ListStore> m_refTreeModel;
124 schoenebeck 3300 Glib::RefPtr<Gtk::ListStore> m_refOrderModel;
125     bool first_call_to_drag_data_get;
126 schoenebeck 2548
127     void combineSelectedInstruments();
128     void onSelectionChanged();
129 schoenebeck 3300 void on_order_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
130     void on_order_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
131     Gtk::SelectionData& selection_data, guint, guint);
132     void on_order_drop_drag_data_received(
133     const Glib::RefPtr<Gdk::DragContext>& context, int x, int y,
134     const Gtk::SelectionData& selection_data, guint, guint time
135     );
136 schoenebeck 3409 void on_show_tooltips_changed();
137 schoenebeck 2548 };
138    
139     #endif // GIGEDIT_COMBINEINSTRUMENTSDIALOG

  ViewVC Help
Powered by ViewVC