/[svn]/gigedit/trunk/src/gigedit/midirules.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/midirules.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3363 by schoenebeck, Fri May 26 22:10:16 2017 UTC revision 3364 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC
# Line 17  Line 17 
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) {
# Line 34  MidiRules::MidiRules() : Line 40  MidiRules::MidiRules() :
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);
# Line 55  MidiRules::MidiRules() : Line 69  MidiRules::MidiRules() :
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();
# Line 70  MidiRules::MidiRules() : Line 92  MidiRules::MidiRules() :
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() {
# Line 143  void MidiRules::set_instrument(gig::Inst Line 167  void MidiRules::set_instrument(gig::Inst
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    
# Line 205  MidiRuleCtrlTrigger::MidiRuleCtrlTrigger Line 231  MidiRuleCtrlTrigger::MidiRuleCtrlTrigger
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    
# Line 406  void MidiRuleCtrlTrigger::add_row() { Line 437  void MidiRuleCtrlTrigger::add_row() {
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);
# Line 523  MidiRuleLegato::MidiRuleLegato() : Line 555  MidiRuleLegato::MidiRuleLegato() :
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);

Legend:
Removed from v.3363  
changed lines
  Added in v.3364

  ViewVC Help
Powered by ViewVC