17 |
* 02110-1301, USA. |
* 02110-1301, USA. |
18 |
*/ |
*/ |
19 |
|
|
20 |
|
#include "compat.h" |
21 |
#include "global.h" |
#include "global.h" |
22 |
#include "midirules.h" |
#include "midirules.h" |
23 |
|
|
24 |
#include <gtkmm/stock.h> |
#if HAS_GTKMM_STOCK |
25 |
|
# include <gtkmm/stock.h> |
26 |
|
#endif |
27 |
|
|
28 |
MidiRules::MidiRules() : |
MidiRules::MidiRules() : |
29 |
label(_("Midi rule:")), |
label(_("Midi rule:")), |
30 |
|
#if HAS_GTKMM_STOCK |
31 |
quit_button(Gtk::Stock::CLOSE), |
quit_button(Gtk::Stock::CLOSE), |
32 |
|
#else |
33 |
|
quit_button(_("_Close"), true), |
34 |
|
#endif |
35 |
unknown(_("unknown")) |
unknown(_("unknown")) |
36 |
{ |
{ |
37 |
if (!Settings::singleton()->autoRestoreWindowDimension) { |
if (!Settings::singleton()->autoRestoreWindowDimension) { |
40 |
} |
} |
41 |
|
|
42 |
set_title(_("Midi Rules")); |
set_title(_("Midi Rules")); |
43 |
|
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
44 |
|
set_margin(6); |
45 |
|
#else |
46 |
set_border_width(6); |
set_border_width(6); |
47 |
|
#endif |
48 |
|
|
49 |
add(vbox); |
add(vbox); |
50 |
|
|
51 |
|
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
52 |
|
hbox.set_margin(6); |
53 |
|
#else |
54 |
hbox.set_border_width(6); |
hbox.set_border_width(6); |
55 |
|
#endif |
56 |
hbox.set_spacing(6); |
hbox.set_spacing(6); |
57 |
hbox.pack_start(label, Gtk::PACK_SHRINK); |
hbox.pack_start(label, Gtk::PACK_SHRINK); |
58 |
hbox.pack_start(combo, Gtk::PACK_SHRINK); |
hbox.pack_start(combo, Gtk::PACK_SHRINK); |
69 |
sigc::mem_fun(*this, &MidiRules::combo_changed)); |
sigc::mem_fun(*this, &MidiRules::combo_changed)); |
70 |
vbox.pack_start(hbox, Gtk::PACK_SHRINK); |
vbox.pack_start(hbox, Gtk::PACK_SHRINK); |
71 |
|
|
72 |
|
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
73 |
|
box.set_margin(6); |
74 |
|
#else |
75 |
box.set_border_width(6); |
box.set_border_width(6); |
76 |
|
#endif |
77 |
vbox.pack_start(box); |
vbox.pack_start(box); |
78 |
|
|
79 |
|
#if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
80 |
|
button_box.set_margin(6); |
81 |
|
#else |
82 |
button_box.set_border_width(6); |
button_box.set_border_width(6); |
83 |
|
#endif |
84 |
button_box.set_layout(Gtk::BUTTONBOX_END); |
button_box.set_layout(Gtk::BUTTONBOX_END); |
85 |
button_box.pack_start(quit_button); |
button_box.pack_start(quit_button); |
86 |
quit_button.set_can_default(); |
quit_button.set_can_default(); |
92 |
legato.signal_changed().connect(sig_changed.make_slot()); |
legato.signal_changed().connect(sig_changed.make_slot()); |
93 |
ctrl_trigger.signal_changed().connect(sig_changed.make_slot()); |
ctrl_trigger.signal_changed().connect(sig_changed.make_slot()); |
94 |
|
|
95 |
|
#if HAS_GTKMM_SHOW_ALL_CHILDREN |
96 |
show_all_children(); |
show_all_children(); |
97 |
|
#endif |
98 |
} |
} |
99 |
|
|
100 |
void MidiRules::combo_changed() { |
void MidiRules::combo_changed() { |
167 |
remove_unknown_from_combo(); |
remove_unknown_from_combo(); |
168 |
combo.set_active(active); |
combo.set_active(active); |
169 |
} |
} |
170 |
|
#if HAS_GTKMM_SHOW_ALL_CHILDREN |
171 |
show_all_children(); |
show_all_children(); |
172 |
|
#endif |
173 |
update_model--; |
update_model--; |
174 |
} |
} |
175 |
|
|
231 |
scrolled_window.set_shadow_type(Gtk::SHADOW_IN); |
scrolled_window.set_shadow_type(Gtk::SHADOW_IN); |
232 |
scrolled_window.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); |
scrolled_window.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); |
233 |
|
|
234 |
|
#if USE_GTKMM_GRID |
235 |
|
table.set_column_spacing(5); |
236 |
|
#else |
237 |
table.set_col_spacings(5); |
table.set_col_spacings(5); |
238 |
|
#endif |
239 |
|
|
240 |
table.add(eControllerNumber); |
table.add(eControllerNumber); |
241 |
pack_start(table, Gtk::PACK_SHRINK); |
pack_start(table, Gtk::PACK_SHRINK); |
242 |
|
|
437 |
row[columns.override_pedal] = false; |
row[columns.override_pedal] = false; |
438 |
update_model--; |
update_model--; |
439 |
|
|
440 |
tree_view.get_selection()->select(row); |
//NOTE: was ->select(row) before, but did not compile with GTKMM4 development branch, probably going to be fixed before final GTKMM4 release though. |
441 |
|
tree_view.get_selection()->select(it); |
442 |
path = list_store->get_path(it); |
path = list_store->get_path(it); |
443 |
tree_view.scroll_to_row(path); |
tree_view.scroll_to_row(path); |
444 |
tree_view.set_cursor(path); |
tree_view.set_cursor(path); |
555 |
connect(eAltSustain1Key, &gig::MidiRuleLegato::AltSustain1Key); |
connect(eAltSustain1Key, &gig::MidiRuleLegato::AltSustain1Key); |
556 |
connect(eAltSustain2Key, &gig::MidiRuleLegato::AltSustain2Key); |
connect(eAltSustain2Key, &gig::MidiRuleLegato::AltSustain2Key); |
557 |
|
|
558 |
|
#if USE_GTKMM_GRID |
559 |
|
set_column_spacing(5); |
560 |
|
#else |
561 |
set_col_spacings(5); |
set_col_spacings(5); |
562 |
|
#endif |
563 |
|
|
564 |
add(eBypassUseController); |
add(eBypassUseController); |
565 |
add(eBypassKey); |
add(eBypassKey); |